almost all remaining ethereum/{eth2.0-specs -> consensus-specs} (#3158)
This commit is contained in:
parent
f0f9735955
commit
4378f3f096
|
@ -216,7 +216,7 @@ func isAncestorOf*(a, b: BlockRef): bool =
|
|||
func get_ancestor*(blck: BlockRef, slot: Slot,
|
||||
maxDepth = 100'i64 * 365 * 24 * 60 * 60 div SECONDS_PER_SLOT.int):
|
||||
BlockRef =
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/fork-choice.md#get_ancestor
|
||||
## https://github.com/ethereum/consensus-specs/blob/v1.0.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
|
||||
doAssert not blck.isNil
|
||||
|
|
|
@ -83,7 +83,7 @@ func check_propagation_slot_range(
|
|||
let
|
||||
pastSlot = (wallTime - MAXIMUM_GOSSIP_CLOCK_DISPARITY).toSlot()
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#configuration
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.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.
|
||||
|
@ -171,7 +171,7 @@ template checkedReject(error: ValidationError): untyped =
|
|||
raiseAssert $error[1]
|
||||
err(error)
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#beacon_block
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#beacon_block
|
||||
proc validateBeaconBlock*(
|
||||
dag: ChainDAGRef, quarantine: QuarantineRef,
|
||||
signed_beacon_block: phase0.SignedBeaconBlock | altair.SignedBeaconBlock,
|
||||
|
@ -198,7 +198,7 @@ proc validateBeaconBlock*(
|
|||
# proposer for the slot, signed_beacon_block.message.slot.
|
||||
#
|
||||
# While this condition is similar to the proposer slashing condition at
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/validator.md#proposer-slashing
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/validator.md#proposer-slashing
|
||||
# it's not identical, and this check does not address slashing:
|
||||
#
|
||||
# (1) The beacon blocks must be conflicting, i.e. different, for the same
|
||||
|
@ -299,7 +299,7 @@ proc validateBeaconBlock*(
|
|||
|
||||
ok()
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
||||
proc validateAttestation*(
|
||||
pool: ref AttestationPool,
|
||||
batchCrypto: ref BatchCrypto,
|
||||
|
@ -460,7 +460,7 @@ proc validateAttestation*(
|
|||
|
||||
return ok((validator_index, sig))
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
|
||||
proc validateAggregate*(
|
||||
pool: ref AttestationPool,
|
||||
batchCrypto: ref BatchCrypto,
|
||||
|
@ -644,7 +644,7 @@ proc validateAggregate*(
|
|||
|
||||
return ok((attesting_indices, sig))
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#attester_slashing
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#attester_slashing
|
||||
proc validateAttesterSlashing*(
|
||||
pool: ExitPool, attester_slashing: AttesterSlashing):
|
||||
Result[void, ValidationError] =
|
||||
|
@ -667,7 +667,7 @@ proc validateAttesterSlashing*(
|
|||
|
||||
ok()
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#proposer_slashing
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#proposer_slashing
|
||||
proc validateProposerSlashing*(
|
||||
pool: ExitPool, proposer_slashing: ProposerSlashing):
|
||||
Result[void, ValidationError] =
|
||||
|
@ -690,7 +690,7 @@ proc validateProposerSlashing*(
|
|||
|
||||
ok()
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#voluntary_exit
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#voluntary_exit
|
||||
proc validateVoluntaryExit*(
|
||||
pool: ExitPool, signed_voluntary_exit: SignedVoluntaryExit):
|
||||
Result[void, ValidationError] =
|
||||
|
@ -720,7 +720,7 @@ proc validateVoluntaryExit*(
|
|||
|
||||
ok()
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.8/specs/altair/p2p-interface.md#sync_committee_subnet_id
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-alpha.8/specs/altair/p2p-interface.md#sync_committee_subnet_id
|
||||
proc validateSyncCommitteeMessage*(
|
||||
dag: ChainDAGRef,
|
||||
syncCommitteeMsgPool: SyncCommitteeMsgPool,
|
||||
|
@ -784,7 +784,7 @@ proc validateSyncCommitteeMessage*(
|
|||
|
||||
ok((positionsInSubcommittee, cookedSignature.get()))
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.1.5/specs/altair/p2p-interface.md#sync_committee_contribution_and_proof
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/p2p-interface.md#sync_committee_contribution_and_proof
|
||||
proc validateContribution*(
|
||||
dag: ChainDAGRef,
|
||||
syncCommitteeMsgPool: var SyncCommitteeMsgPool,
|
||||
|
|
|
@ -487,7 +487,7 @@ func verifyFinalization(node: BeaconNode, slot: Slot) =
|
|||
func subnetLog(v: BitArray): string =
|
||||
$toSeq(v.oneIndices())
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.1.2/specs/phase0/validator.md#phase-0-attestation-subnet-stability
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.2/specs/phase0/validator.md#phase-0-attestation-subnet-stability
|
||||
proc updateAttestationSubnetHandlers(node: BeaconNode, slot: Slot) =
|
||||
if node.gossipState == GossipState.Disconnected:
|
||||
# When disconnected, updateGossipState is responsible for all things
|
||||
|
@ -989,7 +989,7 @@ proc installRestHandlers(restServer: RestServerRef, node: BeaconNode) =
|
|||
restServer.router.installValidatorManagementHandlers(node)
|
||||
|
||||
proc installMessageValidators(node: BeaconNode) =
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#attestations-and-aggregation
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#attestations-and-aggregation
|
||||
# These validators stay around the whole time, regardless of which specific
|
||||
# subnets are subscribed to during any given epoch.
|
||||
func toValidationResult(res: ValidationRes): ValidationResult =
|
||||
|
|
|
@ -91,7 +91,7 @@ proc process_light_client_update*(store: var LightClientStore,
|
|||
not update.finality_header.isZeroMemory:
|
||||
# Apply update if (1) 2/3 quorum is reached and (2) we have a finality proof.
|
||||
# Note that (2) means that the current light client design needs finality.
|
||||
# It may be changed to re-organizable light client design. See the on-going issue eth2.0-specs#2182.
|
||||
# It may be changed to re-organizable light client design. See the on-going issue consensus-specs#2182.
|
||||
apply_light_client_update(store.snapshot, update)
|
||||
store.valid_updates.clear()
|
||||
elif current_slot > store.snapshot.header.slot + update_timeout:
|
||||
|
|
|
@ -132,7 +132,7 @@ func updateSlot*(tracker: var ActionTracker, wallSlot: Slot) =
|
|||
# One stability subnet per known validator
|
||||
static: doAssert RANDOM_SUBNETS_PER_VALIDATOR == 1
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v1.1.2/specs/phase0/validator.md#phase-0-attestation-subnet-stability
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.2/specs/phase0/validator.md#phase-0-attestation-subnet-stability
|
||||
let expectedSubnets =
|
||||
min(ATTESTATION_SUBNET_COUNT, tracker.knownValidators.len)
|
||||
|
||||
|
|
|
@ -276,14 +276,14 @@ proc runTest(path: string, fork: BeaconBlockFork) =
|
|||
# of BeaconBlockFork.Altair:
|
||||
# initialLoad(
|
||||
# path, db,
|
||||
# # The tests always use phase 0 block for anchor - https://github.com/ethereum/eth2.0-specs/pull/2323
|
||||
# # The tests always use phase 0 block for anchor - https://github.com/ethereum/consensus-specs/pull/2323
|
||||
# # TODO: support altair genesis state
|
||||
# altair.BeaconState, phase0.BeaconBlock
|
||||
# )
|
||||
# of BeaconBlockFork.Merge:
|
||||
# initialLoad(
|
||||
# path, db,
|
||||
# # The tests always use phase 0 block for anchor - https://github.com/ethereum/eth2.0-specs/pull/2323
|
||||
# # The tests always use phase 0 block for anchor - https://github.com/ethereum/consensus-specs/pull/2323
|
||||
# # TODO: support merge genesis state
|
||||
# merge.BeaconState, phase0.BeaconBlock
|
||||
# )
|
||||
|
|
Loading…
Reference in New Issue