consensus spec ref URL updates to v1.3.0-rc.1 (#4534)
This commit is contained in:
parent
6a64048e80
commit
8c2e01da24
|
@ -148,10 +148,10 @@ const
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/validator.md#broadcast-sync-committee-contribution
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/validator.md#broadcast-sync-committee-contribution
|
||||||
syncContributionSlotOffset* = TimeDiff(nanoseconds:
|
syncContributionSlotOffset* = 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.3.0-rc.0/specs/altair/light-client/p2p-interface.md#sync-committee
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/p2p-interface.md#sync-committee
|
||||||
lightClientFinalityUpdateSlotOffset* = TimeDiff(nanoseconds:
|
lightClientFinalityUpdateSlotOffset* = 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.3.0-rc.0/specs/altair/light-client/p2p-interface.md#sync-committee
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/p2p-interface.md#sync-committee
|
||||||
lightClientOptimisticUpdateSlotOffset* = TimeDiff(nanoseconds:
|
lightClientOptimisticUpdateSlotOffset* = TimeDiff(nanoseconds:
|
||||||
NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT)
|
NANOSECONDS_PER_SLOT.int64 div INTERVALS_PER_SLOT)
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ type
|
||||||
beacon*: BeaconBlockHeader
|
beacon*: BeaconBlockHeader
|
||||||
## Beacon block header
|
## Beacon block header
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/sync-protocol.md#lightclientbootstrap
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/sync-protocol.md#lightclientbootstrap
|
||||||
LightClientBootstrap* = object
|
LightClientBootstrap* = object
|
||||||
header*: LightClientHeader
|
header*: LightClientHeader
|
||||||
## Header matching the requested beacon block root
|
## Header matching the requested beacon block root
|
||||||
|
@ -189,7 +189,7 @@ type
|
||||||
signature_slot*: Slot
|
signature_slot*: Slot
|
||||||
## Slot at which the aggregate signature was created (untrusted)
|
## Slot at which the aggregate signature was created (untrusted)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate
|
||||||
LightClientFinalityUpdate* = object
|
LightClientFinalityUpdate* = object
|
||||||
# Header attested to by the sync committee
|
# Header attested to by the sync committee
|
||||||
attested_header*: LightClientHeader
|
attested_header*: LightClientHeader
|
||||||
|
@ -203,7 +203,7 @@ type
|
||||||
# Slot at which the aggregate signature was created (untrusted)
|
# Slot at which the aggregate signature was created (untrusted)
|
||||||
signature_slot*: Slot
|
signature_slot*: Slot
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/sync-protocol.md#lightclientoptimisticupdate
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/sync-protocol.md#lightclientoptimisticupdate
|
||||||
LightClientOptimisticUpdate* = object
|
LightClientOptimisticUpdate* = object
|
||||||
# Header attested to by the sync committee
|
# Header attested to by the sync committee
|
||||||
attested_header*: LightClientHeader
|
attested_header*: LightClientHeader
|
||||||
|
|
|
@ -38,7 +38,7 @@ type
|
||||||
SignedBLSToExecutionChangeList* =
|
SignedBLSToExecutionChangeList* =
|
||||||
List[SignedBLSToExecutionChange, Limit MAX_BLS_TO_EXECUTION_CHANGES]
|
List[SignedBLSToExecutionChange, Limit MAX_BLS_TO_EXECUTION_CHANGES]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/capella/beacon-chain.md#withdrawal
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/capella/beacon-chain.md#withdrawal
|
||||||
Withdrawal* = object
|
Withdrawal* = object
|
||||||
index*: WithdrawalIndex
|
index*: WithdrawalIndex
|
||||||
validator_index*: uint64
|
validator_index*: uint64
|
||||||
|
@ -51,7 +51,7 @@ type
|
||||||
from_bls_pubkey*: ValidatorPubKey
|
from_bls_pubkey*: ValidatorPubKey
|
||||||
to_execution_address*: ExecutionAddress
|
to_execution_address*: ExecutionAddress
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/capella/beacon-chain.md#signedblstoexecutionchange
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/capella/beacon-chain.md#signedblstoexecutionchange
|
||||||
SignedBLSToExecutionChange* = object
|
SignedBLSToExecutionChange* = object
|
||||||
message*: BLSToExecutionChange
|
message*: BLSToExecutionChange
|
||||||
signature*: ValidatorSig
|
signature*: ValidatorSig
|
||||||
|
@ -63,7 +63,7 @@ type
|
||||||
block_summary_root*: Eth2Digest
|
block_summary_root*: Eth2Digest
|
||||||
state_summary_root*: Eth2Digest
|
state_summary_root*: Eth2Digest
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/capella/beacon-chain.md#executionpayload
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/capella/beacon-chain.md#executionpayload
|
||||||
ExecutionPayload* = object
|
ExecutionPayload* = object
|
||||||
parent_hash*: Eth2Digest
|
parent_hash*: Eth2Digest
|
||||||
fee_recipient*: ExecutionAddress # 'beneficiary' in the yellow paper
|
fee_recipient*: ExecutionAddress # 'beneficiary' in the yellow paper
|
||||||
|
@ -340,7 +340,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/capella/beacon-chain.md#beaconblockbody
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/capella/beacon-chain.md#beaconblockbody
|
||||||
BeaconBlockBody* = object
|
BeaconBlockBody* = object
|
||||||
randao_reveal*: ValidatorSig
|
randao_reveal*: ValidatorSig
|
||||||
eth1_data*: Eth1Data
|
eth1_data*: Eth1Data
|
||||||
|
|
|
@ -211,7 +211,7 @@ template is_sync_committee_update*(update: SomeForkyLightClientUpdate): bool =
|
||||||
else:
|
else:
|
||||||
false
|
false
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/sync-protocol.md#is_finality_update
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/sync-protocol.md#is_finality_update
|
||||||
template is_finality_update*(update: SomeForkyLightClientUpdate): bool =
|
template is_finality_update*(update: SomeForkyLightClientUpdate): bool =
|
||||||
when update is SomeForkyLightClientUpdateWithFinality:
|
when update is SomeForkyLightClientUpdateWithFinality:
|
||||||
update.finality_branch != default(typeof(update.finality_branch))
|
update.finality_branch != default(typeof(update.finality_branch))
|
||||||
|
@ -325,7 +325,7 @@ func contextEpoch*(bootstrap: ForkyLightClientBootstrap): Epoch =
|
||||||
bootstrap.header.beacon.slot.epoch
|
bootstrap.header.beacon.slot.epoch
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/p2p-interface.md#lightclientupdatesbyrange
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate
|
||||||
func contextEpoch*(update: SomeForkyLightClientUpdate): Epoch =
|
func contextEpoch*(update: SomeForkyLightClientUpdate): Epoch =
|
||||||
update.attested_header.beacon.slot.epoch
|
update.attested_header.beacon.slot.epoch
|
||||||
|
|
|
@ -68,7 +68,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-rc.0/specs/eip4844/p2p-interface.md#topics-and-messages
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/p2p-interface.md#topics-and-messages
|
||||||
func getBeaconBlockAndBlobsSidecarTopic*(forkDigest: ForkDigest): string =
|
func getBeaconBlockAndBlobsSidecarTopic*(forkDigest: ForkDigest): string =
|
||||||
eth2Prefix(forkDigest) & topicBeaconBlockAndBlobsSidecarTopicSuffix
|
eth2Prefix(forkDigest) & topicBeaconBlockAndBlobsSidecarTopicSuffix
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Mainnet preset - Altair
|
# Mainnet preset - Altair
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/presets/mainnet/altair.yaml
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/presets/mainnet/altair.yaml
|
||||||
const
|
const
|
||||||
# Updated penalty values
|
# Updated penalty values
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Mainnet preset - EIP-4844
|
# Mainnet preset - EIP-4844
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/presets/mainnet/eip4844.yaml
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/presets/mainnet/eip4844.yaml
|
||||||
const
|
const
|
||||||
# `uint64(4096)`
|
# `uint64(4096)`
|
||||||
FIELD_ELEMENTS_PER_BLOB*: uint64 = 4096
|
FIELD_ELEMENTS_PER_BLOB*: uint64 = 4096
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Mainnet preset - Phase0
|
# Mainnet preset - Phase0
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/presets/mainnet/phase0.yaml
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/presets/mainnet/phase0.yaml
|
||||||
|
|
||||||
const
|
const
|
||||||
#
|
#
|
||||||
|
|
|
@ -764,7 +764,7 @@ func verify_kzg_commitments_against_transactions*(
|
||||||
|
|
||||||
all_versioned_hashes == mapIt(kzg_commitments, it.kzg_commitment_to_versioned_hash)
|
all_versioned_hashes == mapIt(kzg_commitments, it.kzg_commitment_to_versioned_hash)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/eip4844/beacon-chain.md#blob-kzg-commitments
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/beacon-chain.md#blob-kzg-commitments
|
||||||
func process_blob_kzg_commitments(
|
func process_blob_kzg_commitments(
|
||||||
state: var eip4844.BeaconState,
|
state: var eip4844.BeaconState,
|
||||||
body: eip4844.BeaconBlockBody | eip4844.TrustedBeaconBlockBody |
|
body: eip4844.BeaconBlockBody | eip4844.TrustedBeaconBlockBody |
|
||||||
|
|
|
@ -1055,7 +1055,7 @@ func process_inactivity_updates*(
|
||||||
if pre_inactivity_score != inactivity_score:
|
if pre_inactivity_score != inactivity_score:
|
||||||
state.inactivity_scores[index] = inactivity_score
|
state.inactivity_scores[index] = inactivity_score
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/capella/beacon-chain.md#historical-summaries-updates
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/capella/beacon-chain.md#historical-summaries-updates
|
||||||
func process_historical_summaries_update*(
|
func process_historical_summaries_update*(
|
||||||
state: var (capella.BeaconState | eip4844.BeaconState)):
|
state: var (capella.BeaconState | eip4844.BeaconState)):
|
||||||
Result[void, cstring] =
|
Result[void, cstring] =
|
||||||
|
|
|
@ -112,7 +112,7 @@ proc isGossipSupported*(
|
||||||
else:
|
else:
|
||||||
period <= finalizedPeriod
|
period <= finalizedPeriod
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/p2p-interface.md#getlightclientbootstrap
|
||||||
proc doRequest(
|
proc doRequest(
|
||||||
e: typedesc[Bootstrap],
|
e: typedesc[Bootstrap],
|
||||||
peer: Peer,
|
peer: Peer,
|
||||||
|
@ -178,7 +178,7 @@ proc doRequest(
|
||||||
raises: [Defect, IOError].} =
|
raises: [Defect, IOError].} =
|
||||||
peer.lightClientFinalityUpdate()
|
peer.lightClientFinalityUpdate()
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate
|
||||||
proc doRequest(
|
proc doRequest(
|
||||||
e: typedesc[OptimisticUpdate],
|
e: typedesc[OptimisticUpdate],
|
||||||
peer: Peer
|
peer: Peer
|
||||||
|
|
|
@ -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.1.10/specs/phase0/p2p-interface.md#beacon_block.
|
https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/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.3.0-rc.1/specs/phase0/beacon-chain.md#block-processing
|
https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/phase0/beacon-chain.md#block-processing
|
||||||
|
|
Loading…
Reference in New Issue