mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-22 19:28:20 +00:00
spec URL updates (#3254)
This commit is contained in:
parent
a4667d1840
commit
0fd8bf7b56
@ -141,7 +141,7 @@ func init*(
|
||||
of BeaconStateFork.Phase0: false
|
||||
of BeaconStateFork.Altair: false
|
||||
of BeaconStateFork.Bellatrix:
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#is_merge_transition_complete
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/beacon-chain.md#is_merge_transition_complete
|
||||
state.data.mergeData.data.latest_execution_payload_header !=
|
||||
ExecutionPayloadHeader()
|
||||
)
|
||||
|
@ -186,7 +186,7 @@ template validateBeaconBlockBellatrix(
|
||||
altair.SignedBeaconBlock): untyped =
|
||||
discard
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/p2p-interface.md#beacon_block
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/p2p-interface.md#beacon_block
|
||||
template validateBeaconBlockBellatrix(
|
||||
signed_beacon_block: merge.SignedBeaconBlock): untyped =
|
||||
# If the execution is enabled for the block -- i.e.
|
||||
@ -212,7 +212,7 @@ template validateBeaconBlockBellatrix(
|
||||
of BeaconBlockFork.Altair:
|
||||
false
|
||||
of BeaconBlockFork.Bellatrix:
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#process_execution_payload
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/beacon-chain.md#process_execution_payload
|
||||
# shows how this gets folded into the state each block; checking this
|
||||
# is equivalent, without ever requiring state replay or any similarly
|
||||
# expensive computation.
|
||||
@ -231,7 +231,7 @@ template validateBeaconBlockBellatrix(
|
||||
return errReject("BeaconBlock: Mismatched execution payload timestamp")
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#beacon_block
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/p2p-interface.md#beacon_block
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/p2p-interface.md#beacon_block
|
||||
proc validateBeaconBlock*(
|
||||
dag: ChainDAGRef, quarantine: ref Quarantine,
|
||||
signed_beacon_block: phase0.SignedBeaconBlock | altair.SignedBeaconBlock |
|
||||
|
@ -121,7 +121,7 @@ func initiate_validator_exit*(cfg: RuntimeConfig, state: var ForkyBeaconState,
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/phase0/beacon-chain.md#slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/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.1.7/specs/merge/beacon-chain.md#modified-slash_validator
|
||||
proc slash_validator*(
|
||||
cfg: RuntimeConfig, state: var ForkyBeaconState,
|
||||
slashed_index: ValidatorIndex, cache: var StateCache) =
|
||||
@ -314,7 +314,7 @@ func get_initial_beacon_block*(state: altair.HashedBeaconState):
|
||||
altair.TrustedSignedBeaconBlock(
|
||||
message: message, root: hash_tree_root(message))
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#testing
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/beacon-chain.md#testing
|
||||
func get_initial_beacon_block*(state: bellatrix.HashedBeaconState):
|
||||
bellatrix.TrustedSignedBeaconBlock =
|
||||
# The genesis block is implicitly trusted
|
||||
@ -840,7 +840,7 @@ proc upgrade_to_altair*(cfg: RuntimeConfig, pre: phase0.BeaconState): ref altair
|
||||
|
||||
post
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/fork.md#upgrading-the-state
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/fork.md#upgrading-the-state
|
||||
func upgrade_to_merge*(cfg: RuntimeConfig, pre: altair.BeaconState):
|
||||
ref bellatrix.BeaconState =
|
||||
let epoch = get_current_epoch(pre)
|
||||
|
@ -64,7 +64,7 @@ const
|
||||
INACTIVITY_SCORE_BIAS* = 4
|
||||
INACTIVITY_SCORE_RECOVERY_RATE* = 16
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/altair/sync-protocol.md#misc
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/altair/sync-protocol.md#misc
|
||||
# MIN_SYNC_COMMITTEE_PARTICIPANTS defined in presets
|
||||
UPDATE_TIMEOUT* = SLOTS_PER_EPOCH * EPOCHS_PER_SYNC_COMMITTEE_PERIOD
|
||||
|
||||
|
@ -33,7 +33,7 @@ type
|
||||
|
||||
PayloadID* = array[8, byte]
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#executionpayload
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/beacon-chain.md#executionpayload
|
||||
ExecutionPayload* = object
|
||||
parent_hash*: Eth2Digest
|
||||
fee_recipient*: ExecutionAddress # 'beneficiary' in the yellow paper
|
||||
@ -52,7 +52,7 @@ type
|
||||
block_hash*: Eth2Digest # Hash of execution block
|
||||
transactions*: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD]
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#executionpayloadheader
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/beacon-chain.md#executionpayloadheader
|
||||
ExecutionPayloadHeader* = object
|
||||
parent_hash*: Eth2Digest
|
||||
fee_recipient*: ExecutionAddress
|
||||
@ -80,7 +80,7 @@ type
|
||||
parent_hash*: Eth2Digest
|
||||
total_difficulty*: Eth2Digest # uint256
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#beaconstate
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/beacon-chain.md#beaconstate
|
||||
BeaconState* = object
|
||||
# Versioning
|
||||
genesis_time*: uint64
|
||||
@ -206,7 +206,7 @@ type
|
||||
state_root*: Eth2Digest ##\
|
||||
body*: TrustedBeaconBlockBody
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#beaconblockbody
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/beacon-chain.md#beaconblockbody
|
||||
BeaconBlockBody* = object
|
||||
randao_reveal*: ValidatorSig
|
||||
eth1_data*: Eth1Data ##\
|
||||
|
@ -150,7 +150,7 @@ func process_attestations*(
|
||||
if v.flags.contains RewardFlags.isPreviousEpochHeadAttester:
|
||||
info.balances.previous_epoch_head_attesters_raw += validator_balance
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#helpers
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.1/specs/phase0/beacon-chain.md#helpers
|
||||
# get_eligible_validator_indices
|
||||
func is_eligible_validator*(validator: RewardStatus): bool =
|
||||
validator.flags.contains(RewardFlags.isActiveInPreviousEpoch) or
|
||||
@ -491,7 +491,7 @@ func get_attestation_component_delta(is_unslashed_attester: bool,
|
||||
else:
|
||||
RewardDelta(penalties: base_reward)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#components-of-attestation-deltas
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.1/specs/phase0/beacon-chain.md#components-of-attestation-deltas
|
||||
func get_source_delta*(validator: RewardStatus,
|
||||
base_reward: uint64,
|
||||
balances: TotalBalances,
|
||||
@ -1061,7 +1061,7 @@ proc process_epoch*(
|
||||
|
||||
process_inactivity_updates(cfg, state, info) # [New in Altair]
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#rewards-and-penalties-1
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.1/specs/phase0/beacon-chain.md#rewards-and-penalties-1
|
||||
process_rewards_and_penalties(cfg, state, info)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/phase0/beacon-chain.md#registry-updates
|
||||
|
@ -334,7 +334,7 @@ proc signSyncCommitteeMessage*(v: AttachedValidator,
|
||||
)
|
||||
)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.2/specs/altair/validator.md#aggregation-selection
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/altair/validator.md#aggregation-selection
|
||||
proc getSyncCommitteeSelectionProof*(v: AttachedValidator,
|
||||
fork: Fork,
|
||||
genesis_validators_root: Eth2Digest,
|
||||
@ -355,7 +355,7 @@ proc getSyncCommitteeSelectionProof*(v: AttachedValidator,
|
||||
else:
|
||||
SignatureResult.ok(res.get().toValidatorSig())
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#signature
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.1/specs/altair/validator.md#signature
|
||||
proc sign*(v: AttachedValidator, msg: ref SignedContributionAndProof,
|
||||
fork: Fork, genesis_validators_root: Eth2Digest
|
||||
): Future[SignatureResult] {.async.} =
|
||||
|
Loading…
x
Reference in New Issue
Block a user