some consensus spec v1.4.0 spec URL updates (#6208)
This commit is contained in:
parent
bb2ca747bc
commit
867995acd1
|
@ -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] =
|
||||
|
|
|
@ -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] =
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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] =
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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)`
|
||||
|
|
|
@ -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."
|
||||
|
|
Loading…
Reference in New Issue