From f258cba816cf6ac23f49923f6cf2483f550eac4e Mon Sep 17 00:00:00 2001 From: tersec Date: Sat, 10 Aug 2024 05:09:37 +0000 Subject: [PATCH] some v1.5.0-alpha.4 consensus spec URL updates (#6485) --- beacon_chain/fork_choice/fork_choice.nim | 2 +- beacon_chain/libnimbus_lc/libnimbus_lc.h | 2 +- beacon_chain/libnimbus_lc/libnimbus_lc.nim | 2 +- beacon_chain/networking/eth2_network.nim | 4 ++-- beacon_chain/nimbus_beacon_node.nim | 2 +- beacon_chain/spec/beaconstate.nim | 14 +++++++------- beacon_chain/spec/datatypes/base.nim | 4 ++-- beacon_chain/spec/datatypes/capella.nim | 8 ++++---- beacon_chain/spec/datatypes/constants.nim | 2 +- beacon_chain/spec/datatypes/deneb.nim | 2 +- beacon_chain/spec/datatypes/electra.nim | 4 ++-- beacon_chain/spec/helpers.nim | 2 +- beacon_chain/spec/network.nim | 2 +- beacon_chain/spec/signatures.nim | 2 +- beacon_chain/spec/state_transition_block.nim | 12 ++++++------ beacon_chain/spec/state_transition_epoch.nim | 18 +++++++++--------- beacon_chain/sync/light_client_protocol.nim | 2 +- ...test_fixture_light_client_sync_protocol.nim | 2 +- tests/consensus_spec/fixtures_utils.nim | 2 +- 19 files changed, 44 insertions(+), 44 deletions(-) diff --git a/beacon_chain/fork_choice/fork_choice.nim b/beacon_chain/fork_choice/fork_choice.nim index 5d17d86f1..1a23599ac 100644 --- a/beacon_chain/fork_choice/fork_choice.nim +++ b/beacon_chain/fork_choice/fork_choice.nim @@ -373,7 +373,7 @@ proc get_head*(self: var ForkChoice, self.checkpoints.justified.balances, self.checkpoints.proposer_boost_root) -# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/fork_choice/safe-block.md#get_safe_beacon_block_root +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/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/libnimbus_lc/libnimbus_lc.h b/beacon_chain/libnimbus_lc/libnimbus_lc.h index edc061c13..43de6e4fc 100644 --- a/beacon_chain/libnimbus_lc/libnimbus_lc.h +++ b/beacon_chain/libnimbus_lc/libnimbus_lc.h @@ -695,7 +695,7 @@ typedef struct ETHBeaconBlockHeader ETHBeaconBlockHeader; * * @return Beacon block header. * - * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#beaconblockheader + * @see https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/beacon-chain.md#beaconblockheader */ ETH_RESULT_USE_CHECK const ETHBeaconBlockHeader *ETHLightClientHeaderGetBeacon( diff --git a/beacon_chain/libnimbus_lc/libnimbus_lc.nim b/beacon_chain/libnimbus_lc/libnimbus_lc.nim index 21b4ce925..946fca734 100644 --- a/beacon_chain/libnimbus_lc/libnimbus_lc.nim +++ b/beacon_chain/libnimbus_lc/libnimbus_lc.nim @@ -841,7 +841,7 @@ proc ETHLightClientHeaderCopyBeaconRoot( ## * Pointer to a copy of the given header's beacon block root. ## ## See: - ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#hash_tree_root + ## * https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/beacon-chain.md#hash_tree_root discard cfg # Future-proof against new fields, see `get_lc_execution_root`. let root = Eth2Digest.new() root[] = header[].beacon.hash_tree_root() diff --git a/beacon_chain/networking/eth2_network.nim b/beacon_chain/networking/eth2_network.nim index 59a734b1a..000e497c6 100644 --- a/beacon_chain/networking/eth2_network.nim +++ b/beacon_chain/networking/eth2_network.nim @@ -176,7 +176,7 @@ type MounterProc* = proc(network: Eth2Node) {.gcsafe, raises: [].} MessageContentPrinter* = proc(msg: pointer): string {.gcsafe, raises: [].} - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#goodbye + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/p2p-interface.md#goodbye DisconnectionReason* = enum # might see other values on the wire! ClientShutDown = 1 @@ -2556,7 +2556,7 @@ proc updateStabilitySubnetMetadata*(node: Eth2Node, attnets: AttnetBits) = node.metadata.attnets = attnets # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/p2p-interface.md#attestation-subnet-subscription - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#attestation-subnet-bitfield + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/p2p-interface.md#attestation-subnet-bitfield let res = node.discovery.updateRecord({ enrAttestationSubnetsField: SSZ.encode(node.metadata.attnets) }) diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index e487af344..54ad87d85 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -1789,7 +1789,7 @@ proc installMessageValidators(node: BeaconNode) = let digest = forkDigests[].atConsensusFork(consensusFork) # beacon_block - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#beacon_block + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/p2p-interface.md#beacon_block node.network.addValidator( getBeaconBlocksTopic(digest), proc ( signedBlock: consensusFork.SignedBeaconBlock diff --git a/beacon_chain/spec/beaconstate.nim b/beacon_chain/spec/beaconstate.nim index 8f3ec0345..062d0ebd2 100644 --- a/beacon_chain/spec/beaconstate.nim +++ b/beacon_chain/spec/beaconstate.nim @@ -96,7 +96,7 @@ func get_validator_churn_limit*( count_active_validators( state, state.get_current_epoch(), cache) div cfg.CHURN_LIMIT_QUOTIENT) -# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/deneb/beacon-chain.md#new-get_validator_activation_churn_limit +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/deneb/beacon-chain.md#new-get_validator_activation_churn_limit func get_validator_activation_churn_limit*( cfg: RuntimeConfig, state: deneb.BeaconState | electra.BeaconState, cache: var StateCache): uint64 = @@ -270,7 +270,7 @@ func compute_consolidation_epoch_and_update_churn*( state.earliest_consolidation_epoch -# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.0/specs/electra/beacon-chain.md#updated--initiate_validator_exit +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/electra/beacon-chain.md#modified-initiate_validator_exit func initiate_validator_exit*( cfg: RuntimeConfig, state: var electra.BeaconState, index: ValidatorIndex, exit_queue_info: ExitQueueInfo, @@ -326,7 +326,7 @@ func get_whistleblower_reward*( validator_effective_balance: Gwei): Gwei = validator_effective_balance div WHISTLEBLOWER_REWARD_QUOTIENT -# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.0/specs/electra/beacon-chain.md#updated-slash_validator +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/electra/beacon-chain.md#modified-slash_validator func get_whistleblower_reward*( state: electra.BeaconState, validator_effective_balance: Gwei): Gwei = validator_effective_balance div WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA @@ -407,7 +407,7 @@ func get_initial_beacon_block*(state: phase0.HashedBeaconState): phase0.TrustedSignedBeaconBlock( message: message, root: hash_tree_root(message)) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/beacon-chain.md#initialize-state-for-pure-altair-testnets-and-test-vectors +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/altair/beacon-chain.md#initialize-state-for-pure-altair-testnets-and-test-vectors func get_initial_beacon_block*(state: altair.HashedBeaconState): altair.TrustedSignedBeaconBlock = # The genesis block is implicitly trusted @@ -1128,7 +1128,7 @@ proc process_attestation*( ok(proposer_reward) -# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/altair/beacon-chain.md#get_next_sync_committee_indices +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/altair/beacon-chain.md#get_next_sync_committee_indices # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#modified-get_next_sync_committee_indices func get_next_sync_committee_keys( state: altair.BeaconState | bellatrix.BeaconState | capella.BeaconState | @@ -1173,7 +1173,7 @@ func get_next_sync_committee_keys( i += 1'u64 res -# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/capella/beacon-chain.md#has_eth1_withdrawal_credential +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/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 @@ -1195,7 +1195,7 @@ func has_execution_withdrawal_credential*(validator: Validator): bool = has_compounding_withdrawal_credential(validator) or has_eth1_withdrawal_credential(validator) -# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/capella/beacon-chain.md#is_fully_withdrawable_validator +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/capella/beacon-chain.md#is_fully_withdrawable_validator # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#updated-is_fully_withdrawable_validator func is_fully_withdrawable_validator( fork: static ConsensusFork, validator: Validator, balance: Gwei, diff --git a/beacon_chain/spec/datatypes/base.nim b/beacon_chain/spec/datatypes/base.nim index 774bf4c54..c58ec8c3e 100644 --- a/beacon_chain/spec/datatypes/base.nim +++ b/beacon_chain/spec/datatypes/base.nim @@ -304,7 +304,7 @@ type HashedValidatorPubKey* = object value*: ptr HashedValidatorPubKeyItem - # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#validator + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/beacon-chain.md#validator Validator* = object pubkeyData*{.serializedFieldName: "pubkey".}: HashedValidatorPubKey @@ -363,7 +363,7 @@ type message*: VoluntaryExit signature*: TrustedSig - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#beaconblockheader + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/beacon-chain.md#beaconblockheader BeaconBlockHeader* = object slot*: Slot proposer_index*: uint64 # `ValidatorIndex` after validation diff --git a/beacon_chain/spec/datatypes/capella.nim b/beacon_chain/spec/datatypes/capella.nim index d6cbc942d..c9edc08d1 100644 --- a/beacon_chain/spec/datatypes/capella.nim +++ b/beacon_chain/spec/datatypes/capella.nim @@ -32,7 +32,7 @@ const # 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.5.0-alpha.3/ssz/merkle-proofs.md + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/ssz/merkle-proofs.md # execution_payload EXECUTION_PAYLOAD_GINDEX* = 25.GeneralizedIndex @@ -124,7 +124,7 @@ type ExecutionBranch* = array[log2trunc(EXECUTION_PAYLOAD_GINDEX), Eth2Digest] - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/light-client/sync-protocol.md#modified-lightclientheader + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/capella/light-client/sync-protocol.md#modified-lightclientheader LightClientHeader* = object beacon*: BeaconBlockHeader ## Beacon block header @@ -358,7 +358,7 @@ type state_root*: Eth2Digest body*: TrustedBeaconBlockBody - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/beacon-chain.md#beaconblockbody + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/capella/beacon-chain.md#beaconblockbody BeaconBlockBody* = object randao_reveal*: ValidatorSig eth1_data*: Eth1Data @@ -699,7 +699,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.5.0-alpha.3/specs/capella/light-client/fork.md#upgrading-light-client-data +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/capella/light-client/fork.md#upgrading-light-client-data func upgrade_lc_update_to_capella*( pre: altair.LightClientUpdate): LightClientUpdate = LightClientUpdate( diff --git a/beacon_chain/spec/datatypes/constants.nim b/beacon_chain/spec/datatypes/constants.nim index 2a84749a1..3ca6430e1 100644 --- a/beacon_chain/spec/datatypes/constants.nim +++ b/beacon_chain/spec/datatypes/constants.nim @@ -87,5 +87,5 @@ const UNSET_DEPOSIT_REQUESTS_START_INDEX*: uint64 = not 0'u64 FULL_EXIT_REQUEST_AMOUNT*: uint64 = 0 - # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#withdrawal-prefixes + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/electra/beacon-chain.md#withdrawal-prefixes COMPOUNDING_WITHDRAWAL_PREFIX* = 0x02 diff --git a/beacon_chain/spec/datatypes/deneb.nim b/beacon_chain/spec/datatypes/deneb.nim index df802d03d..6070a23b4 100644 --- a/beacon_chain/spec/datatypes/deneb.nim +++ b/beacon_chain/spec/datatypes/deneb.nim @@ -167,7 +167,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.4.0-beta.5/specs/altair/light-client/sync-protocol.md#lightclientupdate + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/altair/light-client/sync-protocol.md#lightclientupdate LightClientUpdate* = object attested_header*: LightClientHeader ## Header attested to by the sync committee diff --git a/beacon_chain/spec/datatypes/electra.nim b/beacon_chain/spec/datatypes/electra.nim index 0e5fd9296..27663dd63 100644 --- a/beacon_chain/spec/datatypes/electra.nim +++ b/beacon_chain/spec/datatypes/electra.nim @@ -158,7 +158,7 @@ type ExecutePayload* = proc( execution_payload: ExecutionPayload): bool {.gcsafe, raises: [].} - # https://github.com/ethereum/consensus-specs/blob/82133085a1295e93394ebdf71df8f2f6e0962588/specs/electra/beacon-chain.md#depositreceipt + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/electra/beacon-chain.md#pendingbalancedeposit PendingBalanceDeposit* = object index*: uint64 amount*: Gwei @@ -243,7 +243,7 @@ type signature_slot*: Slot ## Slot at which the aggregate signature was created (untrusted) - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate LightClientFinalityUpdate* = object # Header attested to by the sync committee attested_header*: LightClientHeader diff --git a/beacon_chain/spec/helpers.nim b/beacon_chain/spec/helpers.nim index 973fb3183..bc0c402de 100644 --- a/beacon_chain/spec/helpers.nim +++ b/beacon_chain/spec/helpers.nim @@ -258,7 +258,7 @@ func create_blob_sidecars*( res.add(sidecar) res -# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/altair/light-client/sync-protocol.md#is_sync_committee_update +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/altair/light-client/sync-protocol.md#is_sync_committee_update template is_sync_committee_update*(update: SomeForkyLightClientUpdate): bool = when update is SomeForkyLightClientUpdateWithSyncCommittee: update.next_sync_committee_branch != diff --git a/beacon_chain/spec/network.nim b/beacon_chain/spec/network.nim index a2df6ae5c..577739cc0 100644 --- a/beacon_chain/spec/network.nim +++ b/beacon_chain/spec/network.nim @@ -27,7 +27,7 @@ const # The spec now includes this as a bare uint64 as `RESP_TIMEOUT` RESP_TIMEOUT_DUR* = RESP_TIMEOUT.int64.seconds - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/light-client/p2p-interface.md#configuration + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/altair/light-client/p2p-interface.md#configuration MAX_REQUEST_LIGHT_CLIENT_UPDATES* = 128 # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/p2p-interface.md#configuration diff --git a/beacon_chain/spec/signatures.nim b/beacon_chain/spec/signatures.nim index b3db224ce..86ee37b2c 100644 --- a/beacon_chain/spec/signatures.nim +++ b/beacon_chain/spec/signatures.nim @@ -143,7 +143,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.4.0/specs/phase0/validator.md#aggregate-signature +# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/phase0/validator.md#aggregate-signature func get_attestation_signature*( fork: Fork, genesis_validators_root: Eth2Digest, attestation_data: AttestationData, diff --git a/beacon_chain/spec/state_transition_block.nim b/beacon_chain/spec/state_transition_block.nim index 6433f79c2..0328749ca 100644 --- a/beacon_chain/spec/state_transition_block.nim +++ b/beacon_chain/spec/state_transition_block.nim @@ -82,7 +82,7 @@ func `xor`[T: array](a, b: T): T = for i in 0..