mass update from beta.3 spec refs to beta.4 spec refs (#2862)
This commit is contained in:
parent
5ea9e0baf3
commit
0ad7216bc4
|
@ -69,7 +69,7 @@ type
|
|||
current_justified_checkpoint*: Checkpoint
|
||||
finalized_checkpoint*: Checkpoint
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#beaconstate
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#beaconstate
|
||||
# Memory-representation-equivalent to an Altair BeaconState for in-place SSZ
|
||||
# reading and writing
|
||||
AltairBeaconStateNoImmutableValidators* = object
|
||||
|
|
|
@ -2014,7 +2014,7 @@ proc updateStabilitySubnetMetadata*(
|
|||
|
||||
proc updateSyncnetsMetadata*(
|
||||
node: Eth2Node, syncnets: BitArray[altair.SYNC_COMMITTEE_SUBNET_COUNT]) =
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#sync-committee-subnet-stability
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#sync-committee-subnet-stability
|
||||
node.metadata.seq_number += 1
|
||||
node.metadata.syncnets = syncnets
|
||||
|
||||
|
@ -2058,7 +2058,7 @@ proc getWallEpoch(node: Eth2Node): Epoch =
|
|||
proc broadcastAttestation*(node: Eth2Node, subnet_id: SubnetId,
|
||||
attestation: Attestation) =
|
||||
# Regardless of the contents of the attestation,
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/p2p-interface.md#transitioning-the-gossip
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/p2p-interface.md#transitioning-the-gossip
|
||||
# implies that pre-fork, messages using post-fork digests might be
|
||||
# ignored, whilst post-fork, there is effectively a seen_ttl-based
|
||||
# timer unsubscription point that means no new pre-fork-forkdigest
|
||||
|
|
|
@ -65,7 +65,7 @@ func decrease_balance*(
|
|||
decrease_balance(state.balances[index], delta)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#deposits
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#modified-process_deposit
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#modified-process_deposit
|
||||
func get_validator_from_deposit*(deposit: DepositData):
|
||||
Validator =
|
||||
let
|
||||
|
@ -140,7 +140,7 @@ func initiate_validator_exit*(cfg: RuntimeConfig, state: var SomeBeaconState,
|
|||
validator.exit_epoch + cfg.MIN_VALIDATOR_WITHDRAWABILITY_DELAY
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#modified-slash_validator
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#modified-slash_validator
|
||||
proc slash_validator*(
|
||||
cfg: RuntimeConfig, state: var SomeBeaconState,
|
||||
slashed_index: ValidatorIndex, cache: var StateCache) =
|
||||
|
@ -551,7 +551,7 @@ func check_attestation_index(
|
|||
|
||||
ok()
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#get_attestation_participation_flag_indices
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#get_attestation_participation_flag_indices
|
||||
func get_attestation_participation_flag_indices(state: altair.BeaconState,
|
||||
data: AttestationData,
|
||||
inclusion_delay: uint64): seq[int] =
|
||||
|
@ -596,13 +596,13 @@ func get_total_active_balance*(state: SomeBeaconState, cache: var StateCache): G
|
|||
get_total_balance(
|
||||
state, cache.get_shuffled_active_validator_indices(state, epoch))
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#get_base_reward_per_increment
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#get_base_reward_per_increment
|
||||
func get_base_reward_per_increment*(
|
||||
state: altair.BeaconState, cache: var StateCache): Gwei =
|
||||
EFFECTIVE_BALANCE_INCREMENT * BASE_REWARD_FACTOR div
|
||||
integer_squareroot(get_total_active_balance(state, cache))
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#get_base_reward
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#get_base_reward
|
||||
func get_base_reward(
|
||||
state: altair.BeaconState, index: ValidatorIndex,
|
||||
base_reward_per_increment: Gwei): Gwei =
|
||||
|
@ -719,7 +719,7 @@ proc process_attestation*(
|
|||
|
||||
ok()
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#get_next_sync_committee_indices
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#get_next_sync_committee_indices
|
||||
func get_next_sync_committee_indices(state: altair.BeaconState):
|
||||
seq[ValidatorIndex] =
|
||||
## Return the sequence of sync committee indices (which may include
|
||||
|
|
|
@ -37,7 +37,7 @@ import ./base, ./phase0
|
|||
export base
|
||||
|
||||
const
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#incentivization-weights
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#incentivization-weights
|
||||
TIMELY_SOURCE_WEIGHT* = 14
|
||||
TIMELY_TARGET_WEIGHT* = 26
|
||||
TIMELY_HEAD_WEIGHT* = 14
|
||||
|
@ -48,7 +48,7 @@ const
|
|||
PARTICIPATION_FLAG_WEIGHTS* =
|
||||
[TIMELY_SOURCE_WEIGHT, TIMELY_TARGET_WEIGHT, TIMELY_HEAD_WEIGHT]
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#misc
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#misc
|
||||
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE* = 16
|
||||
SYNC_COMMITTEE_SUBNET_COUNT* = 4
|
||||
|
||||
|
@ -61,7 +61,7 @@ const
|
|||
TIMELY_TARGET_FLAG_INDEX* = 1
|
||||
TIMELY_HEAD_FLAG_INDEX* = 2
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#inactivity-penalties
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#inactivity-penalties
|
||||
INACTIVITY_SCORE_BIAS* = 4
|
||||
INACTIVITY_SCORE_RECOVERY_RATE* = 16
|
||||
|
||||
|
@ -75,20 +75,20 @@ static: doAssert TIMELY_SOURCE_WEIGHT + TIMELY_TARGET_WEIGHT +
|
|||
type
|
||||
### New types
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#custom-types
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#custom-types
|
||||
ParticipationFlags* = uint8
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#syncaggregate
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#syncaggregate
|
||||
SyncAggregate* = object
|
||||
sync_committee_bits*: BitArray[SYNC_COMMITTEE_SIZE]
|
||||
sync_committee_signature*: ValidatorSig
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#synccommittee
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#synccommittee
|
||||
SyncCommittee* = object
|
||||
pubkeys*: HashArray[Limit SYNC_COMMITTEE_SIZE, ValidatorPubKey]
|
||||
aggregate_pubkey*: ValidatorPubKey
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#synccommitteemessage
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#synccommitteemessage
|
||||
SyncCommitteeMessage* = object
|
||||
slot*: Slot ##\
|
||||
## Slot to which this contribution pertains
|
||||
|
@ -102,7 +102,7 @@ type
|
|||
signature*: ValidatorSig ##\
|
||||
## Signature by the validator over the block root of `slot`
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#synccommitteecontribution
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#synccommitteecontribution
|
||||
SyncCommitteeAggregationBits* =
|
||||
BitArray[SYNC_SUBCOMMITTEE_SIZE]
|
||||
|
||||
|
@ -124,25 +124,25 @@ type
|
|||
signature*: ValidatorSig ##\
|
||||
## Signature by the validator(s) over the block root of `slot`
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#contributionandproof
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#contributionandproof
|
||||
ContributionAndProof* = object
|
||||
aggregator_index*: uint64
|
||||
contribution*: SyncCommitteeContribution
|
||||
selection_proof*: ValidatorSig
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#signedcontributionandproof
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#signedcontributionandproof
|
||||
SignedContributionAndProof* = object
|
||||
message*: ContributionAndProof
|
||||
signature*: ValidatorSig
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#syncaggregatorselectiondata
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#syncaggregatorselectiondata
|
||||
SyncAggregatorSelectionData* = object
|
||||
slot*: Slot
|
||||
subcommittee_index*: uint64
|
||||
|
||||
### Modified/overloaded
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/sync-protocol.md#lightclientsnapshot
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/sync-protocol.md#lightclientsnapshot
|
||||
LightClientSnapshot* = object
|
||||
header*: BeaconBlockHeader ##\
|
||||
## Beacon block header
|
||||
|
@ -152,7 +152,7 @@ type
|
|||
|
||||
next_sync_committee*: SyncCommittee
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/sync-protocol.md#lightclientupdate
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/sync-protocol.md#lightclientupdate
|
||||
LightClientUpdate* = object
|
||||
header*: BeaconBlockHeader ##\
|
||||
## Update beacon block header
|
||||
|
@ -174,7 +174,7 @@ type
|
|||
fork_version*: Version ##\
|
||||
## Fork version for the aggregate signature
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#beaconstate
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#beaconstate
|
||||
BeaconState* = object
|
||||
# Versioning
|
||||
genesis_time*: uint64
|
||||
|
@ -310,7 +310,7 @@ type
|
|||
state_root*: Eth2Digest ##\
|
||||
body*: TrustedBeaconBlockBody
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#beaconblockbody
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#beaconblockbody
|
||||
BeaconBlockBody* = object
|
||||
randao_reveal*: ValidatorSig
|
||||
eth1_data*: Eth1Data ##\
|
||||
|
|
|
@ -126,7 +126,7 @@ type
|
|||
DOMAIN_SELECTION_PROOF = 5
|
||||
DOMAIN_AGGREGATE_AND_PROOF = 6
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#domain-types
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#domain-types
|
||||
DOMAIN_SYNC_COMMITTEE = 7
|
||||
DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF = 8
|
||||
DOMAIN_CONTRIBUTION_AND_PROOF = 9
|
||||
|
|
|
@ -204,12 +204,12 @@ func get_seed*(state: SomeBeaconState, epoch: Epoch, domain_type: DomainType):
|
|||
epoch + EPOCHS_PER_HISTORICAL_VECTOR - MIN_SEED_LOOKAHEAD - 1).data
|
||||
eth2digest(seed_input)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#add_flag
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#add_flag
|
||||
func add_flag*(flags: ParticipationFlags, flag_index: int): ParticipationFlags =
|
||||
let flag = ParticipationFlags(1'u8 shl flag_index)
|
||||
flags or flag
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#has_flag
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#has_flag
|
||||
func has_flag*(flags: ParticipationFlags, flag_index: int): bool =
|
||||
let flag = ParticipationFlags(1'u8 shl flag_index)
|
||||
(flags and flag) == flag
|
||||
|
|
|
@ -85,7 +85,7 @@ func getSyncCommitteeTopic*(forkDigest: ForkDigest,
|
|||
## For subscribing and unsubscribing to/from a subnet.
|
||||
eth2Prefix(forkDigest) & "sync_committee_" & $(committeeIdx.asUInt8) & "/ssz"
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/p2p-interface.md#topics-and-messages
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/p2p-interface.md#topics-and-messages
|
||||
func getSyncCommitteeContributionAndProofTopic*(forkDigest: ForkDigest): string =
|
||||
## For subscribing and unsubscribing to/from a subnet.
|
||||
eth2Prefix(forkDigest) & "sync_committee_contribution_and_proof" & "/ssz"
|
||||
|
|
|
@ -256,7 +256,7 @@ proc verify_sync_committee_message_signature*(
|
|||
|
||||
blsVerify(pubkey, signing_root.data, signature)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#aggregation-selection
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#aggregation-selection
|
||||
proc is_sync_committee_aggregator*(signature: ValidatorSig): bool =
|
||||
let
|
||||
signatureDigest = eth2digest(signature.blob)
|
||||
|
|
|
@ -502,7 +502,7 @@ proc process_block*(
|
|||
# The transition-triggering block creates, not acts on, an Altair state
|
||||
err("process_block: Altair state with Phase 0 block")
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#block-processing
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#block-processing
|
||||
# TODO workaround for https://github.com/nim-lang/Nim/issues/18095
|
||||
# copy of datatypes/altair.nim
|
||||
type SomeAltairBlock =
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
# State transition - epoch processing, as described in
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.2/specs/phase0/beacon-chain.md#epoch-processing and
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#epoch-processing
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#epoch-processing
|
||||
#
|
||||
# The entry point is `process_epoch`, which is at the bottom of this file.
|
||||
#
|
||||
|
@ -165,7 +165,7 @@ type
|
|||
current_epoch_TIMELY_TARGET: Gwei
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.2/specs/altair/beacon-chain.md#get_unslashed_participating_indices
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/phase0/beacon-chain.md#get_total_balance
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/phase0/beacon-chain.md#get_total_balance
|
||||
func get_unslashed_participating_balances*(state: altair.BeaconState):
|
||||
UnslashedParticipatingBalances =
|
||||
let
|
||||
|
@ -317,7 +317,7 @@ proc process_justification_and_finalization*(state: var phase0.BeaconState,
|
|||
current_epoch = current_epoch,
|
||||
checkpoint = shortLog(state.finalized_checkpoint)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#justification-and-finalization
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#justification-and-finalization
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-alpha.7/specs/phase0/beacon-chain.md#justification-and-finalization
|
||||
# TODO merge these things -- effectively, the phase0 process_justification_and_finalization is mostly a stub in this world
|
||||
proc weigh_justification_and_finalization(state: var altair.BeaconState,
|
||||
|
@ -598,12 +598,12 @@ func get_attestation_deltas(state: phase0.BeaconState, rewards: var RewardInfo)
|
|||
rewards.statuses[proposer_index].delta.add(
|
||||
proposer_delta.get()[1])
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#get_base_reward_per_increment
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#get_base_reward_per_increment
|
||||
func get_base_reward_per_increment(
|
||||
state: altair.BeaconState, total_active_balance_sqrt: uint64): Gwei =
|
||||
EFFECTIVE_BALANCE_INCREMENT * BASE_REWARD_FACTOR div total_active_balance_sqrt
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#get_base_reward
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#get_base_reward
|
||||
func get_base_reward(
|
||||
state: altair.BeaconState, index: ValidatorIndex,
|
||||
total_active_balance_sqrt: uint64): Gwei =
|
||||
|
@ -653,7 +653,7 @@ iterator get_flag_index_deltas(
|
|||
else:
|
||||
(vidx, 0.Gwei, 0.Gwei)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#modified-get_inactivity_penalty_deltas
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#modified-get_inactivity_penalty_deltas
|
||||
iterator get_inactivity_penalty_deltas(cfg: RuntimeConfig, state: altair.BeaconState):
|
||||
(ValidatorIndex, Gwei) =
|
||||
## Return the inactivity penalty deltas by considering timely target
|
||||
|
@ -678,7 +678,7 @@ iterator get_inactivity_penalty_deltas(cfg: RuntimeConfig, state: altair.BeaconS
|
|||
state.inactivity_scores[index]
|
||||
yield (vidx, Gwei(penalty_numerator div penalty_denominator))
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#rewards-and-penalties
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#rewards-and-penalties
|
||||
func process_rewards_and_penalties(
|
||||
state: var phase0.BeaconState, rewards: var RewardInfo) {.nbench.} =
|
||||
# No rewards are applied at the end of `GENESIS_EPOCH` because rewards are
|
||||
|
@ -701,7 +701,7 @@ func process_rewards_and_penalties(
|
|||
decrease_balance(balance, v.delta.penalties)
|
||||
state.balances.asSeq()[idx] = balance
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#rewards-and-penalties
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#rewards-and-penalties
|
||||
func process_rewards_and_penalties(
|
||||
cfg: RuntimeConfig, state: var altair.BeaconState,
|
||||
total_active_balance: Gwei,
|
||||
|
@ -740,7 +740,7 @@ func process_rewards_and_penalties(
|
|||
state.balances.asSeq()[index] = balance
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#slashings
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#slashings
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#slashings
|
||||
func process_slashings*(state: var SomeBeaconState, total_balance: Gwei) {.nbench.} =
|
||||
let
|
||||
epoch = get_current_epoch(state)
|
||||
|
@ -847,7 +847,7 @@ func process_participation_flag_updates*(state: var altair.BeaconState) =
|
|||
|
||||
state.current_epoch_participation.resetCache()
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/beacon-chain.md#sync-committee-updates
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/beacon-chain.md#sync-committee-updates
|
||||
proc process_sync_committee_updates*(state: var altair.BeaconState) =
|
||||
let next_epoch = get_current_epoch(state) + 1
|
||||
if next_epoch mod EPOCHS_PER_SYNC_COMMITTEE_PERIOD == 0:
|
||||
|
|
|
@ -189,7 +189,7 @@ proc getSyncCommitteeSelectionProof*(
|
|||
else:
|
||||
await signWithRemoteValidator(v, signing_root)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/altair/validator.md#signature
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/altair/validator.md#signature
|
||||
proc sign*(
|
||||
v: AttachedValidator,
|
||||
msg: ref SignedContributionAndProof,
|
||||
|
|
|
@ -36,7 +36,7 @@ type
|
|||
# Some have a signing_root field
|
||||
signing_root {.defaultVal: "".}: string
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/specs/phase0/validator.md#eth1block
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.4/specs/phase0/validator.md#eth1block
|
||||
Eth1Block = object
|
||||
timestamp: uint64
|
||||
deposit_root: Eth2Digest
|
||||
|
|
Loading…
Reference in New Issue