From 867995acd1eb9b28bf71d203752d907a3c1b27bd Mon Sep 17 00:00:00 2001 From: tersec Date: Wed, 17 Apr 2024 05:51:16 +0200 Subject: [PATCH] some consensus spec v1.4.0 spec URL updates (#6208) --- beacon_chain/consensus_object_pools/spec_cache.nim | 4 ++-- beacon_chain/fork_choice/fork_choice.nim | 2 +- beacon_chain/gossip_processing/README.md | 4 ++-- beacon_chain/libnimbus_lc/libnimbus_lc.h | 6 +++--- beacon_chain/libnimbus_lc/libnimbus_lc.nim | 6 +++--- beacon_chain/networking/eth2_network.nim | 2 +- beacon_chain/spec/beaconstate.nim | 12 ++++++------ beacon_chain/spec/datatypes/base.nim | 8 ++++---- beacon_chain/spec/datatypes/bellatrix.nim | 2 +- beacon_chain/spec/datatypes/capella.nim | 2 +- beacon_chain/spec/datatypes/constants.nim | 4 ++-- beacon_chain/spec/datatypes/phase0.nim | 4 ++-- beacon_chain/spec/digest.nim | 2 +- beacon_chain/spec/eth2_apis/rest_types.nim | 2 +- beacon_chain/spec/helpers.nim | 6 +++--- beacon_chain/spec/signatures.nim | 6 +++--- beacon_chain/spec/state_transition.nim | 2 +- beacon_chain/spec/state_transition_block.nim | 2 +- beacon_chain/spec/state_transition_epoch.nim | 6 +++--- docs/attestation_flow.md | 4 ++-- docs/block_flow.md | 4 ++-- tests/consensus_spec/test_fixture_kzg.nim | 6 +++--- 22 files changed, 48 insertions(+), 48 deletions(-) diff --git a/beacon_chain/consensus_object_pools/spec_cache.nim b/beacon_chain/consensus_object_pools/spec_cache.nim index 3f3411546..dfbca5d78 100644 --- a/beacon_chain/consensus_object_pools/spec_cache.nim +++ b/beacon_chain/consensus_object_pools/spec_cache.nim @@ -25,7 +25,7 @@ logScope: topics = "spec_cache" func count_active_validators*(shufflingRef: ShufflingRef): uint64 = shufflingRef.shuffled_active_validator_indices.lenu64 -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#get_committee_count_per_slot +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#get_committee_count_per_slot func get_committee_count_per_slot*(shufflingRef: ShufflingRef): uint64 = get_committee_count_per_slot(count_active_validators(shufflingRef)) @@ -51,7 +51,7 @@ iterator get_beacon_committee*( committees_per_slot * SLOTS_PER_EPOCH ): yield (index_in_committee, idx) -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#get_beacon_committee +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#get_beacon_committee func get_beacon_committee*( shufflingRef: ShufflingRef, slot: Slot, committee_index: CommitteeIndex): seq[ValidatorIndex] = diff --git a/beacon_chain/fork_choice/fork_choice.nim b/beacon_chain/fork_choice/fork_choice.nim index 114c1cbde..34c1bb97b 100644 --- a/beacon_chain/fork_choice/fork_choice.nim +++ b/beacon_chain/fork_choice/fork_choice.nim @@ -113,7 +113,7 @@ proc update_justified( self.update_justified(dag, blck, justified.epoch) ok() -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/fork-choice.md#update_checkpoints +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/fork-choice.md#update_checkpoints proc update_checkpoints( self: var Checkpoints, dag: ChainDAGRef, checkpoints: FinalityCheckpoints): FcResult[void] = diff --git a/beacon_chain/gossip_processing/README.md b/beacon_chain/gossip_processing/README.md index 809289dfc..ea59c6d0f 100644 --- a/beacon_chain/gossip_processing/README.md +++ b/beacon_chain/gossip_processing/README.md @@ -10,8 +10,8 @@ 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.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_block -- Attestations (aggregated): https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof -- Attestations (unaggregated): https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#attestation-subnets +- Attestations (aggregated): https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof +- Attestations (unaggregated): https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/p2p-interface.md#attestation-subnets - Voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#voluntary_exit - Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#proposer_slashing - Attester slashing: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#attester_slashing diff --git a/beacon_chain/libnimbus_lc/libnimbus_lc.h b/beacon_chain/libnimbus_lc/libnimbus_lc.h index f4e78ec7d..03776574e 100644 --- a/beacon_chain/libnimbus_lc/libnimbus_lc.h +++ b/beacon_chain/libnimbus_lc/libnimbus_lc.h @@ -149,10 +149,10 @@ typedef struct ETHBeaconState ETHBeaconState; * representation - If successful. * @return `NULL` - If the given `sszBytes` is malformed. * - * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#beaconstate + * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#beaconstate * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/altair/beacon-chain.md#beaconstate * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/bellatrix/beacon-chain.md#beaconstate - * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/beacon-chain.md#beaconstate + * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/capella/beacon-chain.md#beaconstate * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0/configs/README.md */ ETH_RESULT_USE_CHECK @@ -271,7 +271,7 @@ void ETHBeaconClockDestroy(ETHBeaconClock *beaconClock); * @return Slot number for the current wall clock time - If genesis has occurred. * @return `0` - If genesis is still pending. * - * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#custom-types + * @see https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#custom-types */ ETH_RESULT_USE_CHECK int ETHBeaconClockGetSlot(const ETHBeaconClock *beaconClock); diff --git a/beacon_chain/libnimbus_lc/libnimbus_lc.nim b/beacon_chain/libnimbus_lc/libnimbus_lc.nim index 44b1fa890..ee1ed697e 100644 --- a/beacon_chain/libnimbus_lc/libnimbus_lc.nim +++ b/beacon_chain/libnimbus_lc/libnimbus_lc.nim @@ -145,7 +145,7 @@ proc ETHBeaconStateCreateFromSsz( ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#beaconstate ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/altair/beacon-chain.md#beaconstate ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/bellatrix/beacon-chain.md#beaconstate - ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/beacon-chain.md#beaconstate + ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/capella/beacon-chain.md#beaconstate ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0/configs/README.md let consensusFork = ConsensusFork.decodeString($consensusVersion).valueOr: @@ -755,7 +755,7 @@ func ETHLightClientStoreIsNextSyncCommitteeKnown( ## * Whether or not the next sync committee is currently known. ## ## See: - ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/light-client/sync-protocol.md#is_next_sync_committee_known + ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/altair/light-client/sync-protocol.md#is_next_sync_committee_known ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/altair/light-client/light-client.md store[].is_next_sync_committee_known @@ -796,7 +796,7 @@ func ETHLightClientStoreGetSafetyThreshold( ## * Light client store safety threshold. ## ## See: - ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/light-client/sync-protocol.md#get_safety_threshold + ## * https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/altair/light-client/sync-protocol.md#get_safety_threshold store[].get_safety_threshold.cint proc ETHLightClientHeaderCreateCopy( diff --git a/beacon_chain/networking/eth2_network.nim b/beacon_chain/networking/eth2_network.nim index 28badf45f..ccb300fc4 100644 --- a/beacon_chain/networking/eth2_network.nim +++ b/beacon_chain/networking/eth2_network.nim @@ -2204,7 +2204,7 @@ proc getPersistentNetKeys*( func gossipId( data: openArray[byte], phase0Prefix, topic: string): seq[byte] = - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#topics-and-messages + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/p2p-interface.md#topics-and-messages # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/altair/p2p-interface.md#topics-and-messages const MESSAGE_DOMAIN_VALID_SNAPPY = [0x01'u8, 0x00, 0x00, 0x00] let messageDigest = withEth2Hash: diff --git a/beacon_chain/spec/beaconstate.nim b/beacon_chain/spec/beaconstate.nim index b646fbd2c..1e29155eb 100644 --- a/beacon_chain/spec/beaconstate.nim +++ b/beacon_chain/spec/beaconstate.nim @@ -71,7 +71,7 @@ func compute_activation_exit_epoch*(epoch: Epoch): Epoch = ## ``epoch`` take effect. epoch + 1 + MAX_SEED_LOOKAHEAD -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.7/specs/phase0/beacon-chain.md#get_validator_churn_limit +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#get_validator_churn_limit func get_validator_churn_limit*( cfg: RuntimeConfig, state: ForkyBeaconState, cache: var StateCache): uint64 = @@ -181,7 +181,7 @@ func get_slashing_penalty*(state: ForkyBeaconState, func get_whistleblower_reward*(validator_effective_balance: Gwei): Gwei = validator_effective_balance div WHISTLEBLOWER_REWARD_QUOTIENT -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.7/specs/phase0/beacon-chain.md#slash_validator +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#slash_validator # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/altair/beacon-chain.md#modified-slash_validator # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/bellatrix/beacon-chain.md#modified-slash_validator func get_proposer_reward(state: ForkyBeaconState, whistleblower_reward: Gwei): Gwei = @@ -280,7 +280,7 @@ func get_initial_beacon_block*(state: bellatrix.HashedBeaconState): bellatrix.TrustedSignedBeaconBlock( message: message, root: hash_tree_root(message)) -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/beacon-chain.md#testing +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/capella/beacon-chain.md#testing func get_initial_beacon_block*(state: capella.HashedBeaconState): capella.TrustedSignedBeaconBlock = # The genesis block is implicitly trusted @@ -378,7 +378,7 @@ func is_eligible_for_activation*( # Has not yet been activated validator.activation_epoch == FAR_FUTURE_EPOCH -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#is_valid_indexed_attestation +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#is_valid_indexed_attestation proc is_valid_indexed_attestation*( state: ForkyBeaconState, indexed_attestation: SomeIndexedAttestation, flags: UpdateFlags): Result[void, cstring] = @@ -490,7 +490,7 @@ proc is_valid_indexed_attestation( # Attestation validation # ------------------------------------------------------------------------------------------ -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#attestations +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#attestations # https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id func check_attestation_slot_target*(data: AttestationData): Result[Slot, cstring] = @@ -1016,7 +1016,7 @@ proc initialize_hashed_beacon_state_from_eth1*( result.root = hash_tree_root(result.data) # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/bellatrix/beacon-chain.md#testing -# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/capella/beacon-chain.md#testing +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/capella/beacon-chain.md#testing # https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/deneb/beacon-chain.md#testing proc initialize_beacon_state_from_eth1*( cfg: RuntimeConfig, diff --git a/beacon_chain/spec/datatypes/base.nim b/beacon_chain/spec/datatypes/base.nim index 7f38af834..975a4da7b 100644 --- a/beacon_chain/spec/datatypes/base.nim +++ b/beacon_chain/spec/datatypes/base.nim @@ -210,7 +210,7 @@ type # SSZ / hashing purposes JustificationBits* = distinct uint8 - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#proposerslashing + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#proposerslashing ProposerSlashing* = object signed_header_1*: SignedBeaconBlockHeader signed_header_2*: SignedBeaconBlockHeader @@ -332,7 +332,7 @@ type HashedValidatorPubKey* = object value*: ptr HashedValidatorPubKeyItem - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#validator + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#validator Validator* = object pubkeyData*{.serializedFieldName: "pubkey".}: HashedValidatorPubKey @@ -382,7 +382,7 @@ type deposit_count*: uint64 block_hash*: Eth2Digest - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#signedvoluntaryexit + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signedvoluntaryexit SignedVoluntaryExit* = object message*: VoluntaryExit signature*: ValidatorSig @@ -444,7 +444,7 @@ type execution_block_hash*: Eth2Digest execution_block_height*: uint64 - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.7/specs/phase0/beacon-chain.md#validator + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#validator ValidatorStatus* = object # This is a validator without the expensive, immutable, append-only parts # serialized. They're represented in memory to allow in-place SSZ reading diff --git a/beacon_chain/spec/datatypes/bellatrix.nim b/beacon_chain/spec/datatypes/bellatrix.nim index d0e883684..7dabb4d43 100644 --- a/beacon_chain/spec/datatypes/bellatrix.nim +++ b/beacon_chain/spec/datatypes/bellatrix.nim @@ -305,7 +305,7 @@ type # Execution execution_payload*: ExecutionPayload # [New in Bellatrix] - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.7/specs/phase0/beacon-chain.md#signedbeaconblock + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signedbeaconblock SignedBeaconBlock* = object message*: BeaconBlock signature*: ValidatorSig diff --git a/beacon_chain/spec/datatypes/capella.nim b/beacon_chain/spec/datatypes/capella.nim index 6a65f8187..996b806df 100644 --- a/beacon_chain/spec/datatypes/capella.nim +++ b/beacon_chain/spec/datatypes/capella.nim @@ -57,7 +57,7 @@ type message*: BLSToExecutionChange signature*: ValidatorSig - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/beacon-chain.md#historicalsummary + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/capella/beacon-chain.md#historicalsummary HistoricalSummary* = object # `HistoricalSummary` matches the components of the phase0 # `HistoricalBatch` making the two hash_tree_root-compatible. diff --git a/beacon_chain/spec/datatypes/constants.nim b/beacon_chain/spec/datatypes/constants.nim index 69d3e22ab..c8e50024b 100644 --- a/beacon_chain/spec/datatypes/constants.nim +++ b/beacon_chain/spec/datatypes/constants.nim @@ -40,7 +40,7 @@ const FAR_FUTURE_EPOCH* = Epoch(not 0'u64) FAR_FUTURE_PERIOD* = SyncCommitteePeriod(not 0'u64) - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.7/specs/phase0/beacon-chain.md#domain-types + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/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]) @@ -55,7 +55,7 @@ const DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF* = DomainType([byte 0x08, 0x00, 0x00, 0x00]) DOMAIN_CONTRIBUTION_AND_PROOF* = DomainType([byte 0x09, 0x00, 0x00, 0x00]) - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/beacon-chain.md#domain-types + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/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.4.0-beta.5/specs/phase0/fork-choice.md#configuration diff --git a/beacon_chain/spec/datatypes/phase0.nim b/beacon_chain/spec/datatypes/phase0.nim index ecf165ccf..0ef9f3f99 100644 --- a/beacon_chain/spec/datatypes/phase0.nim +++ b/beacon_chain/spec/datatypes/phase0.nim @@ -73,7 +73,7 @@ type current_justified_checkpoint*: Checkpoint finalized_checkpoint*: Checkpoint - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#get_total_balance + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#get_total_balance TotalBalances* = object # The total effective balance of all active validators during the _current_ # epoch. @@ -111,7 +111,7 @@ type data*: BeaconState root*: Eth2Digest # hash_tree_root(data) - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#beaconblock + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/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/digest.nim b/beacon_chain/spec/digest.nim index ea9fbd618..3e3ce3793 100644 --- a/beacon_chain/spec/digest.nim +++ b/beacon_chain/spec/digest.nim @@ -9,7 +9,7 @@ # Consensus hash function / digest # -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#hash +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#hash # # In Phase 0 the beacon chain is deployed with SHA256 (SHA2-256). # Note that is is different from Keccak256 (often mistakenly called SHA3-256) diff --git a/beacon_chain/spec/eth2_apis/rest_types.nim b/beacon_chain/spec/eth2_apis/rest_types.nim index 6b0f1011e..1d9b1191b 100644 --- a/beacon_chain/spec/eth2_apis/rest_types.nim +++ b/beacon_chain/spec/eth2_apis/rest_types.nim @@ -289,7 +289,7 @@ type RestWithdrawalPrefix* = distinct array[1, byte] - # https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/capella/beacon-chain.md#executionpayload + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/capella/beacon-chain.md#executionpayload RestExecutionPayload* = object # Execution block header fields parent_hash*: Eth2Digest diff --git a/beacon_chain/spec/helpers.nim b/beacon_chain/spec/helpers.nim index d7acb7058..b926788a6 100644 --- a/beacon_chain/spec/helpers.nim +++ b/beacon_chain/spec/helpers.nim @@ -112,7 +112,7 @@ func get_current_epoch*(state: ForkyBeaconState): Epoch = ## Return the current epoch. state.slot.epoch -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#get_current_epoch +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/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) @@ -123,7 +123,7 @@ func get_previous_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.4.0-beta.6/specs/phase0/beacon-chain.md#get_randao_mix +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#get_randao_mix func get_randao_mix*(state: ForkyBeaconState, epoch: Epoch): Eth2Digest = ## Return the randao mix at a recent ``epoch``. state.randao_mixes[epoch mod EPOCHS_PER_HISTORICAL_VECTOR] @@ -159,7 +159,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.4.0-beta.6/specs/phase0/beacon-chain.md#get_domain +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#get_domain func get_domain*( fork: Fork, domain_type: DomainType, diff --git a/beacon_chain/spec/signatures.nim b/beacon_chain/spec/signatures.nim index aff92afa4..f2ef5160a 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.4.0-beta.3/specs/phase0/validator.md#aggregation-selection +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/validator.md#aggregation-selection func get_slot_signature*( fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot, privkey: ValidatorPrivKey): CookedSig = @@ -171,7 +171,7 @@ func compute_deposit_signing_root( domain = compute_domain(DOMAIN_DEPOSIT, version) compute_signing_root(deposit_message, domain) -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#deposits +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#deposits func get_deposit_signature*(preset: RuntimeConfig, deposit: DepositData, privkey: ValidatorPrivKey): CookedSig = @@ -392,7 +392,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.4.0-beta.5/specs/capella/beacon-chain.md#new-process_bls_to_execution_change +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/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 489731a42..fb9bd2491 100644 --- a/beacon_chain/spec/state_transition.nim +++ b/beacon_chain/spec/state_transition.nim @@ -70,7 +70,7 @@ proc verify_block_signature( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function func verifyStateRoot( state: ForkyBeaconState, blck: ForkyBeaconBlock | ForkySigVerifiedBeaconBlock): diff --git a/beacon_chain/spec/state_transition_block.nim b/beacon_chain/spec/state_transition_block.nim index ce15b7a69..8ff70a167 100644 --- a/beacon_chain/spec/state_transition_block.nim +++ b/beacon_chain/spec/state_transition_block.nim @@ -361,7 +361,7 @@ proc process_deposit*( ok() # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#voluntary-exits -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/beacon-chain.md#modified-process_voluntary_exit +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/deneb/beacon-chain.md#modified-process_voluntary_exit proc check_voluntary_exit*( cfg: RuntimeConfig, state: ForkyBeaconState, diff --git a/beacon_chain/spec/state_transition_epoch.nim b/beacon_chain/spec/state_transition_epoch.nim index f6c748b8f..5f62ea4c1 100644 --- a/beacon_chain/spec/state_transition_epoch.nim +++ b/beacon_chain/spec/state_transition_epoch.nim @@ -40,7 +40,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.4.0-beta.6/specs/phase0/beacon-chain.md#get_total_balance +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#get_total_balance template current_epoch*(v: TotalBalances): Gwei = max(EFFECTIVE_BALANCE_INCREMENT.Gwei, v.current_epoch_raw) template previous_epoch*(v: TotalBalances): Gwei = @@ -806,7 +806,7 @@ iterator get_flag_and_inactivity_deltas*( active_increments, penalty_denominator, epoch_participation, participating_increments, info, vidx) -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-alpha.3/specs/phase0/beacon-chain.md#rewards-and-penalties-1 +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#rewards-and-penalties-1 func process_rewards_and_penalties*( state: var phase0.BeaconState, info: var phase0.EpochInfo) = # No rewards are applied at the end of `GENESIS_EPOCH` because rewards are @@ -1166,7 +1166,7 @@ func process_historical_summaries_update*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#epoch-processing +# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#epoch-processing proc process_epoch*( cfg: RuntimeConfig, state: var phase0.BeaconState, flags: UpdateFlags, cache: var StateCache, info: var phase0.EpochInfo): Result[void, cstring] = diff --git a/docs/attestation_flow.md b/docs/attestation_flow.md index a44d3265c..31c792d37 100644 --- a/docs/attestation_flow.md +++ b/docs/attestation_flow.md @@ -7,7 +7,7 @@ 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.4.0-alpha.1/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof - - Unaggregated: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id + - Unaggregated: https://github.com/ethereum/consensus-specs/blob/v1.4.0/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.4.0-beta.6/specs/phase0/beacon-chain.md#attestations @@ -51,7 +51,7 @@ 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.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof +- https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof - https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#attestation-subnets Finally, valid attestations are added to the local `attestationPool`. diff --git a/docs/block_flow.md b/docs/block_flow.md index 96715acec..ec6be43c1 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.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_block. + https://github.com/ethereum/consensus-specs/blob/v1.4.0/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.4.0-beta.6/specs/phase0/beacon-chain.md#block-processing @@ -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.4.0-beta.5/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.4.0/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/tests/consensus_spec/test_fixture_kzg.nim b/tests/consensus_spec/test_fixture_kzg.nim index c115f0da8..5280a63a0 100644 --- a/tests/consensus_spec/test_fixture_kzg.nim +++ b/tests/consensus_spec/test_fixture_kzg.nim @@ -43,7 +43,7 @@ proc runBlobToKzgCommitmentTest(suiteName, suitePath, path: string) = output = data["output"] blob = fromHex[131072](data["input"]["blob"].getStr) - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/tests/formats/kzg/blob_to_kzg_commitment.md#condition + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/tests/formats/kzg/blob_to_kzg_commitment.md#condition # If the blob is invalid (e.g. incorrect length or one of the 32-byte # blocks does not represent a BLS field element) it should error, i.e. the # output should be `null`. @@ -143,7 +143,7 @@ proc runComputeKzgProofTest(suiteName, suitePath, path: string) = blob = fromHex[131072](data["input"]["blob"].getStr) z = fromHex[32](data["input"]["z"].getStr) - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/tests/formats/kzg/compute_kzg_proof.md#condition + # https://github.com/ethereum/consensus-specs/blob/v1.4.0/tests/formats/kzg/compute_kzg_proof.md#condition # "If the blob is invalid (e.g. incorrect length or one of the 32-byte # blocks does not represent a BLS field element) or z is not a valid BLS # field element, it should error, i.e. the output should be null." @@ -227,4 +227,4 @@ suite suiteName: for kind, path in walkDir(testsDir, relative = true, checkDir = true): runComputeBlobKzgProofTest(suiteName, testsDir, testsDir / path) -doAssert Kzg.freeTrustedSetup().isOk +doAssert Kzg.freeTrustedSetup().isOk \ No newline at end of file