spec ref URL & copyright year updates (#4467)

This commit is contained in:
tersec 2023-01-06 16:28:46 +00:00 committed by GitHub
parent 05a04236b9
commit c5d1683f19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 39 additions and 38 deletions

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2019-2022 Status Research & Development GmbH # Copyright (c) 2019-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
@ -1093,15 +1093,15 @@ proc validateContribution*(
return ok((sig, participants)) return ok((sig, participants))
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/altair/light-client/p2p-interface.md#light_client_finality_update # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/p2p-interface.md#light_client_finality_update
proc validateLightClientFinalityUpdate*( proc validateLightClientFinalityUpdate*(
pool: var LightClientPool, dag: ChainDAGRef, pool: var LightClientPool, dag: ChainDAGRef,
finality_update: altair.LightClientFinalityUpdate, finality_update: altair.LightClientFinalityUpdate,
wallTime: BeaconTime): Result[void, ValidationError] = wallTime: BeaconTime): Result[void, ValidationError] =
let finalized_slot = finality_update.finalized_header.slot let finalized_slot = finality_update.finalized_header.slot
if finalized_slot <= pool.latestForwardedFinalitySlot: if finalized_slot <= pool.latestForwardedFinalitySlot:
# [IGNORE] No other `finality_update` with a lower or equal # [IGNORE] The `finalized_header.slot` is greater than that of all previously
# `finalized_header.slot` was already forwarded on the network. # forwarded `finality_update`s
return errIgnore("LightClientFinalityUpdate: slot already forwarded") return errIgnore("LightClientFinalityUpdate: slot already forwarded")
let let
@ -1121,15 +1121,15 @@ proc validateLightClientFinalityUpdate*(
pool.latestForwardedFinalitySlot = finalized_slot pool.latestForwardedFinalitySlot = finalized_slot
ok() ok()
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/altair/light-client/p2p-interface.md#light_client_optimistic_update # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/p2p-interface.md#light_client_optimistic_update
proc validateLightClientOptimisticUpdate*( proc validateLightClientOptimisticUpdate*(
pool: var LightClientPool, dag: ChainDAGRef, pool: var LightClientPool, dag: ChainDAGRef,
optimistic_update: altair.LightClientOptimisticUpdate, optimistic_update: altair.LightClientOptimisticUpdate,
wallTime: BeaconTime): Result[void, ValidationError] = wallTime: BeaconTime): Result[void, ValidationError] =
let attested_slot = optimistic_update.attested_header.slot let attested_slot = optimistic_update.attested_header.slot
if attested_slot <= pool.latestForwardedOptimisticSlot: if attested_slot <= pool.latestForwardedOptimisticSlot:
# [IGNORE] No other `optimistic_update` with a lower or equal # The `attested_header.slot` is greater than that of all previously
# `attested_header.slot` was already forwarded on the network. # forwarded `optimistic_update`s
return errIgnore("LightClientOptimisticUpdate: slot already forwarded") return errIgnore("LightClientOptimisticUpdate: slot already forwarded")
let let

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2022 Status Research & Development GmbH # Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -484,13 +484,13 @@ func toValidationError(
of VerifierError.MissingParent, of VerifierError.MissingParent,
VerifierError.UnviableFork, VerifierError.UnviableFork,
VerifierError.Duplicate: VerifierError.Duplicate:
# [IGNORE] No other `finality_update` with a lower or equal # [IGNORE] The `finalized_header.slot` is greater than that of
# `finalized_header.slot` was already forwarded on the network. # all previously forwarded `finality_update`s
# [IGNORE] No other `optimistic_update` with a lower or equal # [IGNORE] The `attested_header.slot` is greater than that of all
# `attested_header.slot` was already forwarded on the network. # previously forwarded `optimistic_update`s
errIgnore($r.error) errIgnore($r.error)
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/altair/light-client/sync-protocol.md#process_light_client_finality_update # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/sync-protocol.md#process_light_client_finality_update
proc processLightClientFinalityUpdate*( proc processLightClientFinalityUpdate*(
self: var LightClientProcessor, src: MsgSource, self: var LightClientProcessor, src: MsgSource,
finality_update: altair.LightClientFinalityUpdate finality_update: altair.LightClientFinalityUpdate

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2022 Status Research & Development GmbH # Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -30,14 +30,14 @@ type
SignedBLSToExecutionChangeList* = SignedBLSToExecutionChangeList* =
List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES] List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES]
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/capella/beacon-chain.md#withdrawal # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/capella/beacon-chain.md#withdrawal
Withdrawal* = object Withdrawal* = object
index*: WithdrawalIndex index*: WithdrawalIndex
validator_index*: uint64 validator_index*: uint64
address*: ExecutionAddress address*: ExecutionAddress
amount*: Gwei amount*: Gwei
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/capella/beacon-chain.md#blstoexecutionchange # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/capella/beacon-chain.md#blstoexecutionchange
BLSToExecutionChange* = object BLSToExecutionChange* = object
validator_index*: uint64 validator_index*: uint64
from_bls_pubkey*: ValidatorPubKey from_bls_pubkey*: ValidatorPubKey

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2022 Status Research & Development GmbH # Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -81,7 +81,7 @@ type
transactions*: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] transactions*: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD]
withdrawals*: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] withdrawals*: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD]
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/eip4844/beacon-chain.md#executionpayloadheader # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/eip4844/beacon-chain.md#executionpayloadheader
ExecutionPayloadHeader* = object ExecutionPayloadHeader* = object
parent_hash*: Eth2Digest parent_hash*: Eth2Digest
fee_recipient*: ExecutionAddress fee_recipient*: ExecutionAddress
@ -235,7 +235,7 @@ type
state_root*: Eth2Digest state_root*: Eth2Digest
body*: TrustedBeaconBlockBody body*: TrustedBeaconBlockBody
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/eip4844/beacon-chain.md#beaconblockbody # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/eip4844/beacon-chain.md#beaconblockbody
BeaconBlockBody* = object BeaconBlockBody* = object
randao_reveal*: ValidatorSig randao_reveal*: ValidatorSig
eth1_data*: Eth1Data eth1_data*: Eth1Data

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2018-2022 Status Research & Development GmbH # Copyright (c) 2018-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -318,9 +318,9 @@ template is_better_update*[A, B: SomeLightClientUpdate](
func contextEpoch*(bootstrap: altair.LightClientBootstrap): Epoch = func contextEpoch*(bootstrap: altair.LightClientBootstrap): Epoch =
bootstrap.header.slot.epoch bootstrap.header.slot.epoch
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate
func contextEpoch*(update: SomeLightClientUpdate): Epoch = func contextEpoch*(update: SomeLightClientUpdate): Epoch =
update.attested_header.slot.epoch update.attested_header.slot.epoch

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2021-2022 Status Research & Development GmbH # Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -18,7 +18,7 @@ import
from ../consensus_object_pools/block_pools_types import VerifierError from ../consensus_object_pools/block_pools_types import VerifierError
export block_pools_types.VerifierError export block_pools_types.VerifierError
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/altair/light-client/sync-protocol.md#initialize_light_client_store # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/sync-protocol.md#initialize_light_client_store
func initialize_light_client_store*( func initialize_light_client_store*(
trusted_block_root: Eth2Digest, trusted_block_root: Eth2Digest,
bootstrap: altair.LightClientBootstrap bootstrap: altair.LightClientBootstrap

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2018-2022 Status Research & Development GmbH # Copyright (c) 2018-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -71,7 +71,7 @@ func getAggregateAndProofsTopic*(forkDigest: ForkDigest): string =
func getBlsToExecutionChangeTopic*(forkDigest: ForkDigest): string = func getBlsToExecutionChangeTopic*(forkDigest: ForkDigest): string =
eth2Prefix(forkDigest) & topicBlsToExecutionChangeSuffix eth2Prefix(forkDigest) & topicBlsToExecutionChangeSuffix
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/eip4844/p2p-interface.md#topics-and-messages # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/eip4844/p2p-interface.md#topics-and-messages
func getBeaconBlockAndBlobsSidecarTopic*(forkDigest: ForkDigest): string = func getBeaconBlockAndBlobsSidecarTopic*(forkDigest: ForkDigest): string =
eth2Prefix(forkDigest) & topicBeaconBlockAndBlobsSidecarTopicSuffix eth2Prefix(forkDigest) & topicBeaconBlockAndBlobsSidecarTopicSuffix

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2018-2022 Status Research & Development GmbH # Copyright (c) 2018-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -371,7 +371,7 @@ proc verify_builder_signature*(
let signing_root = compute_builder_signing_root(fork, msg) let signing_root = compute_builder_signing_root(fork, msg)
blsVerify(pubkey, signing_root.data, signature) blsVerify(pubkey, signing_root.data, signature)
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/capella/beacon-chain.md#new-process_bls_to_execution_change # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/capella/beacon-chain.md#new-process_bls_to_execution_change
func compute_bls_to_execution_change_signing_root( func compute_bls_to_execution_change_signing_root(
fork: Fork, genesis_validators_root: Eth2Digest, fork: Fork, genesis_validators_root: Eth2Digest,
epoch: Epoch, msg: BLSToExecutionChange): Eth2Digest = epoch: Epoch, msg: BLSToExecutionChange): Eth2Digest =

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2018-2022 Status Research & Development GmbH # Copyright (c) 2018-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -970,7 +970,7 @@ proc process_block*(
ok() ok()
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/capella/beacon-chain.md#block-processing # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/capella/beacon-chain.md#block-processing
# TODO workaround for https://github.com/nim-lang/Nim/issues/18095 # TODO workaround for https://github.com/nim-lang/Nim/issues/18095
type SomeCapellaBlock = type SomeCapellaBlock =
capella.BeaconBlock | capella.SigVerifiedBeaconBlock | capella.TrustedBeaconBlock capella.BeaconBlock | capella.SigVerifiedBeaconBlock | capella.TrustedBeaconBlock
@ -996,7 +996,8 @@ proc process_block*(
base_reward_per_increment = base_reward_per_increment =
get_base_reward_per_increment(total_active_balance) get_base_reward_per_increment(total_active_balance)
? process_operations( ? process_operations(
cfg, state, blck.body, base_reward_per_increment, flags, cache) cfg, state, blck.body, base_reward_per_increment,
flags, cache) # [Modified in Capella]
? process_sync_aggregate( ? process_sync_aggregate(
state, blck.body.sync_aggregate, total_active_balance, cache) state, blck.body.sync_aggregate, total_active_balance, cache)

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2022 Status Research & Development GmbH # Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -116,7 +116,7 @@ proc isGossipSupported*(
else: else:
period <= finalizedPeriod period <= finalizedPeriod
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap
proc doRequest( proc doRequest(
e: typedesc[Bootstrap], e: typedesc[Bootstrap],
peer: Peer, peer: Peer,
@ -174,7 +174,7 @@ proc doRequest(
raises: [Defect, IOError].} = raises: [Defect, IOError].} =
peer.lightClientFinalityUpdate() peer.lightClientFinalityUpdate()
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate
proc doRequest( proc doRequest(
e: typedesc[OptimisticUpdate], e: typedesc[OptimisticUpdate],
peer: Peer peer: Peer

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2018-2022 Status Research & Development GmbH # Copyright (c) 2018-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -398,7 +398,7 @@ p2pProtocol BeaconSync(version = 1,
debug "Block root request done", debug "Block root request done",
peer, roots = blockRoots.len, count, found peer, roots = blockRoots.len, count, found
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap
proc lightClientBootstrap( proc lightClientBootstrap(
peer: Peer, peer: Peer,
blockRoot: Eth2Digest, blockRoot: Eth2Digest,

View File

@ -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) Blocks are listened to via the gossipsub topic `/eth2/{$forkDigest}/beacon_block/ssz_snappy` (`topicBeaconBlocks` variable)
They are then: They are then:
- validated by `blockValidator()` in the Eth2Processor by `validateBeaconBlock()` according to spec https://github.com/ethereum/consensus-specs/blob/v1.1.10/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-alpha.2/specs/phase0/p2p-interface.md#beacon_block
- Important: P2P validation is not full verification (state transition and internal cryptographic signatures were not checked) - 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 - enqueued in the shared block queue `AsyncQueue[BlockEntry]` in case of success
- dropped in case of error - dropped in case of error
@ -115,7 +115,7 @@ Logs:
### Gossip flow out ### Gossip flow out
- After validation in `blockValidator()` in the Eth2Processor by `validateBeaconBlock()` according to spec https://github.com/ethereum/consensus-specs/blob/v1.1.10/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-alpha.2/specs/phase0/p2p-interface.md#beacon_block
- Important: P2P validation is not full verification (state transition and internal cryptographic signatures were not checked) - 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)` - We jump into libp2p/protocols/pubsub/pubsub.nim in the method `validate(PubSub, message)`
- which was called by `rpcHandler(GossipSub, PubSubPeer, RPCMsg)` - which was called by `rpcHandler(GossipSub, PubSubPeer, RPCMsg)`