mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-10 14:26:26 +00:00
update a dozen unchanged spec refs to v0.12.1
This commit is contained in:
parent
00537b391c
commit
ec85a8bdbf
@ -162,7 +162,7 @@ type
|
||||
|
||||
CommitteeValidatorsBits* = BitList[MAX_VALIDATORS_PER_COMMITTEE]
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/specs/phase0/beacon-chain.md#attestation
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/beacon-chain.md#attestation
|
||||
Attestation* = object
|
||||
aggregation_bits*: CommitteeValidatorsBits
|
||||
data*: AttestationData
|
||||
@ -388,7 +388,7 @@ type
|
||||
message*: BeaconBlockHeader
|
||||
signature*: ValidatorSig
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.2/specs/phase0/validator.md#aggregateandproof
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/validator.md#aggregateandproof
|
||||
AggregateAndProof* = object
|
||||
aggregator_index*: uint64
|
||||
aggregate*: Attestation
|
||||
|
@ -43,7 +43,7 @@ const
|
||||
|
||||
# Gwei values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/configs/minimal.yaml#L58
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/configs/minimal.yaml#L58
|
||||
|
||||
# Unchanged
|
||||
MIN_DEPOSIT_AMOUNT* = 2'u64^0 * 10'u64^9
|
||||
@ -53,14 +53,14 @@ const
|
||||
|
||||
# Initial values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/configs/minimal.yaml#L70
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/configs/minimal.yaml#L70
|
||||
|
||||
GENESIS_FORK_VERSION* = [0'u8, 0'u8, 0'u8, 1'u8]
|
||||
BLS_WITHDRAWAL_PREFIX* = 0'u8
|
||||
|
||||
# Time parameters
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/configs/minimal.yaml#L77
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/configs/minimal.yaml#L77
|
||||
# Changed: Faster to spin up testnets, but does not give validator
|
||||
# reasonable warning time for genesis
|
||||
GENESIS_DELAY* = 300
|
||||
@ -71,8 +71,6 @@ const
|
||||
# Unchanged
|
||||
MIN_ATTESTATION_INCLUSION_DELAY* = 1
|
||||
|
||||
SHARD_COMMITTEE_PERIOD* = 64 # epochs
|
||||
|
||||
# Changed
|
||||
SLOTS_PER_EPOCH* {.intdefine.} = 8
|
||||
|
||||
@ -87,6 +85,8 @@ const
|
||||
# Unchanged
|
||||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY* = 2'u64^8
|
||||
|
||||
SHARD_COMMITTEE_PERIOD* = 64 # epochs
|
||||
|
||||
# Unchanged
|
||||
MAX_EPOCHS_PER_CROSSLINK* = 4
|
||||
|
||||
@ -117,7 +117,7 @@ const
|
||||
|
||||
# Max operations per block
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/configs/minimal.yaml#L131
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/configs/minimal.yaml#L131
|
||||
|
||||
MAX_PROPOSER_SLASHINGS* = 2^4
|
||||
MAX_ATTESTER_SLASHINGS* = 2^1
|
||||
@ -178,7 +178,7 @@ const
|
||||
MAX_REVEAL_LATENESS_DECREMENT* = 128
|
||||
|
||||
# Max operations
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/configs/minimal.yaml#L214
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/configs/minimal.yaml#L214
|
||||
MAX_CUSTODY_KEY_REVEALS* = 256
|
||||
MAX_EARLY_DERIVED_SECRET_REVEALS* = 1
|
||||
MAX_CUSTODY_SLASHINGS* = 1
|
||||
|
@ -151,7 +151,7 @@ func is_slashable_validator(validator: Validator, epoch: Epoch): bool =
|
||||
(validator.activation_epoch <= epoch) and
|
||||
(epoch < validator.withdrawable_epoch)
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/specs/phase0/beacon-chain.md#proposer-slashings
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/beacon-chain.md#proposer-slashings
|
||||
proc process_proposer_slashing*(
|
||||
state: var BeaconState, proposer_slashing: ProposerSlashing,
|
||||
flags: UpdateFlags, stateCache: var StateCache): bool {.nbench.}=
|
||||
|
@ -53,7 +53,7 @@ declareGauge beacon_current_epoch, "Current epoch"
|
||||
# Spec
|
||||
# --------------------------------------------------------
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/specs/phase0/beacon-chain.md#get_total_active_balance
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/beacon-chain.md#get_total_active_balance
|
||||
func get_total_active_balance*(state: BeaconState, cache: var StateCache): Gwei =
|
||||
# Return the combined effective balance of the active validators.
|
||||
# Note: ``get_total_balance`` returns ``EFFECTIVE_BALANCE_INCREMENT`` Gwei
|
||||
@ -145,11 +145,11 @@ proc process_justification_and_finalization*(state: var BeaconState,
|
||||
## matter -- in the next epoch, they'll be 2 epochs old, when BeaconState
|
||||
## tracks current_epoch_attestations and previous_epoch_attestations only
|
||||
## per
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/specs/phase0/beacon-chain.md#attestations
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/beacon-chain.md#attestations
|
||||
## and `get_matching_source_attestations(...)` via
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/specs/phase0/beacon-chain.md#helper-functions-1
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/beacon-chain.md#helper-functions-1
|
||||
## and
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.11.3/specs/phase0/beacon-chain.md#final-updates
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/beacon-chain.md#final-updates
|
||||
## after which the state.previous_epoch_attestations is replaced.
|
||||
let total_active_balance = get_total_active_balance(state, stateCache)
|
||||
trace "Non-attesting indices in previous epoch",
|
||||
|
Loading…
x
Reference in New Issue
Block a user