From 2f634c10a4ce237f03badcb52bc2fa8e155d4983 Mon Sep 17 00:00:00 2001 From: tersec Date: Tue, 21 Mar 2023 00:42:22 +0000 Subject: [PATCH] automated consensus spec URL updating from v1.3.0-rc.4 to rc.5 (#4756) --- beacon_chain/beacon_chain_db_immutable.nim | 4 +- beacon_chain/consensus_object_pools/README.md | 12 +++--- .../attestation_pool.nim | 6 +-- .../block_pools_types.nim | 2 +- .../consensus_object_pools/blockchain_dag.nim | 2 +- .../consensus_object_pools/spec_cache.nim | 6 +-- .../sync_committee_msg_pool.nim | 2 +- beacon_chain/eth1/merkle_minimal.nim | 2 +- beacon_chain/fork_choice/fork_choice.nim | 2 +- beacon_chain/gossip_processing/README.md | 12 +++--- .../gossip_processing/block_processor.nim | 2 +- .../gossip_processing/gossip_validation.nim | 20 +++++----- beacon_chain/networking/eth2_network.nim | 20 +++++----- beacon_chain/rpc/rest_config_api.nim | 8 ++-- beacon_chain/spec/beacon_time.nim | 16 ++++---- beacon_chain/spec/beaconstate.nim | 36 ++++++++--------- beacon_chain/spec/datatypes/altair.nim | 30 +++++++------- beacon_chain/spec/datatypes/base.nim | 26 ++++++------ beacon_chain/spec/datatypes/bellatrix.nim | 10 ++--- beacon_chain/spec/datatypes/capella.nim | 40 +++++++++---------- beacon_chain/spec/datatypes/constants.nim | 10 ++--- beacon_chain/spec/datatypes/deneb.nim | 40 +++++++++---------- beacon_chain/spec/datatypes/phase0.nim | 4 +- beacon_chain/spec/eth2_apis/rest_types.nim | 6 +-- beacon_chain/spec/forks.nim | 2 +- beacon_chain/spec/forks_light_client.nim | 6 +-- beacon_chain/spec/helpers.nim | 34 ++++++++-------- beacon_chain/spec/keystore.nim | 2 +- beacon_chain/spec/network.nim | 28 ++++++------- beacon_chain/spec/presets.nim | 4 +- .../spec/presets/gnosis/altair_preset.nim | 2 +- .../spec/presets/gnosis/deneb_preset.nim | 2 +- .../spec/presets/mainnet/altair_preset.nim | 2 +- .../spec/presets/mainnet/bellatrix_preset.nim | 2 +- .../spec/presets/mainnet/capella_preset.nim | 2 +- .../spec/presets/mainnet/deneb_preset.nim | 2 +- .../spec/presets/minimal/altair_preset.nim | 2 +- .../spec/presets/minimal/bellatrix_preset.nim | 2 +- .../spec/presets/minimal/capella_preset.nim | 2 +- .../spec/presets/minimal/deneb_preset.nim | 2 +- beacon_chain/spec/signatures.nim | 20 +++++----- beacon_chain/spec/state_transition.nim | 8 ++-- beacon_chain/spec/state_transition_block.nim | 20 +++++----- beacon_chain/spec/state_transition_epoch.nim | 30 +++++++------- beacon_chain/spec/weak_subjectivity.nim | 2 +- beacon_chain/sync/light_client_manager.nim | 10 ++--- beacon_chain/sync/sync_protocol.nim | 12 +++--- beacon_chain/validators/action_tracker.nim | 4 +- .../validators/slashing_protection_v2.nim | 4 +- beacon_chain/validators/validator_pool.nim | 16 ++++---- docs/attestation_flow.md | 10 ++--- docs/block_flow.md | 6 +-- docs/the_nimbus_book/src/el-light-client.md | 2 +- tests/consensus_spec/fixtures_utils.nim | 2 +- tests/testblockutil.nim | 4 +- 55 files changed, 282 insertions(+), 282 deletions(-) diff --git a/beacon_chain/beacon_chain_db_immutable.nim b/beacon_chain/beacon_chain_db_immutable.nim index aeae881b8c..d5820510c4 100644 --- a/beacon_chain/beacon_chain_db_immutable.nim +++ b/beacon_chain/beacon_chain_db_immutable.nim @@ -124,7 +124,7 @@ type current_sync_committee*: SyncCommittee # [New in Altair] next_sync_committee*: SyncCommittee # [New in Altair] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#beaconstate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#beaconstate # Memory-representation-equivalent to a Bellatrix BeaconState for in-place SSZ # reading and writing BellatrixBeaconStateNoImmutableValidators* = object @@ -255,7 +255,7 @@ type HashList[HistoricalSummary, Limit HISTORICAL_ROOTS_LIMIT] # [New in Capella] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#beaconstate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#beaconstate # with indirect changes via ExecutionPayloadHeader # Memory-representation-equivalent to a Deneb BeaconState for in-place SSZ # reading and writing diff --git a/beacon_chain/consensus_object_pools/README.md b/beacon_chain/consensus_object_pools/README.md index c00615dd48..41b6c1fb69 100644 --- a/beacon_chain/consensus_object_pools/README.md +++ b/beacon_chain/consensus_object_pools/README.md @@ -4,12 +4,12 @@ This folder holds the various consensus object pools needed for a blockchain cli Object in those pools have passed the "gossip validation" filter according to specs: -- blocks: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_block -- aggregate attestations: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof -- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id -- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#voluntary_exit -- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#attester_slashing -- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#proposer_slashing +- blocks: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_block +- aggregate attestations: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof +- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id +- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#voluntary_exit +- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#attester_slashing +- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#proposer_slashing After "gossip validation" the consensus objects can be rebroadcasted as they are optimistically good, however for internal processing further verification is needed. For blocks, this means verifying state transition and all contained cryptographic signatures (instead of just the proposer signature). diff --git a/beacon_chain/consensus_object_pools/attestation_pool.nim b/beacon_chain/consensus_object_pools/attestation_pool.nim index 7270014fc7..66444b1fec 100644 --- a/beacon_chain/consensus_object_pools/attestation_pool.nim +++ b/beacon_chain/consensus_object_pools/attestation_pool.nim @@ -562,7 +562,7 @@ proc getAttestationsForBlock*(pool: var AttestationPool, cache: var StateCache): seq[Attestation] = ## Retrieve attestations that may be added to a new block at the slot of the ## given state - ## https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#attestations + ## https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#attestations let newBlockSlot = state.data.slot.uint64 if newBlockSlot < MIN_ATTESTATION_INCLUSION_DELAY: @@ -746,7 +746,7 @@ func getAggregatedAttestation*(pool: var AttestationPool, index: CommitteeIndex): Opt[Attestation] = ## Select the attestation that has the most votes going for it in the given ## slot/index - ## https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#construct-aggregate + ## https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#construct-aggregate let candidateIdx = pool.candidateIdx(slot) if candidateIdx.isNone: return Opt.none(Attestation) @@ -776,7 +776,7 @@ proc getBeaconHead*( finalizedExecutionPayloadHash = pool.dag.loadExecutionBlockRoot(pool.dag.finalizedHead.blck) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/fork_choice/safe-block.md#get_safe_execution_payload_hash + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/fork_choice/safe-block.md#get_safe_execution_payload_hash safeBlockRoot = pool.forkChoice.get_safe_beacon_block_root() safeBlock = pool.dag.getBlockRef(safeBlockRoot) safeExecutionPayloadHash = diff --git a/beacon_chain/consensus_object_pools/block_pools_types.nim b/beacon_chain/consensus_object_pools/block_pools_types.nim index 219b23f097..9e29a017e2 100644 --- a/beacon_chain/consensus_object_pools/block_pools_types.nim +++ b/beacon_chain/consensus_object_pools/block_pools_types.nim @@ -235,7 +235,7 @@ type ## committee messages will be rejected optimisticRoots*: HashSet[Eth2Digest] - ## https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/sync/optimistic.md#helpers + ## https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/sync/optimistic.md#helpers EpochKey* = object ## The epoch key fully determines the shuffling for proposers and diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index 81f201ed40..48de53feb5 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -1681,7 +1681,7 @@ proc pruneBlocksDAG(dag: ChainDAGRef) = prunedHeads = hlen - dag.heads.len, dagPruneDur = Moment.now() - startTick -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/sync/optimistic.md#helpers +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/sync/optimistic.md#helpers template is_optimistic*(dag: ChainDAGRef, root: Eth2Digest): bool = root in dag.optimisticRoots diff --git a/beacon_chain/consensus_object_pools/spec_cache.nim b/beacon_chain/consensus_object_pools/spec_cache.nim index d0a16c18cf..16486f75c5 100644 --- a/beacon_chain/consensus_object_pools/spec_cache.nim +++ b/beacon_chain/consensus_object_pools/spec_cache.nim @@ -76,7 +76,7 @@ func get_beacon_committee_len*( committees_per_slot * SLOTS_PER_EPOCH ) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_attesting_indices +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_attesting_indices iterator get_attesting_indices*(shufflingRef: ShufflingRef, slot: Slot, committee_index: CommitteeIndex, @@ -181,7 +181,7 @@ func makeAttestationData*( doAssert current_epoch == epochRef.epoch - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#attestation-data + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#attestation-data AttestationData( slot: slot, index: committee_index.asUInt64, @@ -191,7 +191,7 @@ func makeAttestationData*( epoch: current_epoch, root: epoch_boundary_block.blck.root)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#validator-assignments +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#validator-assignments iterator get_committee_assignments*( shufflingRef: ShufflingRef, validator_indices: HashSet[ValidatorIndex]): tuple[committee_index: CommitteeIndex, diff --git a/beacon_chain/consensus_object_pools/sync_committee_msg_pool.nim b/beacon_chain/consensus_object_pools/sync_committee_msg_pool.nim index 6f41d35645..e54eb744ff 100644 --- a/beacon_chain/consensus_object_pools/sync_committee_msg_pool.nim +++ b/beacon_chain/consensus_object_pools/sync_committee_msg_pool.nim @@ -295,7 +295,7 @@ proc produceSyncAggregate*( proc isEpochLeadTime*( pool: SyncCommitteeMsgPool, epochsToSyncPeriod: uint64): bool = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#sync-committee-subnet-stability + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#sync-committee-subnet-stability # This ensures a uniform distribution without requiring additional state: # (1/4) = 1/4, 4 slots out # (3/4) * (1/3) = 1/4, 3 slots out diff --git a/beacon_chain/eth1/merkle_minimal.nim b/beacon_chain/eth1/merkle_minimal.nim index 24b452dcfa..fca1f56b22 100644 --- a/beacon_chain/eth1/merkle_minimal.nim +++ b/beacon_chain/eth1/merkle_minimal.nim @@ -7,7 +7,7 @@ {.push raises: [].} -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/tests/core/pyspec/eth2spec/utils/merkle_minimal.py +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/tests/core/pyspec/eth2spec/utils/merkle_minimal.py # Merkle tree helpers # --------------------------------------------------------------- diff --git a/beacon_chain/fork_choice/fork_choice.nim b/beacon_chain/fork_choice/fork_choice.nim index fd4f6b00d0..91eeaf9504 100644 --- a/beacon_chain/fork_choice/fork_choice.nim +++ b/beacon_chain/fork_choice/fork_choice.nim @@ -425,7 +425,7 @@ proc get_head*(self: var ForkChoice, self.checkpoints.justified.balances, self.checkpoints.proposer_boost_root) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/fork_choice/safe-block.md#get_safe_beacon_block_root +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/fork_choice/safe-block.md#get_safe_beacon_block_root func get_safe_beacon_block_root*(self: ForkChoice): Eth2Digest = # Use most recent justified block as a stopgap self.checkpoints.justified.checkpoint.root diff --git a/beacon_chain/gossip_processing/README.md b/beacon_chain/gossip_processing/README.md index 4395f7d6a5..7b01cc0fdb 100644 --- a/beacon_chain/gossip_processing/README.md +++ b/beacon_chain/gossip_processing/README.md @@ -9,12 +9,12 @@ This folder holds a collection of modules to: Gossip validation is different from consensus verification in particular for blocks. -- Blocks: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_block -- Attestations (aggregated): https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof -- Attestations (unaggregated): https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#attestation-subnets -- Voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#voluntary_exit -- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#proposer_slashing -- Attester slashing: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#attester_slashing +- Blocks: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_block +- Attestations (aggregated): https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof +- Attestations (unaggregated): https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#attestation-subnets +- Voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#voluntary_exit +- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#proposer_slashing +- Attester slashing: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#attester_slashing There are multiple consumers of validated consensus objects: - a `ValidationResult.Accept` output triggers rebroadcasting in libp2p diff --git a/beacon_chain/gossip_processing/block_processor.nim b/beacon_chain/gossip_processing/block_processor.nim index f99930f75f..7b7cc270f2 100644 --- a/beacon_chain/gossip_processing/block_processor.nim +++ b/beacon_chain/gossip_processing/block_processor.nim @@ -633,7 +633,7 @@ proc processBlock( # - MUST NOT optimistically import the block. # - MUST NOT apply the block to the fork choice store. # - MAY queue the block for later processing. - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/sync/optimistic.md#execution-engine-errors + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/sync/optimistic.md#execution-engine-errors await sleepAsync(chronos.seconds(1)) self[].addBlock( entry.src, entry.blck, entry.blobs, entry.resfut, entry.maybeFinalized, diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index 3cfbd2014f..7f488cfedd 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -92,7 +92,7 @@ func check_propagation_slot_range( let pastSlot = (wallTime - MAXIMUM_GOSSIP_CLOCK_DISPARITY).toSlot() - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#configuration + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#configuration # The spec value of ATTESTATION_PROPAGATION_SLOT_RANGE is 32, but it can # retransmit attestations on the cusp of being out of spec, and which by # the time they reach their destination might be out of spec. @@ -178,7 +178,7 @@ template validateBeaconBlockBellatrix( parent: BlockRef): untyped = discard -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/p2p-interface.md#beacon_block +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/p2p-interface.md#beacon_block template validateBeaconBlockBellatrix( signed_beacon_block: bellatrix.SignedBeaconBlock | capella.SignedBeaconBlock | deneb.SignedBeaconBlock, @@ -248,7 +248,7 @@ proc validateBeaconBlock*( # proposer for the slot, signed_beacon_block.message.slot. # # While this condition is similar to the proposer slashing condition at - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#proposer-slashing + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#proposer-slashing # it's not identical, and this check does not address slashing: # # (1) The beacon blocks must be conflicting, i.e. different, for the same @@ -746,7 +746,7 @@ proc validateAggregate*( return ok((attesting_indices, sig)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/p2p-interface.md#bls_to_execution_change +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/p2p-interface.md#bls_to_execution_change proc validateBlsToExecutionChange*( pool: ValidatorChangePool, batchCrypto: ref BatchCrypto, signed_address_change: SignedBLSToExecutionChange, @@ -791,7 +791,7 @@ proc validateBlsToExecutionChange*( return ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#attester_slashing +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#attester_slashing proc validateAttesterSlashing*( pool: ValidatorChangePool, attester_slashing: AttesterSlashing): Result[void, ValidationError] = @@ -812,7 +812,7 @@ proc validateAttesterSlashing*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#proposer_slashing +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#proposer_slashing proc validateProposerSlashing*( pool: ValidatorChangePool, proposer_slashing: ProposerSlashing): Result[void, ValidationError] = @@ -835,7 +835,7 @@ proc validateProposerSlashing*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#voluntary_exit +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#voluntary_exit proc validateVoluntaryExit*( pool: ValidatorChangePool, signed_voluntary_exit: SignedVoluntaryExit): Result[void, ValidationError] = @@ -865,7 +865,7 @@ proc validateVoluntaryExit*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/p2p-interface.md#sync_committee_subnet_id +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/p2p-interface.md#sync_committee_subnet_id proc validateSyncCommitteeMessage*( dag: ChainDAGRef, batchCrypto: ref BatchCrypto, @@ -1057,7 +1057,7 @@ proc validateContribution*( return ok((sig, participants)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#light_client_finality_update +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#light_client_finality_update proc validateLightClientFinalityUpdate*( pool: var LightClientPool, dag: ChainDAGRef, finality_update: ForkedLightClientFinalityUpdate, @@ -1093,7 +1093,7 @@ proc validateLightClientFinalityUpdate*( pool.latestForwardedFinalitySlot = finalized_slot ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#light_client_optimistic_update +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#light_client_optimistic_update proc validateLightClientOptimisticUpdate*( pool: var LightClientPool, dag: ChainDAGRef, optimistic_update: ForkedLightClientOptimisticUpdate, diff --git a/beacon_chain/networking/eth2_network.nim b/beacon_chain/networking/eth2_network.nim index e249a06c38..1bb483bdf9 100644 --- a/beacon_chain/networking/eth2_network.nim +++ b/beacon_chain/networking/eth2_network.nim @@ -171,7 +171,7 @@ type MounterProc* = proc(network: Eth2Node) {.gcsafe, raises: [Defect, CatchableError].} MessageContentPrinter* = proc(msg: pointer): string {.gcsafe, raises: [Defect].} - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#goodbye + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#goodbye DisconnectionReason* = enum # might see other values on the wire! ClientShutDown = 1 @@ -2219,8 +2219,8 @@ proc getPersistentNetKeys*( func gossipId( data: openArray[byte], phase0Prefix, topic: string): seq[byte] = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#topics-and-messages - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/p2p-interface.md#topics-and-messages + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#topics-and-messages + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/p2p-interface.md#topics-and-messages const MESSAGE_DOMAIN_INVALID_SNAPPY = [0x00'u8, 0x00, 0x00, 0x00] MESSAGE_DOMAIN_VALID_SNAPPY = [0x01'u8, 0x00, 0x00, 0x00] @@ -2485,7 +2485,7 @@ proc broadcast(node: Eth2Node, topic: string, msg: auto): proc subscribeAttestationSubnets*( node: Eth2Node, subnets: AttnetBits, forkDigest: ForkDigest) = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#attestations-and-aggregation + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#attestations-and-aggregation # Nimbus won't score attestation subnets for now, we just rely on block and # aggregate which are more stable and reliable @@ -2496,7 +2496,7 @@ proc subscribeAttestationSubnets*( proc unsubscribeAttestationSubnets*( node: Eth2Node, subnets: AttnetBits, forkDigest: ForkDigest) = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#attestations-and-aggregation + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#attestations-and-aggregation # Nimbus won't score attestation subnets for now; we just rely on block and # aggregate which are more stable and reliable @@ -2505,15 +2505,15 @@ proc unsubscribeAttestationSubnets*( node.unsubscribe(getAttestationTopic(forkDigest, SubnetId(subnet_id))) proc updateStabilitySubnetMetadata*(node: Eth2Node, attnets: AttnetBits) = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#metadata + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#metadata if node.metadata.attnets == attnets: return node.metadata.seq_number += 1 node.metadata.attnets = attnets - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#phase-0-attestation-subnet-stability - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#attestation-subnet-bitfield + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#phase-0-attestation-subnet-stability + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#attestation-subnet-bitfield let res = node.discovery.updateRecord({ enrAttestationSubnetsField: SSZ.encode(node.metadata.attnets) }) @@ -2525,7 +2525,7 @@ proc updateStabilitySubnetMetadata*(node: Eth2Node, attnets: AttnetBits) = debug "Stability subnets changed; updated ENR attnets", attnets proc updateSyncnetsMetadata*(node: Eth2Node, syncnets: SyncnetBits) = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#sync-committee-subnet-stability + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#sync-committee-subnet-stability if node.metadata.syncnets == syncnets: return @@ -2566,7 +2566,7 @@ proc broadcastAttestation*( node: Eth2Node, subnet_id: SubnetId, attestation: Attestation): Future[SendResult] = # Regardless of the contents of the attestation, - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/p2p-interface.md#transitioning-the-gossip + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/p2p-interface.md#transitioning-the-gossip # implies that pre-fork, messages using post-fork digests might be # ignored, whilst post-fork, there is effectively a seen_ttl-based # timer unsubscription point that means no new pre-fork-forkdigest diff --git a/beacon_chain/rpc/rest_config_api.nim b/beacon_chain/rpc/rest_config_api.nim index 50fbbf7811..ab03e7b72f 100644 --- a/beacon_chain/rpc/rest_config_api.nim +++ b/beacon_chain/rpc/rest_config_api.nim @@ -90,7 +90,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) = MAX_VOLUNTARY_EXITS: Base10.toString(MAX_VOLUNTARY_EXITS), - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/altair.yaml + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/altair.yaml INACTIVITY_PENALTY_QUOTIENT_ALTAIR: Base10.toString(INACTIVITY_PENALTY_QUOTIENT_ALTAIR), MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR: @@ -106,7 +106,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) = UPDATE_TIMEOUT: Base10.toString(UPDATE_TIMEOUT), - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/bellatrix.yaml + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/bellatrix.yaml INACTIVITY_PENALTY_QUOTIENT_BELLATRIX: Base10.toString(INACTIVITY_PENALTY_QUOTIENT_BELLATRIX), MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX: @@ -240,7 +240,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) = to0xHex(DOMAIN_CONTRIBUTION_AND_PROOF.data), # PARTICIPATION_FLAG_WEIGHTS - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#constants + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#constants TARGET_AGGREGATORS_PER_COMMITTEE: Base10.toString(TARGET_AGGREGATORS_PER_COMMITTEE), RANDOM_SUBNETS_PER_VALIDATOR: @@ -250,7 +250,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) = ATTESTATION_SUBNET_COUNT: Base10.toString(ATTESTATION_SUBNET_COUNT), - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#constants + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#constants TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE: Base10.toString(uint64(TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE)), SYNC_COMMITTEE_SUBNET_COUNT: diff --git a/beacon_chain/spec/beacon_time.nim b/beacon_chain/spec/beacon_time.nim index 22ca00810f..1c7de9b4a9 100644 --- a/beacon_chain/spec/beacon_time.nim +++ b/beacon_chain/spec/beacon_time.nim @@ -43,7 +43,7 @@ const GENESIS_SLOT* = Slot(0) GENESIS_EPOCH* = Epoch(0) # compute_epoch_at_slot(GENESIS_SLOT) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/fork-choice.md#constant + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/fork-choice.md#constant INTERVALS_PER_SLOT* = 3 FAR_FUTURE_BEACON_TIME* = BeaconTime(ns_since_genesis: int64.high()) @@ -134,22 +134,22 @@ template `+`*(a: TimeDiff, b: Duration): TimeDiff = const # Offsets from the start of the slot to when the corresponding message should # be sent - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#attesting + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#attesting attestationSlotOffset* = TimeDiff(nanoseconds: NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#broadcast-aggregate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#broadcast-aggregate aggregateSlotOffset* = TimeDiff(nanoseconds: NANOSECONDS_PER_SLOT.int64 * 2 div INTERVALS_PER_SLOT) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#prepare-sync-committee-message + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#prepare-sync-committee-message syncCommitteeMessageSlotOffset* = TimeDiff(nanoseconds: NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#broadcast-sync-committee-contribution + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#broadcast-sync-committee-contribution syncContributionSlotOffset* = TimeDiff(nanoseconds: NANOSECONDS_PER_SLOT.int64 * 2 div INTERVALS_PER_SLOT) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#sync-committee + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#sync-committee lightClientFinalityUpdateSlotOffset* = TimeDiff(nanoseconds: NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#sync-committee + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#sync-committee lightClientOptimisticUpdateSlotOffset* = TimeDiff(nanoseconds: NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT) @@ -217,7 +217,7 @@ iterator slots*(epoch: Epoch): Slot = for slot in start_slot ..< start_slot + SLOTS_PER_EPOCH: yield slot -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#sync-committee +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#sync-committee template sync_committee_period*(epoch: Epoch): SyncCommitteePeriod = if epoch == FAR_FUTURE_EPOCH: FAR_FUTURE_PERIOD else: SyncCommitteePeriod(epoch div EPOCHS_PER_SYNC_COMMITTEE_PERIOD) diff --git a/beacon_chain/spec/beaconstate.nim b/beacon_chain/spec/beaconstate.nim index 3a6b5df249..54d3b6e2ae 100644 --- a/beacon_chain/spec/beaconstate.nim +++ b/beacon_chain/spec/beaconstate.nim @@ -22,7 +22,7 @@ from ./datatypes/capella import BeaconState, ExecutionPayloadHeader, Withdrawal export extras, forks, validator, chronicles -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#increase_balance +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#increase_balance func increase_balance*(balance: var Gwei, delta: Gwei) = balance += delta @@ -135,7 +135,7 @@ from ./datatypes/deneb import BeaconState # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#slash_validator # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/altair/beacon-chain.md#modified-slash_validator -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#modified-slash_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#modified-slash_validator func get_slashing_penalty*(state: ForkyBeaconState, validator_effective_balance: Gwei): Gwei = # TODO Consider whether this is better than splitting the functions apart; in @@ -151,14 +151,14 @@ func get_slashing_penalty*(state: ForkyBeaconState, {.fatal: "invalid BeaconState type".} # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#slash_validator -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/beacon-chain.md#modified-slash_validator -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#modified-slash_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/beacon-chain.md#modified-slash_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#modified-slash_validator func get_whistleblower_reward*(validator_effective_balance: Gwei): Gwei = validator_effective_balance div WHISTLEBLOWER_REWARD_QUOTIENT # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#slash_validator # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/altair/beacon-chain.md#modified-slash_validator -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#modified-slash_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#modified-slash_validator func get_proposer_reward(state: ForkyBeaconState, whistleblower_reward: Gwei): Gwei = when state is phase0.BeaconState: whistleblower_reward div PROPOSER_REWARD_QUOTIENT @@ -170,7 +170,7 @@ func get_proposer_reward(state: ForkyBeaconState, whistleblower_reward: Gwei): G # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#slash_validator # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/altair/beacon-chain.md#modified-slash_validator -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#modified-slash_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#modified-slash_validator proc slash_validator*( cfg: RuntimeConfig, state: var ForkyBeaconState, slashed_index: ValidatorIndex, cache: var StateCache): @@ -304,7 +304,7 @@ func get_block_root_at_slot*( withState(state): get_block_root_at_slot(forkyState.data, slot) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_block_root +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_block_root func get_block_root*(state: ForkyBeaconState, epoch: Epoch): Eth2Digest = ## Return the block root at the start of a recent ``epoch``. get_block_root_at_slot(state, epoch.start_slot()) @@ -314,7 +314,7 @@ func get_block_root*(state: ForkedHashedBeaconState, epoch: Epoch): Eth2Digest = withState(state): get_block_root(forkyState.data, epoch) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_total_balance +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_total_balance template get_total_balance( state: ForkyBeaconState, validator_indices: untyped): Gwei = ## Return the combined effective balance of the ``indices``. @@ -325,7 +325,7 @@ template get_total_balance( res += state.validators[validator_index].effective_balance max(EFFECTIVE_BALANCE_INCREMENT, res) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue func is_eligible_for_activation_queue*(validator: Validator): bool = ## Check if ``validator`` is eligible to be placed into the activation queue. validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH and @@ -538,7 +538,7 @@ func get_total_active_balance*(state: ForkyBeaconState, cache: var StateCache): cache.total_active_balance[epoch] = tab return tab -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/beacon-chain.md#get_base_reward_per_increment +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/beacon-chain.md#get_base_reward_per_increment func get_base_reward_per_increment_sqrt*( total_active_balance_sqrt: uint64): Gwei = EFFECTIVE_BALANCE_INCREMENT * BASE_REWARD_FACTOR div total_active_balance_sqrt @@ -701,7 +701,7 @@ proc process_attestation*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/beacon-chain.md#get_next_sync_committee_indices +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/beacon-chain.md#get_next_sync_committee_indices func get_next_sync_committee_keys( state: altair.BeaconState | bellatrix.BeaconState | capella.BeaconState | deneb.BeaconState): @@ -739,19 +739,19 @@ func get_next_sync_committee_keys( i += 1'u64 res -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#has_eth1_withdrawal_credential +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#has_eth1_withdrawal_credential func has_eth1_withdrawal_credential*(validator: Validator): bool = ## Check if ``validator`` has an 0x01 prefixed "eth1" withdrawal credential. validator.withdrawal_credentials.data[0] == ETH1_ADDRESS_WITHDRAWAL_PREFIX -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#is_fully_withdrawable_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#is_fully_withdrawable_validator func is_fully_withdrawable_validator( validator: Validator, balance: Gwei, epoch: Epoch): bool = ## Check if ``validator`` is fully withdrawable. has_eth1_withdrawal_credential(validator) and validator.withdrawable_epoch <= epoch and balance > 0 -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#is_partially_withdrawable_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#is_partially_withdrawable_validator func is_partially_withdrawable_validator( validator: Validator, balance: Gwei): bool = ## Check if ``validator`` is partially withdrawable. @@ -919,9 +919,9 @@ proc initialize_hashed_beacon_state_from_eth1*( cfg, eth1_block_hash, eth1_timestamp, deposits, flags)) result.root = hash_tree_root(result.data) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#testing -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#testing -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#testing +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#testing +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#testing +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#testing proc initialize_beacon_state_from_eth1*( cfg: RuntimeConfig, eth1_block_hash: Eth2Digest, @@ -1144,7 +1144,7 @@ func upgrade_to_altair*(cfg: RuntimeConfig, pre: phase0.BeaconState): post -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/fork.md#upgrading-the-state +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/fork.md#upgrading-the-state func upgrade_to_bellatrix*(cfg: RuntimeConfig, pre: altair.BeaconState): ref bellatrix.BeaconState = let epoch = get_current_epoch(pre) diff --git a/beacon_chain/spec/datatypes/altair.nim b/beacon_chain/spec/datatypes/altair.nim index ca191ab71a..e263f416a4 100644 --- a/beacon_chain/spec/datatypes/altair.nim +++ b/beacon_chain/spec/datatypes/altair.nim @@ -38,21 +38,21 @@ const PARTICIPATION_FLAG_WEIGHTS* = [TIMELY_SOURCE_WEIGHT, TIMELY_TARGET_WEIGHT, TIMELY_HEAD_WEIGHT] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#misc + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#misc TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE* = 16 SYNC_COMMITTEE_SUBNET_COUNT* = 4 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#constants + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#constants # All of these indices are rooted in `BeaconState`. # The first member (`genesis_time`) is 32, subsequent members +1 each. # If there are ever more than 32 members in `BeaconState`, indices change! # `FINALIZED_ROOT_INDEX` is one layer deeper, i.e., `52 * 2 + 1`. - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/ssz/merkle-proofs.md + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/ssz/merkle-proofs.md FINALIZED_ROOT_INDEX* = 105.GeneralizedIndex # `finalized_checkpoint` > `root` CURRENT_SYNC_COMMITTEE_INDEX* = 54.GeneralizedIndex # `current_sync_committee` NEXT_SYNC_COMMITTEE_INDEX* = 55.GeneralizedIndex # `next_sync_committee` - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/beacon-chain.md#participation-flag-indices + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/beacon-chain.md#participation-flag-indices TIMELY_SOURCE_FLAG_INDEX* = 0 TIMELY_TARGET_FLAG_INDEX* = 1 TIMELY_HEAD_FLAG_INDEX* = 2 @@ -94,7 +94,7 @@ type pubkeys*: HashArray[Limit SYNC_COMMITTEE_SIZE, ValidatorPubKey] aggregate_pubkey*: ValidatorPubKey - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#synccommitteemessage + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#synccommitteemessage SyncCommitteeMessage* = object slot*: Slot ## Slot to which this contribution pertains @@ -108,7 +108,7 @@ type signature*: ValidatorSig ## Signature by the validator over the block root of `slot` - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#synccommitteecontribution + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#synccommitteecontribution SyncCommitteeAggregationBits* = BitArray[SYNC_SUBCOMMITTEE_SIZE] @@ -130,18 +130,18 @@ type signature*: ValidatorSig ## Signature by the validator(s) over the block root of `slot` - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#contributionandproof + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#contributionandproof ContributionAndProof* = object aggregator_index*: uint64 # `ValidatorIndex` after validation contribution*: SyncCommitteeContribution selection_proof*: ValidatorSig - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#signedcontributionandproof + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#signedcontributionandproof SignedContributionAndProof* = object message*: ContributionAndProof signature*: ValidatorSig - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#syncaggregatorselectiondata + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#syncaggregatorselectiondata SyncAggregatorSelectionData* = object slot*: Slot subcommittee_index*: uint64 # `SyncSubcommitteeIndex` after validation @@ -162,7 +162,7 @@ type beacon*: BeaconBlockHeader ## Beacon block header - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#lightclientbootstrap + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#lightclientbootstrap LightClientBootstrap* = object header*: LightClientHeader ## Header matching the requested beacon block root @@ -190,7 +190,7 @@ type signature_slot*: Slot ## Slot at which the aggregate signature was created (untrusted) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate LightClientFinalityUpdate* = object # Header attested to by the sync committee attested_header*: LightClientHeader @@ -253,7 +253,7 @@ type InactivityScores* = HashList[uint64, Limit VALIDATOR_REGISTRY_LIMIT] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/beacon-chain.md#beaconstate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/beacon-chain.md#beaconstate BeaconState* = object # Versioning genesis_time*: uint64 @@ -395,7 +395,7 @@ type state_root*: Eth2Digest body*: TrustedBeaconBlockBody - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/beacon-chain.md#beaconblockbody + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/beacon-chain.md#beaconblockbody BeaconBlockBody* = object randao_reveal*: ValidatorSig eth1_data*: Eth1Data @@ -447,7 +447,7 @@ type SyncnetBits* = BitArray[SYNC_COMMITTEE_SUBNET_COUNT] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/p2p-interface.md#metadata + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/p2p-interface.md#metadata MetaData* = object seq_number*: uint64 attnets*: AttnetBits @@ -702,7 +702,7 @@ chronicles.formatIt SyncCommitteeContribution: shortLog(it) chronicles.formatIt ContributionAndProof: shortLog(it) chronicles.formatIt SignedContributionAndProof: shortLog(it) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#is_valid_light_client_header +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#is_valid_light_client_header func is_valid_light_client_header*( header: LightClientHeader, cfg: RuntimeConfig): bool = true diff --git a/beacon_chain/spec/datatypes/base.nim b/beacon_chain/spec/datatypes/base.nim index be5497fa50..7942568c5c 100644 --- a/beacon_chain/spec/datatypes/base.nim +++ b/beacon_chain/spec/datatypes/base.nim @@ -82,7 +82,7 @@ const ZERO_HASH* = Eth2Digest() MAX_GRAFFITI_SIZE* = 32 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#configuration + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#configuration MAXIMUM_GOSSIP_CLOCK_DISPARITY* = 500.millis SLOTS_PER_ETH1_VOTING_PERIOD* = @@ -198,7 +198,7 @@ type attestation_1*: TrustedIndexedAttestation attestation_2*: TrustedIndexedAttestation - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#indexedattestation + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#indexedattestation IndexedAttestation* = object attesting_indices*: List[uint64, Limit MAX_VALIDATORS_PER_COMMITTEE] data*: AttestationData @@ -230,7 +230,7 @@ type ForkDigest* = distinct array[4, byte] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#forkdata + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#forkdata ForkData* = object current_version*: Version genesis_validators_root*: Eth2Digest @@ -240,7 +240,7 @@ type epoch*: Epoch root*: Eth2Digest - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#AttestationData + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#AttestationData AttestationData* = object slot*: Slot @@ -266,7 +266,7 @@ type withdrawal_credentials*: Eth2Digest amount*: Gwei - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#depositdata + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#depositdata DepositData* = object pubkey*: ValidatorPubKey withdrawal_credentials*: Eth2Digest @@ -347,13 +347,13 @@ type epoch*: Epoch ## Epoch of latest fork - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#eth1data + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#eth1data Eth1Data* = object deposit_root*: Eth2Digest deposit_count*: uint64 block_hash*: Eth2Digest - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#signedvoluntaryexit + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#signedvoluntaryexit SignedVoluntaryExit* = object message*: VoluntaryExit signature*: ValidatorSig @@ -370,14 +370,14 @@ type state_root*: Eth2Digest body_root*: Eth2Digest - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#signingdata + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#signingdata SigningData* = object object_root*: Eth2Digest domain*: Eth2Domain GraffitiBytes* = distinct array[MAX_GRAFFITI_SIZE, byte] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#signedbeaconblockheader + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#signedbeaconblockheader SignedBeaconBlockHeader* = object message*: BeaconBlockHeader signature*: ValidatorSig @@ -386,13 +386,13 @@ type message*: BeaconBlockHeader signature*: TrustedSig - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#aggregateandproof + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#aggregateandproof AggregateAndProof* = object aggregator_index*: uint64 # `ValidatorIndex` after validation aggregate*: Attestation selection_proof*: ValidatorSig - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#signedaggregateandproof + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#signedaggregateandproof SignedAggregateAndProof* = object message*: AggregateAndProof signature*: ValidatorSig @@ -410,7 +410,7 @@ type sync_committees*: Table[SyncCommitteePeriod, SyncCommitteeCache] # This matches the mutable state of the Solidity deposit contract - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/solidity_deposit_contract/deposit_contract.sol + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/solidity_deposit_contract/deposit_contract.sol DepositContractState* = object branch*: array[DEPOSIT_CONTRACT_TREE_DEPTH, Eth2Digest] deposit_count*: array[32, byte] # Uint256 @@ -467,7 +467,7 @@ type withdrawable_epoch*: Epoch ## When validator can withdraw or transfer funds - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#eth2-field + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#eth2-field ENRForkID* = object fork_digest*: ForkDigest next_fork_version*: Version diff --git a/beacon_chain/spec/datatypes/bellatrix.nim b/beacon_chain/spec/datatypes/bellatrix.nim index 6919849443..09df2bb4cd 100644 --- a/beacon_chain/spec/datatypes/bellatrix.nim +++ b/beacon_chain/spec/datatypes/bellatrix.nim @@ -34,7 +34,7 @@ const NEWPAYLOAD_TIMEOUT* = 8.seconds type - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#custom-types + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#custom-types Transaction* = List[byte, Limit MAX_BYTES_PER_TRANSACTION] ExecutionAddress* = object @@ -45,7 +45,7 @@ type PayloadID* = array[8, byte] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#executionpayload + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#executionpayload ExecutionPayload* = object parent_hash*: Eth2Digest fee_recipient*: ExecutionAddress # 'beneficiary' in the yellow paper @@ -68,7 +68,7 @@ type executionPayload*: ExecutionPayload blockValue*: Wei - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#executionpayloadheader + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#executionpayloadheader ExecutionPayloadHeader* = object parent_hash*: Eth2Digest fee_recipient*: ExecutionAddress @@ -96,7 +96,7 @@ type parent_hash*: Eth2Digest total_difficulty*: Eth2Digest # uint256 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#beaconstate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#beaconstate BeaconState* = object # Versioning genesis_time*: uint64 @@ -222,7 +222,7 @@ type state_root*: Eth2Digest body*: TrustedBeaconBlockBody - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#beaconblockbody + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#beaconblockbody BeaconBlockBody* = object randao_reveal*: ValidatorSig eth1_data*: Eth1Data diff --git a/beacon_chain/spec/datatypes/capella.nim b/beacon_chain/spec/datatypes/capella.nim index 53cb2b5b0e..61509880a0 100644 --- a/beacon_chain/spec/datatypes/capella.nim +++ b/beacon_chain/spec/datatypes/capella.nim @@ -27,25 +27,25 @@ import export json_serialization, base const - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/sync-protocol.md#constants + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/sync-protocol.md#constants # This index is rooted in `BeaconBlockBody`. # The first member (`randao_reveal`) is 16, subsequent members +1 each. # If there are ever more than 16 members in `BeaconBlockBody`, indices change! - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/ssz/merkle-proofs.md + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/ssz/merkle-proofs.md EXECUTION_PAYLOAD_INDEX* = 25.GeneralizedIndex # `execution_payload` type SignedBLSToExecutionChangeList* = List[SignedBLSToExecutionChange, Limit MAX_BLS_TO_EXECUTION_CHANGES] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#withdrawal + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#withdrawal Withdrawal* = object index*: WithdrawalIndex validator_index*: uint64 address*: ExecutionAddress amount*: Gwei - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#blstoexecutionchange + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#blstoexecutionchange BLSToExecutionChange* = object validator_index*: uint64 from_bls_pubkey*: ValidatorPubKey @@ -56,14 +56,14 @@ type message*: BLSToExecutionChange signature*: ValidatorSig - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#historicalsummary + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#historicalsummary HistoricalSummary* = object # `HistoricalSummary` matches the components of the phase0 # `HistoricalBatch` making the two hash_tree_root-compatible. block_summary_root*: Eth2Digest state_summary_root*: Eth2Digest - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#executionpayload + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#executionpayload ExecutionPayload* = object parent_hash*: Eth2Digest fee_recipient*: ExecutionAddress # 'beneficiary' in the yellow paper @@ -87,7 +87,7 @@ type executionPayload*: ExecutionPayload blockValue*: Wei - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#executionpayloadheader + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#executionpayloadheader ExecutionPayloadHeader* = object parent_hash*: Eth2Digest fee_recipient*: ExecutionAddress @@ -113,7 +113,7 @@ type ExecutionBranch* = array[log2trunc(EXECUTION_PAYLOAD_INDEX), Eth2Digest] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/sync-protocol.md#modified-lightclientheader + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/sync-protocol.md#modified-lightclientheader LightClientHeader* = object beacon*: BeaconBlockHeader ## Beacon block header @@ -122,7 +122,7 @@ type ## Execution payload header corresponding to `beacon.body_root` (from Capella onward) execution_branch*: ExecutionBranch - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#lightclientbootstrap + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#lightclientbootstrap LightClientBootstrap* = object header*: LightClientHeader ## Header matching the requested beacon block root @@ -131,7 +131,7 @@ type ## Current sync committee corresponding to `header.beacon.state_root` current_sync_committee_branch*: altair.CurrentSyncCommitteeBranch - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#lightclientupdate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#lightclientupdate LightClientUpdate* = object attested_header*: LightClientHeader ## Header attested to by the sync committee @@ -150,7 +150,7 @@ type signature_slot*: Slot ## Slot at which the aggregate signature was created (untrusted) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate LightClientFinalityUpdate* = object # Header attested to by the sync committee attested_header*: LightClientHeader @@ -290,7 +290,7 @@ type data*: BeaconState root*: Eth2Digest # hash_tree_root(data) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#beaconblock + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#beaconblock BeaconBlock* = object ## For each slot, a proposer is chosen from the validator pool to propose ## a new block. Once the block as been proposed, it is transmitted to @@ -555,7 +555,7 @@ func shortLog*(v: SignedBLSToExecutionChange): auto = signature: shortLog(v.signature) ) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/sync-protocol.md#get_lc_execution_root +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/sync-protocol.md#get_lc_execution_root func get_lc_execution_root*( header: LightClientHeader, cfg: RuntimeConfig): Eth2Digest = let epoch = header.beacon.slot.epoch @@ -565,7 +565,7 @@ func get_lc_execution_root*( ZERO_HASH -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/sync-protocol.md#modified-is_valid_light_client_header +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/sync-protocol.md#modified-is_valid_light_client_header func is_valid_light_client_header*( header: LightClientHeader, cfg: RuntimeConfig): bool = let epoch = header.beacon.slot.epoch @@ -582,13 +582,13 @@ func is_valid_light_client_header*( get_subtree_index(EXECUTION_PAYLOAD_INDEX), header.beacon.body_root) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/fork.md#upgrading-light-client-data func upgrade_lc_header_to_capella*( pre: altair.LightClientHeader): LightClientHeader = LightClientHeader( beacon: pre.beacon) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/fork.md#upgrading-light-client-data func upgrade_lc_bootstrap_to_capella*( pre: altair.LightClientBootstrap): LightClientBootstrap = LightClientBootstrap( @@ -596,7 +596,7 @@ func upgrade_lc_bootstrap_to_capella*( current_sync_committee: pre.current_sync_committee, current_sync_committee_branch: pre.current_sync_committee_branch) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/fork.md#upgrading-light-client-data func upgrade_lc_update_to_capella*( pre: altair.LightClientUpdate): LightClientUpdate = LightClientUpdate( @@ -608,7 +608,7 @@ func upgrade_lc_update_to_capella*( sync_aggregate: pre.sync_aggregate, signature_slot: pre.signature_slot) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/fork.md#upgrading-light-client-data func upgrade_lc_finality_update_to_capella*( pre: altair.LightClientFinalityUpdate): LightClientFinalityUpdate = LightClientFinalityUpdate( @@ -618,7 +618,7 @@ func upgrade_lc_finality_update_to_capella*( sync_aggregate: pre.sync_aggregate, signature_slot: pre.signature_slot) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/fork.md#upgrading-light-client-data func upgrade_lc_optimistic_update_to_capella*( pre: altair.LightClientOptimisticUpdate): LightClientOptimisticUpdate = LightClientOptimisticUpdate( @@ -669,7 +669,7 @@ chronicles.formatIt LightClientUpdate: shortLog(it) chronicles.formatIt LightClientFinalityUpdate: shortLog(it) chronicles.formatIt LightClientOptimisticUpdate: shortLog(it) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/fork.md#upgrading-the-store +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/fork.md#upgrading-the-store func upgrade_lc_store_to_capella*( pre: altair.LightClientStore): LightClientStore = let best_valid_update = diff --git a/beacon_chain/spec/datatypes/constants.nim b/beacon_chain/spec/datatypes/constants.nim index 4ebccd50a6..cc51439a24 100644 --- a/beacon_chain/spec/datatypes/constants.nim +++ b/beacon_chain/spec/datatypes/constants.nim @@ -10,7 +10,7 @@ type Epoch* = distinct uint64 SyncCommitteePeriod* = distinct uint64 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#custom-types + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#custom-types WithdrawalIndex* = uint64 DomainType* = distinct array[4, byte] @@ -21,7 +21,7 @@ const FAR_FUTURE_EPOCH* = Epoch(not 0'u64) FAR_FUTURE_PERIOD* = SyncCommitteePeriod(not 0'u64) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#domain-types + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#domain-types DOMAIN_BEACON_PROPOSER* = DomainType([byte 0x00, 0x00, 0x00, 0x00]) DOMAIN_BEACON_ATTESTER* = DomainType([byte 0x01, 0x00, 0x00, 0x00]) DOMAIN_RANDAO* = DomainType([byte 0x02, 0x00, 0x00, 0x00]) @@ -39,11 +39,11 @@ const # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/capella/beacon-chain.md#domain-types DOMAIN_BLS_TO_EXECUTION_CHANGE* = DomainType([byte 0x0a, 0x00, 0x00, 0x00]) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#transition-settings + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#transition-settings TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH* = FAR_FUTURE_EPOCH - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/fork-choice.md#configuration + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/fork-choice.md#configuration PROPOSER_SCORE_BOOST*: uint64 = 40 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#misc + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#misc ATTESTATION_SUBNET_COUNT*: uint64 = 64 diff --git a/beacon_chain/spec/datatypes/deneb.nim b/beacon_chain/spec/datatypes/deneb.nim index 280ca7f4e9..9df3c20689 100644 --- a/beacon_chain/spec/datatypes/deneb.nim +++ b/beacon_chain/spec/datatypes/deneb.nim @@ -30,7 +30,7 @@ const # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/polynomial-commitments.md#constants BYTES_PER_FIELD_ELEMENT = 32 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#blob + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#blob BLOB_TX_TYPE* = 0x05'u8 # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/polynomial-commitments.md#constants @@ -51,7 +51,7 @@ type # current spec doesn't ever SSZ-serialize it or hash_tree_root it VersionedHash* = array[32, byte] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#custom-types + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#custom-types BlobIndex* = uint64 Blob* = array[BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB, byte] @@ -63,7 +63,7 @@ type blobs*: Blobs kzg_aggregated_proof*: KZGProof - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/p2p-interface.md#blobsidecar + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/p2p-interface.md#blobsidecar BlobSidecar* = object block_root*: Eth2Digest index*: BlobIndex # Index of blob in block @@ -74,7 +74,7 @@ type kzg_commitment*: KZGCommitment kzg_proof*: KZGProof # Allows for quick verification of kzg_commitment - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/p2p-interface.md#signedblobsidecar + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/p2p-interface.md#signedblobsidecar SignedBlobSidecar* = object message*: BlobSidecar signature*: ValidatorSig @@ -84,7 +84,7 @@ type block_root*: Eth2Digest index*: BlobIndex - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#executionpayload + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#executionpayload ExecutionPayload* = object parent_hash*: Eth2Digest fee_recipient*: ExecutionAddress # 'beneficiary' in the yellow paper @@ -111,7 +111,7 @@ type kzgs*: KZGCommitments blobs*: Blobs - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#executionpayloadheader + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#executionpayloadheader ExecutionPayloadHeader* = object parent_hash*: Eth2Digest fee_recipient*: ExecutionAddress @@ -135,7 +135,7 @@ type ExecutePayload* = proc( execution_payload: ExecutionPayload): bool {.gcsafe, raises: [Defect].} - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/sync-protocol.md#modified-lightclientheader + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/sync-protocol.md#modified-lightclientheader LightClientHeader* = object beacon*: BeaconBlockHeader ## Beacon block header @@ -144,7 +144,7 @@ type ## Execution payload header corresponding to `beacon.body_root` (from Capella onward) execution_branch*: capella.ExecutionBranch - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#lightclientbootstrap + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#lightclientbootstrap LightClientBootstrap* = object header*: LightClientHeader ## Header matching the requested beacon block root @@ -212,7 +212,7 @@ type LightClientBootstrap | SomeLightClientUpdate - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#lightclientstore + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#lightclientstore LightClientStore* = object finalized_header*: LightClientHeader ## Header that is finalized @@ -311,7 +311,7 @@ type data*: BeaconState root*: Eth2Digest # hash_tree_root(data) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#beaconblock + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#beaconblock BeaconBlock* = object ## For each slot, a proposer is chosen from the validator pool to propose ## a new block. Once the block as been proposed, it is transmitted to @@ -368,7 +368,7 @@ type state_root*: Eth2Digest body*: TrustedBeaconBlockBody - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#beaconblockbody + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#beaconblockbody BeaconBlockBody* = object randao_reveal*: ValidatorSig eth1_data*: Eth1Data @@ -449,7 +449,7 @@ type bls_to_execution_changes*: SignedBLSToExecutionChangeList blob_kzg_commitments*: List[KZGCommitment, Limit MAX_BLOBS_PER_BLOCK] # [New in Deneb] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#signedbeaconblock + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#signedbeaconblock SignedBeaconBlock* = object message*: BeaconBlock signature*: ValidatorSig @@ -553,7 +553,7 @@ func shortLog*(v: ExecutionPayload): auto = num_withdrawals: len(v.withdrawals) ) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/sync-protocol.md#modified-get_lc_execution_root +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/sync-protocol.md#modified-get_lc_execution_root func get_lc_execution_root*( header: LightClientHeader, cfg: RuntimeConfig): Eth2Digest = let epoch = header.beacon.slot.epoch @@ -582,7 +582,7 @@ func get_lc_execution_root*( ZERO_HASH -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/sync-protocol.md#modified-is_valid_light_client_header +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/sync-protocol.md#modified-is_valid_light_client_header func is_valid_light_client_header*( header: LightClientHeader, cfg: RuntimeConfig): bool = let epoch = header.beacon.slot.epoch @@ -603,7 +603,7 @@ func is_valid_light_client_header*( get_subtree_index(EXECUTION_PAYLOAD_INDEX), header.beacon.body_root) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/fork.md#upgrading-light-client-data func upgrade_lc_header_to_deneb*( pre: capella.LightClientHeader): LightClientHeader = LightClientHeader( @@ -626,7 +626,7 @@ func upgrade_lc_header_to_deneb*( withdrawals_root: pre.execution.withdrawals_root), execution_branch: pre.execution_branch) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/fork.md#upgrading-light-client-data func upgrade_lc_bootstrap_to_deneb*( pre: capella.LightClientBootstrap): LightClientBootstrap = LightClientBootstrap( @@ -634,7 +634,7 @@ func upgrade_lc_bootstrap_to_deneb*( current_sync_committee: pre.current_sync_committee, current_sync_committee_branch: pre.current_sync_committee_branch) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/fork.md#upgrading-light-client-data func upgrade_lc_update_to_deneb*( pre: capella.LightClientUpdate): LightClientUpdate = LightClientUpdate( @@ -646,7 +646,7 @@ func upgrade_lc_update_to_deneb*( sync_aggregate: pre.sync_aggregate, signature_slot: pre.signature_slot) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/fork.md#upgrading-light-client-data func upgrade_lc_finality_update_to_deneb*( pre: capella.LightClientFinalityUpdate): LightClientFinalityUpdate = LightClientFinalityUpdate( @@ -656,7 +656,7 @@ func upgrade_lc_finality_update_to_deneb*( sync_aggregate: pre.sync_aggregate, signature_slot: pre.signature_slot) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/fork.md#upgrading-light-client-data func upgrade_lc_optimistic_update_to_deneb*( pre: capella.LightClientOptimisticUpdate): LightClientOptimisticUpdate = LightClientOptimisticUpdate( @@ -707,7 +707,7 @@ chronicles.formatIt LightClientUpdate: shortLog(it) chronicles.formatIt LightClientFinalityUpdate: shortLog(it) chronicles.formatIt LightClientOptimisticUpdate: shortLog(it) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/fork.md#upgrading-the-store +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/fork.md#upgrading-the-store func upgrade_lc_store_to_deneb*( pre: capella.LightClientStore): LightClientStore = let best_valid_update = diff --git a/beacon_chain/spec/datatypes/phase0.nim b/beacon_chain/spec/datatypes/phase0.nim index 215d238fa1..ada16b4ef3 100644 --- a/beacon_chain/spec/datatypes/phase0.nim +++ b/beacon_chain/spec/datatypes/phase0.nim @@ -72,7 +72,7 @@ type current_justified_checkpoint*: Checkpoint finalized_checkpoint*: Checkpoint - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_total_balance + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_total_balance TotalBalances* = object # The total effective balance of all active validators during the _current_ # epoch. @@ -110,7 +110,7 @@ type data*: BeaconState root*: Eth2Digest # hash_tree_root(data) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#beaconblock + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#beaconblock BeaconBlock* = object ## For each slot, a proposer is chosen from the validator pool to propose ## a new block. Once the block as been proposed, it is transmitted to diff --git a/beacon_chain/spec/eth2_apis/rest_types.nim b/beacon_chain/spec/eth2_apis/rest_types.nim index 0c3bc9f521..3132a005a1 100644 --- a/beacon_chain/spec/eth2_apis/rest_types.nim +++ b/beacon_chain/spec/eth2_apis/rest_types.nim @@ -349,7 +349,7 @@ type MAX_DEPOSITS*: uint64 MAX_VOLUNTARY_EXITS*: uint64 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/altair.yaml + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/altair.yaml INACTIVITY_PENALTY_QUOTIENT_ALTAIR*: uint64 MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR*: uint64 PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR*: uint64 @@ -358,7 +358,7 @@ type MIN_SYNC_COMMITTEE_PARTICIPANTS*: uint64 UPDATE_TIMEOUT*: uint64 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/bellatrix.yaml + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/bellatrix.yaml INACTIVITY_PENALTY_QUOTIENT_BELLATRIX*: uint64 MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX*: uint64 PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX*: uint64 @@ -433,7 +433,7 @@ type DOMAIN_CONTRIBUTION_AND_PROOF*: DomainType # PARTICIPATION_FLAG_WEIGHTS - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#constants + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#constants TARGET_AGGREGATORS_PER_COMMITTEE*: uint64 RANDOM_SUBNETS_PER_VALIDATOR*: uint64 EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION*: uint64 diff --git a/beacon_chain/spec/forks.nim b/beacon_chain/spec/forks.nim index c72efcdebe..815013ba14 100644 --- a/beacon_chain/spec/forks.nim +++ b/beacon_chain/spec/forks.nim @@ -988,7 +988,7 @@ func compute_fork_data_root*(current_version: Version, genesis_validators_root: genesis_validators_root )) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#compute_fork_digest +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#compute_fork_digest func compute_fork_digest*(current_version: Version, genesis_validators_root: Eth2Digest): ForkDigest = ## Return the 4-byte fork digest for the ``current_version`` and diff --git a/beacon_chain/spec/forks_light_client.nim b/beacon_chain/spec/forks_light_client.nim index ba7d73461d..7af5644121 100644 --- a/beacon_chain/spec/forks_light_client.nim +++ b/beacon_chain/spec/forks_light_client.nim @@ -816,7 +816,7 @@ func migratingToDataFork*[ upgradedObject.migrateToDataFork(newKind) upgradedObject -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/full-node.md#block_to_light_client_header +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/full-node.md#block_to_light_client_header func toAltairLightClientHeader( blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6) phase0.SignedBeaconBlock | phase0.TrustedSignedBeaconBlock | @@ -826,7 +826,7 @@ func toAltairLightClientHeader( altair.LightClientHeader( beacon: blck.message.toBeaconBlockHeader()) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/light-client/full-node.md#modified-block_to_light_client_header +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/light-client/full-node.md#modified-block_to_light_client_header func toCapellaLightClientHeader( blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6) phase0.SignedBeaconBlock | phase0.TrustedSignedBeaconBlock | @@ -868,7 +868,7 @@ func toCapellaLightClientHeader( execution_branch: blck.message.body.build_proof( capella.EXECUTION_PAYLOAD_INDEX).get) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/light-client/full-node.md#modified-block_to_light_client_header +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/light-client/full-node.md#modified-block_to_light_client_header func toDenebLightClientHeader( blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6) phase0.SignedBeaconBlock | phase0.TrustedSignedBeaconBlock | diff --git a/beacon_chain/spec/helpers.nim b/beacon_chain/spec/helpers.nim index 1d6cb58017..72b55aca6b 100644 --- a/beacon_chain/spec/helpers.nim +++ b/beacon_chain/spec/helpers.nim @@ -55,7 +55,7 @@ func integer_squareroot*(n: SomeInteger): SomeInteger = y = (x + n div x) div 2 x -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#is_active_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#is_active_validator func is_active_validator*(validator: Validator, epoch: Epoch): bool = ## Check if ``validator`` is active validator.activation_epoch <= epoch and epoch < validator.exit_epoch @@ -98,18 +98,18 @@ func get_current_epoch*(state: ForkyBeaconState): Epoch = ## Return the current epoch. state.slot.epoch -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_current_epoch +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_current_epoch func get_current_epoch*(state: ForkedHashedBeaconState): Epoch = ## Return the current epoch. withState(state): get_current_epoch(forkyState.data) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_previous_epoch +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_previous_epoch func get_previous_epoch*( state: ForkyBeaconState | ForkedHashedBeaconState): Epoch = ## Return the previous epoch (unless the current epoch is ``GENESIS_EPOCH``). get_previous_epoch(get_current_epoch(state)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_randao_mix +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_randao_mix func get_randao_mix*(state: ForkyBeaconState, epoch: Epoch): Eth2Digest = ## Returns the randao mix at a recent ``epoch``. state.randao_mixes[epoch mod EPOCHS_PER_HISTORICAL_VECTOR] @@ -145,7 +145,7 @@ func compute_domain*( result[0..3] = domain_type.data result[4..31] = fork_data_root.data.toOpenArray(0, 27) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_domain +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_domain func get_domain*( fork: Fork, domain_type: DomainType, @@ -176,7 +176,7 @@ func compute_signing_root*(ssz_object: auto, domain: Eth2Domain): Eth2Digest = ) hash_tree_root(domain_wrapped_object) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_seed +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_seed func get_seed*(state: ForkyBeaconState, epoch: Epoch, domain_type: DomainType): Eth2Digest = ## Return the seed at ``epoch``. @@ -219,7 +219,7 @@ template is_finality_update*(update: SomeForkyLightClientUpdate): bool = else: false -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#is_next_sync_committee_known +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#is_next_sync_committee_known template is_next_sync_committee_known*(store: ForkyLightClientStore): bool = store.next_sync_committee != default(typeof(store.next_sync_committee)) @@ -230,7 +230,7 @@ func get_safety_threshold*(store: ForkyLightClientStore): uint64 = store.current_max_active_participants ) div 2 -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md#is_better_update +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md#is_better_update type LightClientUpdateMetadata* = object attested_slot*, finalized_slot*, signature_slot*: Slot has_sync_committee*, has_finality*: bool @@ -321,24 +321,24 @@ template is_better_update*[ new_update: A, old_update: B): bool = is_better_data(toMeta(new_update), toMeta(old_update)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap func contextEpoch*(bootstrap: ForkyLightClientBootstrap): Epoch = bootstrap.header.beacon.slot.epoch -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate func contextEpoch*(update: SomeForkyLightClientUpdate): Epoch = update.attested_header.beacon.slot.epoch -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#is_merge_transition_complete +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#is_merge_transition_complete func is_merge_transition_complete*( state: bellatrix.BeaconState | capella.BeaconState | deneb.BeaconState): bool = const defaultExecutionPayloadHeader = default(typeof(state.latest_execution_payload_header)) state.latest_execution_payload_header != defaultExecutionPayloadHeader -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/sync/optimistic.md#helpers +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/sync/optimistic.md#helpers func is_execution_block*(blck: SomeForkyBeaconBlock): bool = when typeof(blck).toFork >= ConsensusFork.Bellatrix: const defaultExecutionPayload = @@ -347,7 +347,7 @@ func is_execution_block*(blck: SomeForkyBeaconBlock): bool = else: false -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#is_merge_transition_block +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#is_merge_transition_block func is_merge_transition_block( state: bellatrix.BeaconState | capella.BeaconState | deneb.BeaconState, body: bellatrix.BeaconBlockBody | bellatrix.TrustedBeaconBlockBody | @@ -360,7 +360,7 @@ func is_merge_transition_block( not is_merge_transition_complete(state) and body.execution_payload != defaultExecutionPayload -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#is_execution_enabled +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#is_execution_enabled func is_execution_enabled*( state: bellatrix.BeaconState | capella.BeaconState | deneb.BeaconState, body: bellatrix.BeaconBlockBody | bellatrix.TrustedBeaconBlockBody | @@ -371,7 +371,7 @@ func is_execution_enabled*( deneb.SigVerifiedBeaconBlockBody): bool = is_merge_transition_block(state, body) or is_merge_transition_complete(state) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#compute_timestamp_at_slot +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#compute_timestamp_at_slot func compute_timestamp_at_slot*(state: ForkyBeaconState, slot: Slot): uint64 = # Note: This function is unsafe with respect to overflows and underflows. let slots_since_genesis = slot - GENESIS_SLOT diff --git a/beacon_chain/spec/keystore.nim b/beacon_chain/spec/keystore.nim index 3b7a763b79..0819ee87cf 100644 --- a/beacon_chain/spec/keystore.nim +++ b/beacon_chain/spec/keystore.nim @@ -1175,7 +1175,7 @@ proc createWallet*(kdfKind: KdfKind, crypto: crypto, nextAccount: nextAccount.get(0)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#bls_withdrawal_prefix +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#bls_withdrawal_prefix func makeWithdrawalCredentials*(k: ValidatorPubKey): Eth2Digest = var bytes = eth2digest(k.toRaw()) bytes.data[0] = BLS_WITHDRAWAL_PREFIX.uint8 diff --git a/beacon_chain/spec/network.nim b/beacon_chain/spec/network.nim index f59d638a2b..ca32adaf01 100644 --- a/beacon_chain/spec/network.nim +++ b/beacon_chain/spec/network.nim @@ -14,8 +14,8 @@ import export base const - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#topics-and-messages - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/p2p-interface.md#topics-and-messages + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#topics-and-messages + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/p2p-interface.md#topics-and-messages # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/p2p-interface.md#topics-and-messages topicBeaconBlocksSuffix* = "beacon_block/ssz_snappy" topicVoluntaryExitsSuffix* = "voluntary_exit/ssz_snappy" @@ -24,10 +24,10 @@ const topicAggregateAndProofsSuffix* = "beacon_aggregate_and_proof/ssz_snappy" topicBlsToExecutionChangeSuffix* = "bls_to_execution_change/ssz_snappy" - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#configuration + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#configuration RESP_TIMEOUT* = 10.seconds - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/p2p-interface.md#configuration + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/p2p-interface.md#configuration GOSSIP_MAX_SIZE_BELLATRIX* = 10 * 1024 * 1024 # bytes MAX_CHUNK_SIZE_BELLATRIX* = 10 * 1024 * 1024 # bytes @@ -60,11 +60,11 @@ func getAttesterSlashingsTopic*(forkDigest: ForkDigest): string = func getAggregateAndProofsTopic*(forkDigest: ForkDigest): string = eth2Prefix(forkDigest) & topicAggregateAndProofsSuffix -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/p2p-interface.md#topics-and-messages +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/p2p-interface.md#topics-and-messages func getBlsToExecutionChangeTopic*(forkDigest: ForkDigest): string = eth2Prefix(forkDigest) & topicBlsToExecutionChangeSuffix -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#broadcast-attestation +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#broadcast-attestation func compute_subnet_for_attestation*( committees_per_slot: uint64, slot: Slot, committee_index: CommitteeIndex): SubnetId = @@ -80,29 +80,29 @@ func compute_subnet_for_attestation*( (committees_since_epoch_start + committee_index.asUInt64) mod ATTESTATION_SUBNET_COUNT) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#broadcast-attestation +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#broadcast-attestation func getAttestationTopic*(forkDigest: ForkDigest, subnetId: SubnetId): string = ## For subscribing and unsubscribing to/from a subnet. eth2Prefix(forkDigest) & "beacon_attestation_" & $(subnetId) & "/ssz_snappy" -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/p2p-interface.md#topics-and-messages +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/p2p-interface.md#topics-and-messages func getSyncCommitteeTopic*(forkDigest: ForkDigest, subcommitteeIdx: SyncSubcommitteeIndex): string = ## For subscribing and unsubscribing to/from a subnet. eth2Prefix(forkDigest) & "sync_committee_" & $subcommitteeIdx & "/ssz_snappy" -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/p2p-interface.md#topics-and-messages +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/p2p-interface.md#topics-and-messages func getSyncCommitteeContributionAndProofTopic*(forkDigest: ForkDigest): string = ## For subscribing and unsubscribing to/from a subnet. eth2Prefix(forkDigest) & "sync_committee_contribution_and_proof/ssz_snappy" -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#light_client_finality_update +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#light_client_finality_update func getLightClientFinalityUpdateTopic*(forkDigest: ForkDigest): string = ## For broadcasting or obtaining the latest `LightClientFinalityUpdate`. eth2Prefix(forkDigest) & "light_client_finality_update/ssz_snappy" -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#light_client_optimistic_update +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#light_client_optimistic_update func getLightClientOptimisticUpdateTopic*(forkDigest: ForkDigest): string = ## For broadcasting or obtaining the latest `LightClientOptimisticUpdate`. eth2Prefix(forkDigest) & "light_client_optimistic_update/ssz_snappy" @@ -139,7 +139,7 @@ func getDiscoveryForkID*(cfg: RuntimeConfig, next_fork_version: current_fork_version, next_fork_epoch: FAR_FUTURE_EPOCH) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/p2p-interface.md#transitioning-the-gossip +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/p2p-interface.md#transitioning-the-gossip type GossipState* = set[ConsensusFork] func getTargetGossipState*( epoch, ALTAIR_FORK_EPOCH, BELLATRIX_FORK_EPOCH, CAPELLA_FORK_EPOCH, @@ -181,7 +181,7 @@ func getTargetGossipState*( targetForks func nearSyncCommitteePeriod*(epoch: Epoch): Opt[uint64] = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#sync-committee-subnet-stability + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#sync-committee-subnet-stability if epoch.is_sync_committee_period(): return Opt.some 0'u64 let epochsBefore = @@ -200,7 +200,7 @@ func getSyncSubnets*( if not nodeHasPubkey(pubkey): continue - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#broadcast-sync-committee-message + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#broadcast-sync-committee-message # The first quarter of the pubkeys map to subnet 0, the second quarter to # subnet 1, the third quarter to subnet 2 and the final quarter to subnet # 3. diff --git a/beacon_chain/spec/presets.nim b/beacon_chain/spec/presets.nim index f2e92f5a4f..f9fcd39551 100644 --- a/beacon_chain/spec/presets.nim +++ b/beacon_chain/spec/presets.nim @@ -17,7 +17,7 @@ export constants export stint, ethtypes.toHex, ethtypes.`==` const - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#withdrawal-prefixes + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#withdrawal-prefixes BLS_WITHDRAWAL_PREFIX*: byte = 0 ETH1_ADDRESS_WITHDRAWAL_PREFIX*: byte = 1 @@ -626,7 +626,7 @@ template name*(cfg: RuntimeConfig): string = else: const_preset -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#configuration +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#configuration func MIN_EPOCHS_FOR_BLOCK_REQUESTS*(cfg: RuntimeConfig): uint64 = cfg.MIN_VALIDATOR_WITHDRAWABILITY_DELAY + cfg.CHURN_LIMIT_QUOTIENT div 2 diff --git a/beacon_chain/spec/presets/gnosis/altair_preset.nim b/beacon_chain/spec/presets/gnosis/altair_preset.nim index 801625d382..5f92868e8e 100644 --- a/beacon_chain/spec/presets/gnosis/altair_preset.nim +++ b/beacon_chain/spec/presets/gnosis/altair_preset.nim @@ -1,5 +1,5 @@ # Mainnet preset - Altair -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/altair.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/altair.yaml const # Updated penalty values # --------------------------------------------------------------- diff --git a/beacon_chain/spec/presets/gnosis/deneb_preset.nim b/beacon_chain/spec/presets/gnosis/deneb_preset.nim index 82052e04fc..d28c6ef570 100644 --- a/beacon_chain/spec/presets/gnosis/deneb_preset.nim +++ b/beacon_chain/spec/presets/gnosis/deneb_preset.nim @@ -1,5 +1,5 @@ # Mainnet preset - Deneb -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/deneb.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/deneb.yaml const # `uint64(4096)` FIELD_ELEMENTS_PER_BLOB*: uint64 = 4096 diff --git a/beacon_chain/spec/presets/mainnet/altair_preset.nim b/beacon_chain/spec/presets/mainnet/altair_preset.nim index e386b5aff7..8ff4ef32fc 100644 --- a/beacon_chain/spec/presets/mainnet/altair_preset.nim +++ b/beacon_chain/spec/presets/mainnet/altair_preset.nim @@ -1,5 +1,5 @@ # Mainnet preset - Altair -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/altair.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/altair.yaml const # Updated penalty values # --------------------------------------------------------------- diff --git a/beacon_chain/spec/presets/mainnet/bellatrix_preset.nim b/beacon_chain/spec/presets/mainnet/bellatrix_preset.nim index 2c6895ad44..373c756663 100644 --- a/beacon_chain/spec/presets/mainnet/bellatrix_preset.nim +++ b/beacon_chain/spec/presets/mainnet/bellatrix_preset.nim @@ -1,5 +1,5 @@ # Mainnet preset - Bellatrix -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/bellatrix.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/bellatrix.yaml const # Updated penalty values # --------------------------------------------------------------- diff --git a/beacon_chain/spec/presets/mainnet/capella_preset.nim b/beacon_chain/spec/presets/mainnet/capella_preset.nim index eaff1bc2a4..b0670cd65a 100644 --- a/beacon_chain/spec/presets/mainnet/capella_preset.nim +++ b/beacon_chain/spec/presets/mainnet/capella_preset.nim @@ -1,5 +1,5 @@ # Mainnet preset - Capella -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/capella.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/capella.yaml const # Max operations per block # --------------------------------------------------------------- diff --git a/beacon_chain/spec/presets/mainnet/deneb_preset.nim b/beacon_chain/spec/presets/mainnet/deneb_preset.nim index 82052e04fc..d28c6ef570 100644 --- a/beacon_chain/spec/presets/mainnet/deneb_preset.nim +++ b/beacon_chain/spec/presets/mainnet/deneb_preset.nim @@ -1,5 +1,5 @@ # Mainnet preset - Deneb -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/mainnet/deneb.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/mainnet/deneb.yaml const # `uint64(4096)` FIELD_ELEMENTS_PER_BLOB*: uint64 = 4096 diff --git a/beacon_chain/spec/presets/minimal/altair_preset.nim b/beacon_chain/spec/presets/minimal/altair_preset.nim index 5db36c910f..bdda798a93 100644 --- a/beacon_chain/spec/presets/minimal/altair_preset.nim +++ b/beacon_chain/spec/presets/minimal/altair_preset.nim @@ -1,5 +1,5 @@ # Minimal preset - Altair -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/minimal/altair.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/minimal/altair.yaml const # Updated penalty values # --------------------------------------------------------------- diff --git a/beacon_chain/spec/presets/minimal/bellatrix_preset.nim b/beacon_chain/spec/presets/minimal/bellatrix_preset.nim index 28fcb1c16d..d91925a1a9 100644 --- a/beacon_chain/spec/presets/minimal/bellatrix_preset.nim +++ b/beacon_chain/spec/presets/minimal/bellatrix_preset.nim @@ -1,5 +1,5 @@ # Minimal preset - Bellatrix -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/minimal/bellatrix.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/minimal/bellatrix.yaml const # Updated penalty values # --------------------------------------------------------------- diff --git a/beacon_chain/spec/presets/minimal/capella_preset.nim b/beacon_chain/spec/presets/minimal/capella_preset.nim index c011fd9fc2..9124f96346 100644 --- a/beacon_chain/spec/presets/minimal/capella_preset.nim +++ b/beacon_chain/spec/presets/minimal/capella_preset.nim @@ -1,5 +1,5 @@ # Minimal preset - Capella -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/minimal/capella.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/minimal/capella.yaml const # Max operations per block # --------------------------------------------------------------- diff --git a/beacon_chain/spec/presets/minimal/deneb_preset.nim b/beacon_chain/spec/presets/minimal/deneb_preset.nim index 018400f503..f35e8add7c 100644 --- a/beacon_chain/spec/presets/minimal/deneb_preset.nim +++ b/beacon_chain/spec/presets/minimal/deneb_preset.nim @@ -1,5 +1,5 @@ # Minimal preset - Deneb -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/presets/minimal/deneb.yaml +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/presets/minimal/deneb.yaml const # [customized] FIELD_ELEMENTS_PER_BLOB*: uint64 = 4 diff --git a/beacon_chain/spec/signatures.nim b/beacon_chain/spec/signatures.nim index 3bd4b4ed2b..a1f1490fda 100644 --- a/beacon_chain/spec/signatures.nim +++ b/beacon_chain/spec/signatures.nim @@ -44,7 +44,7 @@ func compute_slot_signing_root*( fork, DOMAIN_SELECTION_PROOF, epoch, genesis_validators_root) compute_signing_root(slot, domain) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#aggregation-selection +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#aggregation-selection func get_slot_signature*( fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot, privkey: ValidatorPrivKey): CookedSig = @@ -68,7 +68,7 @@ func compute_epoch_signing_root*( let domain = get_domain(fork, DOMAIN_RANDAO, epoch, genesis_validators_root) compute_signing_root(epoch, domain) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#randao-reveal +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#randao-reveal func get_epoch_signature*( fork: Fork, genesis_validators_root: Eth2Digest, epoch: Epoch, privkey: ValidatorPrivKey): CookedSig = @@ -98,7 +98,7 @@ func compute_block_signing_root*( fork, DOMAIN_BEACON_PROPOSER, epoch, genesis_validators_root) compute_signing_root(blck, domain) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#signature +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#signature func get_block_signature*( fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot, root: Eth2Digest, privkey: ValidatorPrivKey): CookedSig = @@ -127,7 +127,7 @@ func compute_aggregate_and_proof_signing_root*( fork, DOMAIN_AGGREGATE_AND_PROOF, epoch, genesis_validators_root) compute_signing_root(aggregate_and_proof, domain) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#broadcast-aggregate +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#broadcast-aggregate func get_aggregate_and_proof_signature*(fork: Fork, genesis_validators_root: Eth2Digest, aggregate_and_proof: AggregateAndProof, privkey: ValidatorPrivKey): CookedSig = @@ -155,7 +155,7 @@ func compute_attestation_signing_root*( fork, DOMAIN_BEACON_ATTESTER, epoch, genesis_validators_root) compute_signing_root(attestation_data, domain) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#aggregate-signature +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#aggregate-signature func get_attestation_signature*( fork: Fork, genesis_validators_root: Eth2Digest, attestation_data: AttestationData, @@ -245,7 +245,7 @@ proc verify_voluntary_exit_signature*( blsVerify(pubkey, signing_root.data, signature) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#prepare-sync-committee-message +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#prepare-sync-committee-message func compute_sync_committee_message_signing_root*( fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot, beacon_block_root: Eth2Digest): Eth2Digest = @@ -280,7 +280,7 @@ proc verify_sync_committee_signature*( blsFastAggregateVerify(pubkeys, signing_root.data, signature) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#aggregation-selection +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#aggregation-selection func compute_sync_committee_selection_proof_signing_root*( fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot, subcommittee_index: SyncSubcommitteeIndex): Eth2Digest = @@ -311,7 +311,7 @@ proc verify_sync_committee_selection_proof*( blsVerify(pubkey, signing_root.data, signature) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#signature +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#signature func compute_contribution_and_proof_signing_root*( fork: Fork, genesis_validators_root: Eth2Digest, msg: ContributionAndProof): Eth2Digest = @@ -329,7 +329,7 @@ proc get_contribution_and_proof_signature*( blsSign(privkey, signing_root.data) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#aggregation-selection +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#aggregation-selection func is_sync_committee_aggregator*(signature: ValidatorSig): bool = let signatureDigest = eth2digest(signature.blob) @@ -369,7 +369,7 @@ proc verify_builder_signature*( let signing_root = compute_builder_signing_root(fork, msg) blsVerify(pubkey, signing_root.data, signature) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#new-process_bls_to_execution_change +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#new-process_bls_to_execution_change func compute_bls_to_execution_change_signing_root*( genesisFork: Fork, genesis_validators_root: Eth2Digest, msg: BLSToExecutionChange): Eth2Digest = diff --git a/beacon_chain/spec/state_transition.nim b/beacon_chain/spec/state_transition.nim index 5c44d01618..a94df67ea0 100644 --- a/beacon_chain/spec/state_transition.nim +++ b/beacon_chain/spec/state_transition.nim @@ -331,7 +331,7 @@ proc state_transition*( state_transition_block( cfg, state, signedBlock, cache, flags, rollback) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#preparing-for-a-beaconblock +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#preparing-for-a-beaconblock template partialBeaconBlock*( cfg: RuntimeConfig, state: var phase0.HashedBeaconState, @@ -359,7 +359,7 @@ template partialBeaconBlock*( deposits: List[Deposit, Limit MAX_DEPOSITS](deposits), voluntary_exits: validator_changes.voluntary_exits)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#preparing-a-beaconblock +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#preparing-a-beaconblock template partialBeaconBlock*( cfg: RuntimeConfig, state: var altair.HashedBeaconState, @@ -537,7 +537,7 @@ proc makeBeaconBlock*( forkyState.data.latest_execution_payload_header.transactions_root = transactions_root.get - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#beaconblockbody + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#beaconblockbody # Effectively hash_tree_root(ExecutionPayload) with the beacon block # body, with the execution payload replaced by the execution payload # header. htr(payload) == htr(payload header), so substitute. @@ -556,7 +556,7 @@ proc makeBeaconBlock*( forkyState.data.latest_execution_payload_header.transactions_root = transactions_root.get - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/capella/beacon-chain.md#beaconblockbody + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/capella/beacon-chain.md#beaconblockbody # Effectively hash_tree_root(ExecutionPayload) with the beacon block # body, with the execution payload replaced by the execution payload # header. htr(payload) == htr(payload header), so substitute. diff --git a/beacon_chain/spec/state_transition_block.nim b/beacon_chain/spec/state_transition_block.nim index 613e4883ce..fc583d4d2a 100644 --- a/beacon_chain/spec/state_transition_block.nim +++ b/beacon_chain/spec/state_transition_block.nim @@ -108,7 +108,7 @@ proc process_randao( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#eth1-data +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#eth1-data func process_eth1_data(state: var ForkyBeaconState, body: SomeForkyBeaconBlockBody): Result[void, cstring]= if not state.eth1_data_votes.add body.eth1_data: # Count is reset in process_final_updates, so this should never happen @@ -119,7 +119,7 @@ func process_eth1_data(state: var ForkyBeaconState, body: SomeForkyBeaconBlockBo state.eth1_data = body.eth1_data ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#is_slashable_validator +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#is_slashable_validator func is_slashable_validator(validator: Validator, epoch: Epoch): bool = # Check if ``validator`` is slashable. (not validator.slashed) and @@ -510,7 +510,7 @@ proc process_sync_aggregate*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#process_execution_payload +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#process_execution_payload proc process_execution_payload*( state: var bellatrix.BeaconState, payload: bellatrix.ExecutionPayload, notify_new_payload: bellatrix.ExecutePayload): Result[void, cstring] = @@ -595,7 +595,7 @@ proc process_execution_payload*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#process_execution_payload +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#process_execution_payload proc process_execution_payload*( state: var deneb.BeaconState, payload: deneb.ExecutionPayload, notify_new_payload: deneb.ExecutePayload): Result[void, cstring] = @@ -681,7 +681,7 @@ func process_withdrawals*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#tx_peek_blob_versioned_hashes +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#tx_peek_blob_versioned_hashes func tx_peek_blob_versioned_hashes(opaque_tx: Transaction): Result[seq[VersionedHash], cstring] = ## This function retrieves the hashes from the `SignedBlobTransaction` as @@ -710,10 +710,10 @@ func tx_peek_blob_versioned_hashes(opaque_tx: Transaction): res.add versionedHash ok res -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#kzg_commitment_to_versioned_hash +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#kzg_commitment_to_versioned_hash func kzg_commitment_to_versioned_hash( kzg_commitment: deneb.KZGCommitment): VersionedHash = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#blob + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#blob const VERSIONED_HASH_VERSION_KZG = 0x01'u8 var res: VersionedHash @@ -721,7 +721,7 @@ func kzg_commitment_to_versioned_hash( res[1 .. 31] = eth2digest(kzg_commitment).data.toOpenArray(1, 31) res -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#verify_kzg_commitments_against_transactions +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#verify_kzg_commitments_against_transactions func verify_kzg_commitments_against_transactions*( transactions: seq[Transaction], kzg_commitments: seq[deneb.KZGCommitment]): bool = @@ -738,7 +738,7 @@ func verify_kzg_commitments_against_transactions*( all_versioned_hashes == mapIt(kzg_commitments, it.kzg_commitment_to_versioned_hash) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/deneb/beacon-chain.md#blob-kzg-commitments +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/beacon-chain.md#blob-kzg-commitments func process_blob_kzg_commitments( state: var deneb.BeaconState, body: deneb.BeaconBlockBody | deneb.TrustedBeaconBlockBody | @@ -828,7 +828,7 @@ proc process_block*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#block-processing +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#block-processing # TODO workaround for https://github.com/nim-lang/Nim/issues/18095 type SomeBellatrixBlock = bellatrix.BeaconBlock | bellatrix.SigVerifiedBeaconBlock | bellatrix.TrustedBeaconBlock diff --git a/beacon_chain/spec/state_transition_epoch.nim b/beacon_chain/spec/state_transition_epoch.nim index 4a8be9e678..0bd2b1717c 100644 --- a/beacon_chain/spec/state_transition_epoch.nim +++ b/beacon_chain/spec/state_transition_epoch.nim @@ -39,7 +39,7 @@ export extras, phase0, altair logScope: topics = "consens" # Accessors that implement the max condition in `get_total_balance`: -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_total_balance +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_total_balance template current_epoch*(v: TotalBalances): Gwei = max(EFFECTIVE_BALANCE_INCREMENT, v.current_epoch_raw) template previous_epoch*(v: TotalBalances): Gwei = @@ -174,7 +174,7 @@ func is_eligible_validator*(validator: ParticipationInfo): bool = from ./datatypes/deneb import BeaconState # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/altair/beacon-chain.md#get_unslashed_participating_indices -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#get_total_balance +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#get_total_balance func get_unslashed_participating_balances*( state: altair.BeaconState | bellatrix.BeaconState | capella.BeaconState | deneb.BeaconState): UnslashedParticipatingBalances = @@ -242,7 +242,7 @@ func is_unslashed_participating_index( has_flag(epoch_participation[].item(validator_index), flag_index) and not state.validators[validator_index].slashed -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#justification-and-finalization +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#justification-and-finalization type FinalityState = object slot: Slot current_epoch_ancestor_root: Eth2Digest @@ -310,7 +310,7 @@ proc weigh_justification_and_finalization( ## state.justification_bits[1:] = state.justification_bits[:-1] ## state.justification_bits[0] = 0b0 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#misc + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#misc const JUSTIFICATION_BITS_LENGTH = 4 state.justification_bits = JustificationBits( @@ -729,7 +729,7 @@ iterator get_inactivity_penalty_deltas*( state.inactivity_scores[vidx] yield (vidx, Gwei(penalty_numerator div penalty_denominator)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#modified-get_inactivity_penalty_deltas +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#modified-get_inactivity_penalty_deltas iterator get_inactivity_penalty_deltas*( cfg: RuntimeConfig, state: bellatrix.BeaconState | capella.BeaconState | deneb.BeaconState, @@ -868,7 +868,7 @@ func process_registry_updates*( # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#slashings # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/altair/beacon-chain.md#slashings -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#slashings +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#slashings func get_adjusted_total_slashing_balance*( state: ForkyBeaconState, total_balance: Gwei): Gwei = const multiplier = @@ -885,16 +885,16 @@ func get_adjusted_total_slashing_balance*( {.fatal: "process_slashings: incorrect BeaconState type".} min(sum(state.slashings.data) * multiplier, total_balance) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#slashings +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#slashings # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/altair/beacon-chain.md#slashings -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#slashings +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#slashings func slashing_penalty_applies*(validator: Validator, epoch: Epoch): bool = validator.slashed and epoch + EPOCHS_PER_SLASHINGS_VECTOR div 2 == validator.withdrawable_epoch # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#slashings -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/beacon-chain.md#slashings -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#slashings +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/beacon-chain.md#slashings +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#slashings func get_slashing_penalty*(validator: Validator, adjusted_total_slashing_balance, total_balance: Gwei): Gwei = @@ -905,8 +905,8 @@ func get_slashing_penalty*(validator: Validator, penalty_numerator div total_balance * increment # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#slashings -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/beacon-chain.md#slashings -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/bellatrix/beacon-chain.md#slashings +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/beacon-chain.md#slashings +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/bellatrix/beacon-chain.md#slashings func process_slashings*(state: var ForkyBeaconState, total_balance: Gwei) = let epoch = get_current_epoch(state) @@ -983,12 +983,12 @@ func process_historical_roots_update*(state: var ForkyBeaconState) = if next_epoch mod (SLOTS_PER_HISTORICAL_ROOT div SLOTS_PER_EPOCH) == 0: # Equivalent to hash_tree_root(foo: HistoricalBatch), but without using # significant additional stack or heap. - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#historicalbatch + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#historicalbatch # In response to https://github.com/status-im/nimbus-eth2/issues/921 if not state.historical_roots.add state.compute_historical_root(): raiseAssert "no more room for historical roots, so long and thanks for the fish!" -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#participation-records-rotation +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#participation-records-rotation func process_participation_record_updates*(state: var phase0.BeaconState) = # Rotate current/previous epoch attestations - using swap avoids copying all # elements using a slow genericSeqAssign @@ -1210,7 +1210,7 @@ proc process_epoch*( # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#registry-updates ? process_registry_updates(cfg, state, cache) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#slashings + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#slashings process_slashings(state, info.balances.current_epoch) process_eth1_data_reset(state) diff --git a/beacon_chain/spec/weak_subjectivity.nim b/beacon_chain/spec/weak_subjectivity.nim index 2941ced3d4..5c5cb485d3 100644 --- a/beacon_chain/spec/weak_subjectivity.nim +++ b/beacon_chain/spec/weak_subjectivity.nim @@ -26,7 +26,7 @@ func compute_weak_subjectivity_period( SAFETY_DECAY * validator_count div (2 * 100 * cfg.MIN_PER_EPOCH_CHURN_LIMIT) return weak_subjectivity_period -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/weak-subjectivity.md#checking-for-stale-weak-subjectivity-checkpoint +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/weak-subjectivity.md#checking-for-stale-weak-subjectivity-checkpoint func is_within_weak_subjectivity_period*(cfg: RuntimeConfig, current_slot: Slot, ws_state: ForkedHashedBeaconState, ws_checkpoint: Checkpoint): bool = diff --git a/beacon_chain/sync/light_client_manager.nim b/beacon_chain/sync/light_client_manager.nim index 47e006a44e..eaa3b04d51 100644 --- a/beacon_chain/sync/light_client_manager.nim +++ b/beacon_chain/sync/light_client_manager.nim @@ -112,7 +112,7 @@ proc isGossipSupported*( else: period <= finalizedPeriod -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap proc doRequest( e: typedesc[Bootstrap], peer: Peer, @@ -121,7 +121,7 @@ proc doRequest( raises: [Defect, IOError].} = peer.lightClientBootstrap(blockRoot) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange type LightClientUpdatesByRangeResponse = NetRes[List[ForkedLightClientUpdate, MAX_REQUEST_LIGHT_CLIENT_UPDATES]] proc doRequest( @@ -170,7 +170,7 @@ proc doRequest( raise newException(ResponseError, "Invalid context bytes") return response -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate proc doRequest( e: typedesc[FinalityUpdate], peer: Peer @@ -178,7 +178,7 @@ proc doRequest( raises: [Defect, IOError].} = peer.lightClientFinalityUpdate() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate proc doRequest( e: typedesc[OptimisticUpdate], peer: Peer @@ -403,7 +403,7 @@ func fetchTime( jitterDelay = chronos.seconds(self.rng[].rand(jitterSeconds).int64) return wallTime + minDelay + jitterDelay -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/light-client.md#light-client-sync-process +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/light-client.md#light-client-sync-process proc loop(self: LightClientManager) {.async.} = var nextFetchTime = self.getBeaconTime() while true: diff --git a/beacon_chain/sync/sync_protocol.nim b/beacon_chain/sync/sync_protocol.nim index 2a06fe2caf..3385522ccf 100644 --- a/beacon_chain/sync/sync_protocol.nim +++ b/beacon_chain/sync/sync_protocol.nim @@ -27,7 +27,7 @@ const blockResponseCost = allowedOpsPerSecondCost(64) # Allow syncing ~64 blocks/sec (minus request costs) - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#configuration + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#configuration MAX_REQUEST_LIGHT_CLIENT_UPDATES* = 128 lightClientBootstrapResponseCost = allowedOpsPerSecondCost(1) ## Only one bootstrap per peer should ever be needed - no need to allow more @@ -288,7 +288,7 @@ p2pProtocol BeaconSync(version = 1, {.libp2pProtocol("ping", 1, isRequired = true).} = return peer.network.metadata.seq_number - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/p2p-interface.md#transitioning-from-v1-to-v2 + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/p2p-interface.md#transitioning-from-v1-to-v2 proc getMetaData(peer: Peer): uint64 {.libp2pProtocol("metadata", 1, isRequired = true).} = raise newException(InvalidInputsError, "GetMetaData v1 unsupported") @@ -552,7 +552,7 @@ p2pProtocol BeaconSync(version = 1, debug "BlobSidecar range request done", peer, startSlot, found - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap proc lightClientBootstrap( peer: Peer, blockRoot: Eth2Digest, @@ -580,7 +580,7 @@ p2pProtocol BeaconSync(version = 1, debug "LC bootstrap request done", peer, blockRoot - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange proc lightClientUpdatesByRange( peer: Peer, startPeriod: SyncCommitteePeriod, @@ -625,7 +625,7 @@ p2pProtocol BeaconSync(version = 1, debug "LC updates by range request done", peer, startPeriod, count, found - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate proc lightClientFinalityUpdate( peer: Peer, response: SingleChunkResponse[ForkedLightClientFinalityUpdate]) @@ -652,7 +652,7 @@ p2pProtocol BeaconSync(version = 1, debug "LC finality update request done", peer - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate proc lightClientOptimisticUpdate( peer: Peer, response: SingleChunkResponse[ForkedLightClientOptimisticUpdate]) diff --git a/beacon_chain/validators/action_tracker.nim b/beacon_chain/validators/action_tracker.nim index 916941b1a5..bbfa7c2a9f 100644 --- a/beacon_chain/validators/action_tracker.nim +++ b/beacon_chain/validators/action_tracker.nim @@ -77,7 +77,7 @@ type func hash*(x: AggregatorDuty): Hash = hashAllFields(x) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#phase-0-attestation-subnet-stability +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#phase-0-attestation-subnet-stability func randomStabilitySubnet( self: ActionTracker, epoch: Epoch): tuple[subnet_id: SubnetId, expiration: Epoch] = ( @@ -175,7 +175,7 @@ proc updateSlot*(tracker: var ActionTracker, wallSlot: Slot) = # One stability subnet per known validator static: doAssert RANDOM_SUBNETS_PER_VALIDATOR == 1 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#phase-0-attestation-subnet-stability + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#phase-0-attestation-subnet-stability let expectedSubnets = min(ATTESTATION_SUBNET_COUNT.int, tracker.knownValidators.len) diff --git a/beacon_chain/validators/slashing_protection_v2.nim b/beacon_chain/validators/slashing_protection_v2.nim index d093916368..473c01e8dc 100644 --- a/beacon_chain/validators/slashing_protection_v2.nim +++ b/beacon_chain/validators/slashing_protection_v2.nim @@ -33,7 +33,7 @@ import # - https://notes.ethereum.org/@djrtwo/Bkn3zpwxB#Validator-responsibilities # # Phase 0 spec - Honest Validator - how to avoid slashing -# - https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#how-to-avoid-slashing +# - https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#how-to-avoid-slashing # # In-depth reading on slashing conditions # @@ -55,7 +55,7 @@ import # 2. An attester can get slashed for signing # two attestations that together violate # the Casper FFG slashing conditions. -# - https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#ffg-vote +# - https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#ffg-vote # The "source" is the current_justified_epoch # The "target" is the current_epoch # diff --git a/beacon_chain/validators/validator_pool.nim b/beacon_chain/validators/validator_pool.nim index 22ef606e43..c2a226bb60 100644 --- a/beacon_chain/validators/validator_pool.nim +++ b/beacon_chain/validators/validator_pool.nim @@ -425,7 +425,7 @@ proc signData(v: AttachedValidator, else: v.signWithDistributedKey(request) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#signature +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#signature proc getBlockSignature*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot, block_root: Eth2Digest, @@ -512,7 +512,7 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork, fork, genesis_validators_root, web3SignerBlock) await v.signData(request) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#aggregate-signature +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#aggregate-signature proc getAttestationSignature*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, data: AttestationData @@ -528,7 +528,7 @@ proc getAttestationSignature*(v: AttachedValidator, fork: Fork, let request = Web3SignerRequest.init(fork, genesis_validators_root, data) await v.signData(request) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#broadcast-aggregate +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#broadcast-aggregate proc getAggregateAndProofSignature*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, @@ -547,7 +547,7 @@ proc getAggregateAndProofSignature*(v: AttachedValidator, fork, genesis_validators_root, aggregate_and_proof) await v.signData(request) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#prepare-sync-committee-message +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#prepare-sync-committee-message proc getSyncCommitteeMessage*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, @@ -578,7 +578,7 @@ proc getSyncCommitteeMessage*(v: AttachedValidator, ) ) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#aggregation-selection +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#aggregation-selection proc getSyncCommitteeSelectionProof*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot, @@ -598,7 +598,7 @@ proc getSyncCommitteeSelectionProof*(v: AttachedValidator, fork: Fork, ) await v.signData(request) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/validator.md#broadcast-sync-committee-contribution +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/validator.md#broadcast-sync-committee-contribution proc getContributionAndProofSignature*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, contribution_and_proof: ContributionAndProof @@ -614,7 +614,7 @@ proc getContributionAndProofSignature*(v: AttachedValidator, fork: Fork, fork, genesis_validators_root, contribution_and_proof) await v.signData(request) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#randao-reveal +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#randao-reveal proc getEpochSignature*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, epoch: Epoch ): Future[SignatureResult] {.async.} = @@ -629,7 +629,7 @@ proc getEpochSignature*(v: AttachedValidator, fork: Fork, fork, genesis_validators_root, epoch) await v.signData(request) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#aggregation-selection +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#aggregation-selection proc getSlotSignature*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot ): Future[SignatureResult] {.async.} = diff --git a/docs/attestation_flow.md b/docs/attestation_flow.md index 7d48bb6653..b03e5a74bf 100644 --- a/docs/attestation_flow.md +++ b/docs/attestation_flow.md @@ -6,10 +6,10 @@ This is a WIP document to explain the attestation flows. It is important to distinguish attestation `validation` from attestation `verification`. - Attestation `validation` is defined in the P2P specs. Validated attestations can be forwarded on GossipSub. - - Aggregated: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof - - Unaggregated: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id + - Aggregated: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof + - Unaggregated: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id - Attestation `verification` is defined in the consensus specs. Verified attestations can affect fork choice and may be included in a block. - - https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/beacon-chain.md#attestations + - https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/beacon-chain.md#attestations From the specs it seems like gossip attestation `validation` is a superset of consensus attestation `verification`. @@ -51,8 +51,8 @@ These GossipSub topics are used to listen for attestations: - Unaggregated: `/eth2/{$forkDigest}/beacon_attestation_{subnetIndex}/ssz_snappy` The attestations are then validated by `validateAttestation()` or `validateAggregate()` in either `attestationValidator()` or `aggregateValidator()` according to the P2P specs. -- https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof -- https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#attestation-subnets +- https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof +- https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#attestation-subnets Finally, valid attestations are added to the local `attestationPool`. Attestations are dropped in case of an error. diff --git a/docs/block_flow.md b/docs/block_flow.md index 0bd80b2923..ce6dd30b06 100644 --- a/docs/block_flow.md +++ b/docs/block_flow.md @@ -6,7 +6,7 @@ This is a WIP document to explain the beacon block flows. Important distinction: - We distinguish block `validation` which is defined in the P2P specs: - https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_block. + https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_block. A validated block can be forwarded on gossipsub. - and we distinguish `verification` which is defined in consensus specs: https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#block-processing @@ -103,7 +103,7 @@ It is important to note that 3 data structures are sharing the same `AsyncQueue[ Blocks are listened to via the gossipsub topic `/eth2/{$forkDigest}/beacon_block/ssz_snappy` (`topicBeaconBlocks` variable) They are then: -- validated by `blockValidator()` in the Eth2Processor by `validateBeaconBlock()` according to spec https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_block +- validated by `blockValidator()` in the Eth2Processor by `validateBeaconBlock()` according to spec https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_block - Important: P2P validation is not full verification (state transition and internal cryptographic signatures were not checked) - enqueued in the shared block queue `AsyncQueue[BlockEntry]` in case of success - dropped in case of error @@ -115,7 +115,7 @@ Logs: ### Gossip flow out -- After validation in `blockValidator()` in the Eth2Processor by `validateBeaconBlock()` according to spec https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/p2p-interface.md#beacon_block +- After validation in `blockValidator()` in the Eth2Processor by `validateBeaconBlock()` according to spec https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/p2p-interface.md#beacon_block - Important: P2P validation is not full verification (state transition and internal cryptographic signatures were not checked) - We jump into libp2p/protocols/pubsub/pubsub.nim in the method `validate(PubSub, message)` - which was called by `rpcHandler(GossipSub, PubSubPeer, RPCMsg)` diff --git a/docs/the_nimbus_book/src/el-light-client.md b/docs/the_nimbus_book/src/el-light-client.md index e445f63bf3..9715c87056 100644 --- a/docs/the_nimbus_book/src/el-light-client.md +++ b/docs/the_nimbus_book/src/el-light-client.md @@ -172,7 +172,7 @@ NOT 2022-11-21 18:04:03.982+01:00 New LC optimistic block opt ``` !!! note - The [light client protocol](https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/altair/light-client/sync-protocol.md) depends on consensus layer (CL) full nodes to serve additional data. As this is a new protocol, not all implementations are supporting it yet. Therefore, it may take several minutes to discover supporting peers, during which no log messages may be produced. + The [light client protocol](https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/altair/light-client/sync-protocol.md) depends on consensus layer (CL) full nodes to serve additional data. As this is a new protocol, not all implementations are supporting it yet. Therefore, it may take several minutes to discover supporting peers, during which no log messages may be produced. === "Geth" diff --git a/tests/consensus_spec/fixtures_utils.nim b/tests/consensus_spec/fixtures_utils.nim index 6e7e158876..5e84c63065 100644 --- a/tests/consensus_spec/fixtures_utils.nim +++ b/tests/consensus_spec/fixtures_utils.nim @@ -75,7 +75,7 @@ type rewards*: List[uint64, Limit VALIDATOR_REGISTRY_LIMIT] penalties*: List[uint64, Limit VALIDATOR_REGISTRY_LIMIT] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#eth1block + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#eth1block Eth1Block* = object timestamp*: uint64 deposit_root*: Eth2Digest diff --git a/tests/testblockutil.nim b/tests/testblockutil.nim index 577fa4ef71..0db9bedb63 100644 --- a/tests/testblockutil.nim +++ b/tests/testblockutil.nim @@ -26,7 +26,7 @@ const MockPrivKeys* = MockPrivKeysT() MockPubKeys* = MockPubKeysT() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/tests/core/pyspec/eth2spec/test/helpers/keys.py +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/tests/core/pyspec/eth2spec/test/helpers/keys.py func `[]`*(_: MockPrivKeysT, index: ValidatorIndex|uint64): ValidatorPrivKey = # 0 is not a valid BLS private key - 1000 helps interop with rust BLS library, # lighthouse. EF tests use 1 instead of 1000. @@ -223,7 +223,7 @@ func makeAttestationData*( "Computed epoch was " & $slot.epoch & " while the state current_epoch was " & $current_epoch - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.4/specs/phase0/validator.md#attestation-data + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/phase0/validator.md#attestation-data AttestationData( slot: slot, index: committee_index.uint64,