update 20 CL spec ref URLs (#3677)
This commit is contained in:
parent
48f9631ed1
commit
f929980bf3
|
@ -26,7 +26,7 @@ type
|
|||
## which blocks are valid - in particular, blocks are not valid if they
|
||||
## come from the future as seen from the local clock.
|
||||
##
|
||||
## https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#fork-choice
|
||||
## https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/fork-choice.md#fork-choice
|
||||
##
|
||||
# TODO consider NTP and network-adjusted timestamps as outlined here:
|
||||
# https://ethresear.ch/t/network-adjusted-timestamps/4187
|
||||
|
|
|
@ -6,10 +6,10 @@ Object in those pools have passed the "gossip validation" filter according
|
|||
to specs:
|
||||
- blocks: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#beacon_block
|
||||
- aggregate attestations: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
|
||||
- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
||||
- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
||||
- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#voluntary_exit
|
||||
- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#attester_slashing
|
||||
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#proposer_slashing
|
||||
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#proposer_slashing
|
||||
|
||||
After "gossip validation" the consensus objects can be rebroadcasted as they are optimistically good, however for internal processing further verification is needed.
|
||||
For blocks, this means verifying state transition and all contained cryptographic signatures (instead of just the proposer signature).
|
||||
|
|
|
@ -123,7 +123,7 @@ func link*(parent, child: BlockRef) =
|
|||
func get_ancestor*(blck: BlockRef, slot: Slot,
|
||||
maxDepth = 100'i64 * 365 * 24 * 60 * 60 div SECONDS_PER_SLOT.int):
|
||||
BlockRef =
|
||||
## https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#get_ancestor
|
||||
## https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/fork-choice.md#get_ancestor
|
||||
## Return the most recent block as of the time at `slot` that not more recent
|
||||
## than `blck` itself
|
||||
if isNil(blck): return nil
|
||||
|
|
|
@ -179,7 +179,7 @@ func init*(
|
|||
of BeaconStateFork.Phase0: false
|
||||
of BeaconStateFork.Altair: false
|
||||
of BeaconStateFork.Bellatrix:
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/beacon-chain.md#is_merge_transition_complete
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/bellatrix/beacon-chain.md#is_merge_transition_complete
|
||||
state.bellatrixData.data.latest_execution_payload_header !=
|
||||
ExecutionPayloadHeader()
|
||||
)
|
||||
|
|
|
@ -12,9 +12,9 @@ Gossip validation is different from consensus verification in particular for blo
|
|||
- Blocks: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#beacon_block
|
||||
- Attestations (aggregated): https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
|
||||
- Attestations (unaggregated): https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#attestation-subnets
|
||||
- Voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#voluntary_exit
|
||||
- Voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#voluntary_exit
|
||||
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#proposer_slashing
|
||||
- Attester slashing: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#attester_slashing
|
||||
- Attester slashing: https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#attester_slashing
|
||||
|
||||
There are multiple consumers of validated consensus objects:
|
||||
- a `ValidationResult.Accept` output triggers rebroadcasting in libp2p
|
||||
|
|
|
@ -93,7 +93,7 @@ func check_propagation_slot_range(
|
|||
let
|
||||
pastSlot = (wallTime - MAXIMUM_GOSSIP_CLOCK_DISPARITY).toSlot()
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#configuration
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#configuration
|
||||
# The spec value of ATTESTATION_PROPAGATION_SLOT_RANGE is 32, but it can
|
||||
# retransmit attestations on the cusp of being out of spec, and which by
|
||||
# the time they reach their destination might be out of spec.
|
||||
|
@ -764,7 +764,7 @@ proc validateAggregate*(
|
|||
|
||||
return ok((attesting_indices, sig))
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#attester_slashing
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#attester_slashing
|
||||
proc validateAttesterSlashing*(
|
||||
pool: ExitPool, attester_slashing: AttesterSlashing):
|
||||
Result[void, ValidationError] =
|
||||
|
@ -787,7 +787,7 @@ proc validateAttesterSlashing*(
|
|||
|
||||
ok()
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#proposer_slashing
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#proposer_slashing
|
||||
proc validateProposerSlashing*(
|
||||
pool: ExitPool, proposer_slashing: ProposerSlashing):
|
||||
Result[void, ValidationError] =
|
||||
|
|
|
@ -2476,7 +2476,7 @@ proc subscribeAttestationSubnets*(
|
|||
|
||||
proc unsubscribeAttestationSubnets*(
|
||||
node: Eth2Node, subnets: AttnetBits, forkDigest: ForkDigest) =
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#attestations-and-aggregation
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#attestations-and-aggregation
|
||||
# Nimbus won't score attestation subnets for now; we just rely on block and
|
||||
# aggregate which are more stable and reliable
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ const
|
|||
GENESIS_SLOT* = Slot(0)
|
||||
GENESIS_EPOCH* = Epoch(0) # compute_epoch_at_slot(GENESIS_SLOT)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#constant
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/fork-choice.md#constant
|
||||
INTERVALS_PER_SLOT* = 3
|
||||
|
||||
FAR_FUTURE_BEACON_TIME* = BeaconTime(ns_since_genesis: int64.high())
|
||||
|
|
|
@ -150,8 +150,8 @@ func get_whistleblower_reward*(validator_effective_balance: Gwei): Gwei =
|
|||
validator_effective_balance div WHISTLEBLOWER_REWARD_QUOTIENT
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/beacon-chain.md#slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/beacon-chain.md#modified-slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#modified-slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/altair/beacon-chain.md#modified-slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/bellatrix/beacon-chain.md#modified-slash_validator
|
||||
func get_proposer_reward(state: ForkyBeaconState, whistleblower_reward: Gwei): Gwei =
|
||||
when state is phase0.BeaconState:
|
||||
whistleblower_reward div PROPOSER_REWARD_QUOTIENT
|
||||
|
@ -161,8 +161,8 @@ func get_proposer_reward(state: ForkyBeaconState, whistleblower_reward: Gwei): G
|
|||
{.fatal: "invalid BeaconState type".}
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/beacon-chain.md#modified-slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#modified-slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/altair/beacon-chain.md#modified-slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/bellatrix/beacon-chain.md#modified-slash_validator
|
||||
proc slash_validator*(
|
||||
cfg: RuntimeConfig, state: var ForkyBeaconState,
|
||||
slashed_index: ValidatorIndex, cache: var StateCache):
|
||||
|
|
|
@ -82,7 +82,7 @@ const
|
|||
ZERO_HASH* = Eth2Digest()
|
||||
MAX_GRAFFITI_SIZE* = 32
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#configuration
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/p2p-interface.md#configuration
|
||||
MAXIMUM_GOSSIP_CLOCK_DISPARITY* = 500.millis
|
||||
|
||||
SLOTS_PER_ETH1_VOTING_PERIOD* =
|
||||
|
|
|
@ -137,7 +137,7 @@ func getDiscoveryForkID*(cfg: RuntimeConfig,
|
|||
next_fork_version: current_fork_version,
|
||||
next_fork_epoch: FAR_FUTURE_EPOCH)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/p2p-interface.md#transitioning-the-gossip
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/altair/p2p-interface.md#transitioning-the-gossip
|
||||
type GossipState* = set[BeaconStateFork]
|
||||
func getTargetGossipState*(
|
||||
epoch, ALTAIR_FORK_EPOCH, BELLATRIX_FORK_EPOCH: Epoch, isBehind: bool):
|
||||
|
|
|
@ -122,7 +122,7 @@ func clear_epoch_from_cache(cache: var StateCache, epoch: Epoch) =
|
|||
for slot in epoch.slots():
|
||||
cache.beacon_proposer_indices.del slot
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function
|
||||
proc advance_slot(
|
||||
cfg: RuntimeConfig,
|
||||
state: var ForkyBeaconState, previous_slot_state_root: Eth2Digest,
|
||||
|
|
|
@ -35,7 +35,7 @@ type
|
|||
UnconsumedInput* = object of CatchableError
|
||||
TestSizeError* = object of ValueError
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/tree/v1.1.6/tests/formats/rewards#rewards-tests
|
||||
# https://github.com/ethereum/consensus-specs/tree/v1.2.0-rc.1/tests/formats/rewards#rewards-tests
|
||||
Deltas* = object
|
||||
rewards*: List[uint64, Limit VALIDATOR_REGISTRY_LIMIT]
|
||||
penalties*: List[uint64, Limit VALIDATOR_REGISTRY_LIMIT]
|
||||
|
|
Loading…
Reference in New Issue