@@ -471,7 +471,7 @@ func livenessFailsafeInEffect*(
471471
472472 false
473473
474- # https://github.com/ethereum/consensus-specs/blob/v1.4.0-alpha.3 /specs/phase0/p2p-interface.md#attestation-subnet-subcription
474+ # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1 /specs/phase0/p2p-interface.md#attestation-subnet-subscription
475475func compute_subscribed_subnet (node_id: UInt256 , epoch: Epoch , index: uint64 ):
476476 SubnetId =
477477 # Ensure neither `truncate` loses information
@@ -482,7 +482,8 @@ func compute_subscribed_subnet(node_id: UInt256, epoch: Epoch, index: uint64):
482482
483483 let
484484 node_id_prefix = truncate (
485- node_id shr (NODE_ID_BITS - ATTESTATION_SUBNET_PREFIX_BITS ), uint64 )
485+ node_id shr (
486+ NODE_ID_BITS - static (ATTESTATION_SUBNET_PREFIX_BITS .int )), uint64 )
486487 node_offset = truncate (
487488 node_id mod static (EPOCHS_PER_SUBNET_SUBSCRIPTION .u256), uint64 )
488489 permutation_seed = eth2digest (uint_to_bytes (
@@ -494,7 +495,7 @@ func compute_subscribed_subnet(node_id: UInt256, epoch: Epoch, index: uint64):
494495 )
495496 SubnetId ((permutated_prefix + index) mod ATTESTATION_SUBNET_COUNT )
496497
497- # https://github.com/ethereum/consensus-specs/blob/v1.4.0-alpha.3 /specs/phase0/p2p-interface.md#attestation-subnet-subcription
498+ # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1 /specs/phase0/p2p-interface.md#attestation-subnet-subscription
498499iterator compute_subscribed_subnets * (node_id: UInt256 , epoch: Epoch ): SubnetId =
499500 for index in 0 'u64 ..< SUBNETS_PER_NODE :
500501 yield compute_subscribed_subnet (node_id, epoch, index)
0 commit comments