consensus spec v1.4.0-beta.5 URL updates (#5672)
This commit is contained in:
parent
cb6b54ec89
commit
9c6ba7d142
|
@ -4,8 +4,8 @@ This folder holds the various consensus object pools needed for a blockchain cli
|
||||||
|
|
||||||
Object in those pools have passed the "gossip validation" filter according
|
Object in those pools have passed the "gossip validation" filter according
|
||||||
to specs:
|
to specs:
|
||||||
- blocks: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#beacon_block
|
- blocks: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_block
|
||||||
- aggregate attestations: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
|
- aggregate attestations: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
|
||||||
- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
||||||
- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#voluntary_exit
|
- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#voluntary_exit
|
||||||
- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#attester_slashing
|
- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#attester_slashing
|
||||||
|
|
|
@ -349,7 +349,7 @@ proc produceSyncAggregate*(
|
||||||
|
|
||||||
proc isEpochLeadTime*(
|
proc isEpochLeadTime*(
|
||||||
pool: SyncCommitteeMsgPool, epochsToSyncPeriod: uint64): bool =
|
pool: SyncCommitteeMsgPool, epochsToSyncPeriod: uint64): bool =
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/validator.md#sync-committee-subnet-stability
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/validator.md#sync-committee-subnet-stability
|
||||||
# This ensures a uniform distribution without requiring additional state:
|
# This ensures a uniform distribution without requiring additional state:
|
||||||
# (1/4) = 1/4, 4 slots out
|
# (1/4) = 1/4, 4 slots out
|
||||||
# (3/4) * (1/3) = 1/4, 3 slots out
|
# (3/4) * (1/3) = 1/4, 3 slots out
|
||||||
|
|
|
@ -10,7 +10,7 @@ This folder holds a collection of modules to:
|
||||||
Gossip validation is different from consensus verification in particular for blocks.
|
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
|
- 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.4/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
|
- 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 (unaggregated): https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/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
|
- 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
|
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#proposer_slashing
|
||||||
|
|
|
@ -795,7 +795,7 @@ typedef struct ETHExecutionPayloadHeader ETHExecutionPayloadHeader;
|
||||||
*
|
*
|
||||||
* @return Execution payload header.
|
* @return Execution payload header.
|
||||||
*
|
*
|
||||||
* @see https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/beacon-chain.md#executionpayloadheader
|
* @see https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#executionpayloadheader
|
||||||
*/
|
*/
|
||||||
ETH_RESULT_USE_CHECK
|
ETH_RESULT_USE_CHECK
|
||||||
const ETHExecutionPayloadHeader *ETHLightClientHeaderGetExecution(
|
const ETHExecutionPayloadHeader *ETHLightClientHeaderGetExecution(
|
||||||
|
|
|
@ -972,7 +972,7 @@ func ETHLightClientHeaderGetExecution(
|
||||||
## * Execution payload header.
|
## * Execution payload header.
|
||||||
##
|
##
|
||||||
## See:
|
## See:
|
||||||
## * https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/deneb/beacon-chain.md#executionpayloadheader
|
## * https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#executionpayloadheader
|
||||||
addr header[].execution
|
addr header[].execution
|
||||||
|
|
||||||
func ETHExecutionPayloadHeaderGetParentHash(
|
func ETHExecutionPayloadHeaderGetParentHash(
|
||||||
|
|
|
@ -174,7 +174,7 @@ type
|
||||||
MounterProc* = proc(network: Eth2Node) {.gcsafe, raises: [CatchableError].}
|
MounterProc* = proc(network: Eth2Node) {.gcsafe, raises: [CatchableError].}
|
||||||
MessageContentPrinter* = proc(msg: pointer): string {.gcsafe, raises: [].}
|
MessageContentPrinter* = proc(msg: pointer): string {.gcsafe, raises: [].}
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#goodbye
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#goodbye
|
||||||
DisconnectionReason* = enum
|
DisconnectionReason* = enum
|
||||||
# might see other values on the wire!
|
# might see other values on the wire!
|
||||||
ClientShutDown = 1
|
ClientShutDown = 1
|
||||||
|
@ -2536,7 +2536,7 @@ proc subscribeAttestationSubnets*(
|
||||||
|
|
||||||
proc unsubscribeAttestationSubnets*(
|
proc unsubscribeAttestationSubnets*(
|
||||||
node: Eth2Node, subnets: AttnetBits, forkDigest: ForkDigest) =
|
node: Eth2Node, subnets: AttnetBits, forkDigest: ForkDigest) =
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#attestations-and-aggregation
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#attestations-and-aggregation
|
||||||
# Nimbus won't score attestation subnets for now; we just rely on block and
|
# Nimbus won't score attestation subnets for now; we just rely on block and
|
||||||
# aggregate which are more stable and reliable
|
# aggregate which are more stable and reliable
|
||||||
|
|
||||||
|
|
|
@ -869,7 +869,7 @@ func forkDigests(node: BeaconNode): auto =
|
||||||
node.dag.forkDigests.deneb]
|
node.dag.forkDigests.deneb]
|
||||||
forkDigestsArray
|
forkDigestsArray
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#attestation-subnet-subscription
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#attestation-subnet-subscription
|
||||||
proc updateAttestationSubnetHandlers(node: BeaconNode, slot: Slot) =
|
proc updateAttestationSubnetHandlers(node: BeaconNode, slot: Slot) =
|
||||||
if node.gossipState.card == 0:
|
if node.gossipState.card == 0:
|
||||||
# When disconnected, updateGossipState is responsible for all things
|
# When disconnected, updateGossipState is responsible for all things
|
||||||
|
@ -1644,7 +1644,7 @@ proc installMessageValidators(node: BeaconNode) =
|
||||||
MsgSource.gossip, signedBlock)))
|
MsgSource.gossip, signedBlock)))
|
||||||
|
|
||||||
# beacon_attestation_{subnet_id}
|
# beacon_attestation_{subnet_id}
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
||||||
for it in SubnetId:
|
for it in SubnetId:
|
||||||
closureScope: # Needed for inner `proc`; don't lift it out of loop.
|
closureScope: # Needed for inner `proc`; don't lift it out of loop.
|
||||||
let subnet_id = it
|
let subnet_id = it
|
||||||
|
@ -1667,7 +1667,7 @@ proc installMessageValidators(node: BeaconNode) =
|
||||||
MsgSource.gossip, signedAggregateAndProof)))
|
MsgSource.gossip, signedAggregateAndProof)))
|
||||||
|
|
||||||
# attester_slashing
|
# attester_slashing
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#attester_slashing
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#attester_slashing
|
||||||
node.network.addValidator(
|
node.network.addValidator(
|
||||||
getAttesterSlashingsTopic(digest), proc (
|
getAttesterSlashingsTopic(digest), proc (
|
||||||
attesterSlashing: AttesterSlashing
|
attesterSlashing: AttesterSlashing
|
||||||
|
@ -1732,7 +1732,7 @@ proc installMessageValidators(node: BeaconNode) =
|
||||||
|
|
||||||
when consensusFork >= ConsensusFork.Deneb:
|
when consensusFork >= ConsensusFork.Deneb:
|
||||||
# blob_sidecar_{subnet_id}
|
# blob_sidecar_{subnet_id}
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/deneb/p2p-interface.md#blob_sidecar_subnet_id
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/p2p-interface.md#blob_sidecar_subnet_id
|
||||||
for it in BlobId:
|
for it in BlobId:
|
||||||
closureScope: # Needed for inner `proc`; don't lift it out of loop.
|
closureScope: # Needed for inner `proc`; don't lift it out of loop.
|
||||||
let subnet_id = it
|
let subnet_id = it
|
||||||
|
|
|
@ -133,13 +133,13 @@ template `+`*(a: TimeDiff, b: Duration): TimeDiff =
|
||||||
const
|
const
|
||||||
# Offsets from the start of the slot to when the corresponding message should
|
# Offsets from the start of the slot to when the corresponding message should
|
||||||
# be sent
|
# be sent
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/validator.md#attesting
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/validator.md#attesting
|
||||||
attestationSlotOffset* = TimeDiff(nanoseconds:
|
attestationSlotOffset* = TimeDiff(nanoseconds:
|
||||||
NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT)
|
NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT)
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/validator.md#broadcast-aggregate
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/validator.md#broadcast-aggregate
|
||||||
aggregateSlotOffset* = TimeDiff(nanoseconds:
|
aggregateSlotOffset* = TimeDiff(nanoseconds:
|
||||||
NANOSECONDS_PER_SLOT.int64 * 2 div INTERVALS_PER_SLOT)
|
NANOSECONDS_PER_SLOT.int64 * 2 div INTERVALS_PER_SLOT)
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/validator.md#prepare-sync-committee-message
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/validator.md#prepare-sync-committee-message
|
||||||
syncCommitteeMessageSlotOffset* = TimeDiff(nanoseconds:
|
syncCommitteeMessageSlotOffset* = TimeDiff(nanoseconds:
|
||||||
NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT)
|
NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT)
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/validator.md#broadcast-sync-committee-contribution
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/validator.md#broadcast-sync-committee-contribution
|
||||||
|
@ -188,7 +188,7 @@ func epoch*(slot: Slot): Epoch = # aka compute_epoch_at_slot
|
||||||
if slot == FAR_FUTURE_SLOT: FAR_FUTURE_EPOCH
|
if slot == FAR_FUTURE_SLOT: FAR_FUTURE_EPOCH
|
||||||
else: Epoch(slot div SLOTS_PER_EPOCH)
|
else: Epoch(slot div SLOTS_PER_EPOCH)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.3/specs/phase0/fork-choice.md#compute_slots_since_epoch_start
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/fork-choice.md#compute_slots_since_epoch_start
|
||||||
func since_epoch_start*(slot: Slot): uint64 = # aka compute_slots_since_epoch_start
|
func since_epoch_start*(slot: Slot): uint64 = # aka compute_slots_since_epoch_start
|
||||||
## How many slots since the beginning of the epoch (`[0..SLOTS_PER_EPOCH-1]`)
|
## How many slots since the beginning of the epoch (`[0..SLOTS_PER_EPOCH-1]`)
|
||||||
(slot mod SLOTS_PER_EPOCH)
|
(slot mod SLOTS_PER_EPOCH)
|
||||||
|
|
|
@ -82,7 +82,7 @@ func get_validator_churn_limit*(
|
||||||
count_active_validators(
|
count_active_validators(
|
||||||
state, state.get_current_epoch(), cache) div cfg.CHURN_LIMIT_QUOTIENT)
|
state, state.get_current_epoch(), cache) div cfg.CHURN_LIMIT_QUOTIENT)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.3/specs/deneb/beacon-chain.md#new-get_validator_activation_churn_limit
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#new-get_validator_activation_churn_limit
|
||||||
func get_validator_activation_churn_limit*(
|
func get_validator_activation_churn_limit*(
|
||||||
cfg: RuntimeConfig, state: deneb.BeaconState, cache: var StateCache):
|
cfg: RuntimeConfig, state: deneb.BeaconState, cache: var StateCache):
|
||||||
uint64 =
|
uint64 =
|
||||||
|
|
|
@ -31,7 +31,7 @@ const
|
||||||
# This index is rooted in `BeaconBlockBody`.
|
# This index is rooted in `BeaconBlockBody`.
|
||||||
# The first member (`randao_reveal`) is 16, subsequent members +1 each.
|
# The first member (`randao_reveal`) is 16, subsequent members +1 each.
|
||||||
# If there are ever more than 16 members in `BeaconBlockBody`, indices change!
|
# If there are ever more than 16 members in `BeaconBlockBody`, indices change!
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.3/ssz/merkle-proofs.md
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/ssz/merkle-proofs.md
|
||||||
EXECUTION_PAYLOAD_GINDEX* = 25.GeneralizedIndex # execution_payload
|
EXECUTION_PAYLOAD_GINDEX* = 25.GeneralizedIndex # execution_payload
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -18,7 +18,7 @@ type
|
||||||
DomainType* = distinct array[4, byte]
|
DomainType* = distinct array[4, byte]
|
||||||
|
|
||||||
const
|
const
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#constants
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#constants
|
||||||
NODE_ID_BITS* = 256
|
NODE_ID_BITS* = 256
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#configuration
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#configuration
|
||||||
|
@ -62,7 +62,7 @@ const
|
||||||
REORG_PARENT_WEIGHT_THRESHOLD*: uint64 = 160
|
REORG_PARENT_WEIGHT_THRESHOLD*: uint64 = 160
|
||||||
REORG_MAX_EPOCHS_SINCE_FINALIZATION* = Epoch(2)
|
REORG_MAX_EPOCHS_SINCE_FINALIZATION* = Epoch(2)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/deneb/p2p-interface.md#configuration
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/p2p-interface.md#configuration
|
||||||
BLOB_SIDECAR_SUBNET_COUNT*: uint64 = 6
|
BLOB_SIDECAR_SUBNET_COUNT*: uint64 = 6
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#configuration
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#configuration
|
||||||
|
|
|
@ -30,10 +30,8 @@ from kzg4844 import KzgCommitment, KzgProof
|
||||||
export json_serialization, base, kzg4844
|
export json_serialization, base, kzg4844
|
||||||
|
|
||||||
const
|
const
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.2/specs/deneb/polynomial-commitments.md#constants
|
|
||||||
BYTES_PER_FIELD_ELEMENT = 32
|
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/polynomial-commitments.md#constants
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/polynomial-commitments.md#constants
|
||||||
|
BYTES_PER_FIELD_ELEMENT = 32
|
||||||
BLS_MODULUS* = "52435875175126190479447740508185965837690552500527637822603658699938581184513".u256
|
BLS_MODULUS* = "52435875175126190479447740508185965837690552500527637822603658699938581184513".u256
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -44,13 +42,13 @@ type
|
||||||
# current spec doesn't ever SSZ-serialize it or hash_tree_root it
|
# current spec doesn't ever SSZ-serialize it or hash_tree_root it
|
||||||
VersionedHash* = array[32, byte]
|
VersionedHash* = array[32, byte]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/deneb/beacon-chain.md#custom-types
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#custom-types
|
||||||
BlobIndex* = uint64
|
BlobIndex* = uint64
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/polynomial-commitments.md#custom-types
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/polynomial-commitments.md#custom-types
|
||||||
Blob* = array[BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB, byte]
|
Blob* = array[BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB, byte]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/deneb/p2p-interface.md#blobsidecar
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/p2p-interface.md#blobsidecar
|
||||||
BlobSidecar* = object
|
BlobSidecar* = object
|
||||||
index*: BlobIndex
|
index*: BlobIndex
|
||||||
## Index of blob in block
|
## Index of blob in block
|
||||||
|
@ -62,12 +60,12 @@ type
|
||||||
kzg_commitment_inclusion_proof*:
|
kzg_commitment_inclusion_proof*:
|
||||||
array[KZG_COMMITMENT_INCLUSION_PROOF_DEPTH, Eth2Digest]
|
array[KZG_COMMITMENT_INCLUSION_PROOF_DEPTH, Eth2Digest]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.2/specs/deneb/p2p-interface.md#blobidentifier
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/p2p-interface.md#blobidentifier
|
||||||
BlobIdentifier* = object
|
BlobIdentifier* = object
|
||||||
block_root*: Eth2Digest
|
block_root*: Eth2Digest
|
||||||
index*: BlobIndex
|
index*: BlobIndex
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/beacon-chain.md#executionpayload
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#executionpayload
|
||||||
ExecutionPayload* = object
|
ExecutionPayload* = object
|
||||||
# Execution block header fields
|
# Execution block header fields
|
||||||
parent_hash*: Eth2Digest
|
parent_hash*: Eth2Digest
|
||||||
|
@ -108,7 +106,7 @@ type
|
||||||
blockValue*: Wei
|
blockValue*: Wei
|
||||||
blobsBundle*: BlobsBundle
|
blobsBundle*: BlobsBundle
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/deneb/beacon-chain.md#executionpayloadheader
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#executionpayloadheader
|
||||||
ExecutionPayloadHeader* = object
|
ExecutionPayloadHeader* = object
|
||||||
# Execution block header fields
|
# Execution block header fields
|
||||||
parent_hash*: Eth2Digest
|
parent_hash*: Eth2Digest
|
||||||
|
@ -368,7 +366,7 @@ type
|
||||||
state_root*: Eth2Digest
|
state_root*: Eth2Digest
|
||||||
body*: TrustedBeaconBlockBody
|
body*: TrustedBeaconBlockBody
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/beacon-chain.md#beaconblockbody
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#beaconblockbody
|
||||||
BeaconBlockBody* = object
|
BeaconBlockBody* = object
|
||||||
randao_reveal*: ValidatorSig
|
randao_reveal*: ValidatorSig
|
||||||
eth1_data*: Eth1Data
|
eth1_data*: Eth1Data
|
||||||
|
|
|
@ -839,7 +839,7 @@ func toAltairLightClientHeader(
|
||||||
altair.LightClientHeader(
|
altair.LightClientHeader(
|
||||||
beacon: blck.message.toBeaconBlockHeader())
|
beacon: blck.message.toBeaconBlockHeader())
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.3/specs/capella/light-client/full-node.md#modified-block_to_light_client_header
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/light-client/full-node.md#modified-block_to_light_client_header
|
||||||
func toCapellaLightClientHeader(
|
func toCapellaLightClientHeader(
|
||||||
blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6)
|
blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6)
|
||||||
phase0.SignedBeaconBlock | phase0.TrustedSignedBeaconBlock |
|
phase0.SignedBeaconBlock | phase0.TrustedSignedBeaconBlock |
|
||||||
|
|
|
@ -83,7 +83,7 @@ func compute_subnet_for_attestation*(
|
||||||
(committees_since_epoch_start + committee_index.asUInt64) mod
|
(committees_since_epoch_start + committee_index.asUInt64) mod
|
||||||
ATTESTATION_SUBNET_COUNT)
|
ATTESTATION_SUBNET_COUNT)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/validator.md#broadcast-attestation
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/validator.md#broadcast-attestation
|
||||||
func getAttestationTopic*(forkDigest: ForkDigest,
|
func getAttestationTopic*(forkDigest: ForkDigest,
|
||||||
subnetId: SubnetId): string =
|
subnetId: SubnetId): string =
|
||||||
## For subscribing and unsubscribing to/from a subnet.
|
## For subscribing and unsubscribing to/from a subnet.
|
||||||
|
@ -151,7 +151,7 @@ func getDiscoveryForkID*(cfg: RuntimeConfig,
|
||||||
next_fork_version: current_fork_version,
|
next_fork_version: current_fork_version,
|
||||||
next_fork_epoch: FAR_FUTURE_EPOCH)
|
next_fork_epoch: FAR_FUTURE_EPOCH)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/p2p-interface.md#transitioning-the-gossip
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/p2p-interface.md#transitioning-the-gossip
|
||||||
type GossipState* = set[ConsensusFork]
|
type GossipState* = set[ConsensusFork]
|
||||||
func getTargetGossipState*(
|
func getTargetGossipState*(
|
||||||
epoch, ALTAIR_FORK_EPOCH, BELLATRIX_FORK_EPOCH, CAPELLA_FORK_EPOCH,
|
epoch, ALTAIR_FORK_EPOCH, BELLATRIX_FORK_EPOCH, CAPELLA_FORK_EPOCH,
|
||||||
|
|
|
@ -88,7 +88,7 @@ func compute_block_signing_root*(
|
||||||
fork, DOMAIN_BEACON_PROPOSER, epoch, genesis_validators_root)
|
fork, DOMAIN_BEACON_PROPOSER, epoch, genesis_validators_root)
|
||||||
compute_signing_root(blck, domain)
|
compute_signing_root(blck, domain)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.3/specs/phase0/validator.md#signature
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/validator.md#signature
|
||||||
func get_block_signature*(
|
func get_block_signature*(
|
||||||
fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot,
|
fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot,
|
||||||
root: Eth2Digest, privkey: ValidatorPrivKey): CookedSig =
|
root: Eth2Digest, privkey: ValidatorPrivKey): CookedSig =
|
||||||
|
@ -173,7 +173,7 @@ func compute_deposit_signing_root(
|
||||||
domain = compute_domain(DOMAIN_DEPOSIT, version)
|
domain = compute_domain(DOMAIN_DEPOSIT, version)
|
||||||
compute_signing_root(deposit_message, domain)
|
compute_signing_root(deposit_message, domain)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-alpha.3/specs/phase0/beacon-chain.md#deposits
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/beacon-chain.md#deposits
|
||||||
func get_deposit_signature*(preset: RuntimeConfig,
|
func get_deposit_signature*(preset: RuntimeConfig,
|
||||||
deposit: DepositData,
|
deposit: DepositData,
|
||||||
privkey: ValidatorPrivKey): CookedSig =
|
privkey: ValidatorPrivKey): CookedSig =
|
||||||
|
|
|
@ -715,10 +715,10 @@ func process_withdrawals*(
|
||||||
|
|
||||||
ok()
|
ok()
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/beacon-chain.md#kzg_commitment_to_versioned_hash
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#kzg_commitment_to_versioned_hash
|
||||||
func kzg_commitment_to_versioned_hash*(
|
func kzg_commitment_to_versioned_hash*(
|
||||||
kzg_commitment: KzgCommitment): VersionedHash =
|
kzg_commitment: KzgCommitment): VersionedHash =
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.3/specs/deneb/beacon-chain.md#blob
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/beacon-chain.md#blob
|
||||||
const VERSIONED_HASH_VERSION_KZG = 0x01'u8
|
const VERSIONED_HASH_VERSION_KZG = 0x01'u8
|
||||||
|
|
||||||
var res: VersionedHash
|
var res: VersionedHash
|
||||||
|
|
|
@ -1168,7 +1168,7 @@ proc process_epoch*(
|
||||||
|
|
||||||
process_inactivity_updates(cfg, state, info) # [New in Altair]
|
process_inactivity_updates(cfg, state, info) # [New in Altair]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/beacon-chain.md#rewards-and-penalties
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/beacon-chain.md#rewards-and-penalties
|
||||||
process_rewards_and_penalties(cfg, state, info) # [Modified in Altair]
|
process_rewards_and_penalties(cfg, state, info) # [Modified in Altair]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/beacon-chain.md#registry-updates
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/beacon-chain.md#registry-updates
|
||||||
|
|
|
@ -1868,7 +1868,7 @@ proc handleValidatorDuties*(node: BeaconNode, lastSlot, slot: Slot) {.async.} =
|
||||||
|
|
||||||
updateValidatorMetrics(node) # the important stuff is done, update the vanity numbers
|
updateValidatorMetrics(node) # the important stuff is done, update the vanity numbers
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/validator.md#broadcast-aggregate
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/validator.md#broadcast-aggregate
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/validator.md#broadcast-sync-committee-contribution
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/validator.md#broadcast-sync-committee-contribution
|
||||||
# Wait 2 / 3 of the slot time to allow messages to propagate, then collect
|
# Wait 2 / 3 of the slot time to allow messages to propagate, then collect
|
||||||
# the result in aggregates
|
# the result in aggregates
|
||||||
|
|
|
@ -664,7 +664,7 @@ proc getAggregateAndProofSignature*(v: AttachedValidator,
|
||||||
fork, genesis_validators_root, aggregate_and_proof)
|
fork, genesis_validators_root, aggregate_and_proof)
|
||||||
await v.signData(request)
|
await v.signData(request)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/validator.md#prepare-sync-committee-message
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/validator.md#prepare-sync-committee-message
|
||||||
proc getSyncCommitteeMessage*(v: AttachedValidator,
|
proc getSyncCommitteeMessage*(v: AttachedValidator,
|
||||||
fork: Fork,
|
fork: Fork,
|
||||||
genesis_validators_root: Eth2Digest,
|
genesis_validators_root: Eth2Digest,
|
||||||
|
@ -695,7 +695,7 @@ proc getSyncCommitteeMessage*(v: AttachedValidator,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/validator.md#aggregation-selection
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/altair/validator.md#aggregation-selection
|
||||||
proc getSyncCommitteeSelectionProof*(v: AttachedValidator, fork: Fork,
|
proc getSyncCommitteeSelectionProof*(v: AttachedValidator, fork: Fork,
|
||||||
genesis_validators_root: Eth2Digest,
|
genesis_validators_root: Eth2Digest,
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
|
|
|
@ -6,7 +6,7 @@ This is a WIP document to explain the beacon block flows.
|
||||||
|
|
||||||
Important distinction:
|
Important distinction:
|
||||||
- We distinguish block `validation` which is defined in the P2P specs:
|
- We distinguish block `validation` which is defined in the P2P specs:
|
||||||
https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/p2p-interface.md#beacon_block.
|
https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_block.
|
||||||
A validated block can be forwarded on gossipsub.
|
A validated block can be forwarded on gossipsub.
|
||||||
- and we distinguish `verification` which is defined in consensus specs:
|
- and we distinguish `verification` which is defined in consensus specs:
|
||||||
https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/beacon-chain.md#block-processing
|
https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/beacon-chain.md#block-processing
|
||||||
|
|
|
@ -268,7 +268,7 @@ func makeAttestationData*(
|
||||||
"Computed epoch was " & $slot.epoch &
|
"Computed epoch was " & $slot.epoch &
|
||||||
" while the state current_epoch was " & $current_epoch
|
" while the state current_epoch was " & $current_epoch
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.3/specs/phase0/validator.md#attestation-data
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/validator.md#attestation-data
|
||||||
AttestationData(
|
AttestationData(
|
||||||
slot: slot,
|
slot: slot,
|
||||||
index: committee_index.uint64,
|
index: committee_index.uint64,
|
||||||
|
|
Loading…
Reference in New Issue