Skip to main content

read_active_and_known_peers_at_block_hash

Function read_active_and_known_peers_at_block_hash 

Source
pub(crate) fn read_active_and_known_peers_at_block_hash(
    node: &TempoFullNode,
    known: &Set<PublicKey>,
    hash: B256,
) -> Result<Map<PublicKey, Address>>
Expand description

Returns all active validators read from block state at block hash.

The returned validators are those that are marked active according to block state, and those that are known. This accounts for those validators that are actively participating in consensus (including DKG) but might be marked inactive on chain.

This function reads the header corresponding to hash from node and checks if the T2 hardfork is active at header.timestamp and if the Validator Config V2 is initialized.

If T2 is active and the contract is initialized, it will read the entries from the Validator Config V2 contract.

Otherwise, it will read the entries from the V1 contract.