Skip to main content

read_syncers_if_v2_not_initialized

Function read_syncers_if_v2_not_initialized 

Source
pub(crate) fn read_syncers_if_v2_not_initialized(
    _attempt: u32,
    node: &TempoFullNode,
    parent_hash: B256,
    block_hash: B256,
) -> Result<Set<PublicKey>>
Expand description

Reads the pre-t2 hardfork syncers from the v1 contract.

If the validator config v2 contract is already initialized, then this returns an empty set because after the hardfork syncers do not need to be tracked.

IMPORTANT: it is expected that this function is called on boundary blocks. Post-T2 hardfork, the next players are determined from the V2 smart contract on the boundary block’s parent(!) block, not on the boundary block itself.

Therefore, this function checks if the hardfork already happened by the timestamp of the block identified by parent_hash, and likewise if the contract was initialized at the state of parent_hash.