update a dozen spec URLs (#2929)
This commit is contained in:
parent
66b9f33edd
commit
47a6045b05
|
@ -9,7 +9,7 @@ to specs:
|
||||||
- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
|
||||||
- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#voluntary_exit
|
- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#voluntary_exit
|
||||||
- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/p2p-interface.md#attester_slashing
|
- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/p2p-interface.md#attester_slashing
|
||||||
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#proposer_slashing
|
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.0/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.
|
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).
|
For blocks, this means verifying state transition and all contained cryptographic signatures (instead of just the proposer signature).
|
||||||
|
|
|
@ -114,7 +114,7 @@ func get_attesting_indices*(epochRef: EpochRef,
|
||||||
for idx in get_attesting_indices(epochRef, data, bits):
|
for idx in get_attesting_indices(epochRef, data, bits):
|
||||||
result.add(idx)
|
result.add(idx)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#is_valid_indexed_attestation
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#is_valid_indexed_attestation
|
||||||
proc is_valid_indexed_attestation*(
|
proc is_valid_indexed_attestation*(
|
||||||
fork: Fork, genesis_validators_root: Eth2Digest,
|
fork: Fork, genesis_validators_root: Eth2Digest,
|
||||||
epochRef: EpochRef,
|
epochRef: EpochRef,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
{.push raises: [Defect].}
|
{.push raises: [Defect].}
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/tests/core/pyspec/eth2spec/utils/merkle_minimal.py
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/tests/core/pyspec/eth2spec/utils/merkle_minimal.py
|
||||||
|
|
||||||
# Merkle tree helpers
|
# Merkle tree helpers
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
|
@ -302,7 +302,7 @@ proc initialize_hashed_beacon_state_from_eth1*(
|
||||||
phase0.HashedBeaconState(
|
phase0.HashedBeaconState(
|
||||||
data: genesisState[], root: hash_tree_root(genesisState[]))
|
data: genesisState[], root: hash_tree_root(genesisState[]))
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#genesis-block
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#genesis-block
|
||||||
func get_initial_beacon_block*(state: phase0.BeaconState):
|
func get_initial_beacon_block*(state: phase0.BeaconState):
|
||||||
phase0.TrustedSignedBeaconBlock =
|
phase0.TrustedSignedBeaconBlock =
|
||||||
# The genesis block is implicitly trusted
|
# The genesis block is implicitly trusted
|
||||||
|
@ -314,7 +314,7 @@ func get_initial_beacon_block*(state: phase0.BeaconState):
|
||||||
phase0.TrustedSignedBeaconBlock(
|
phase0.TrustedSignedBeaconBlock(
|
||||||
message: message, root: hash_tree_root(message))
|
message: message, root: hash_tree_root(message))
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#get_block_root_at_slot
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#get_block_root_at_slot
|
||||||
func get_block_root_at_slot*(state: SomeBeaconState,
|
func get_block_root_at_slot*(state: SomeBeaconState,
|
||||||
slot: Slot): Eth2Digest =
|
slot: Slot): Eth2Digest =
|
||||||
## Return the block root at a recent ``slot``.
|
## Return the block root at a recent ``slot``.
|
||||||
|
@ -332,7 +332,7 @@ func get_block_root*(state: SomeBeaconState, epoch: Epoch): Eth2Digest =
|
||||||
## Return the block root at the start of a recent ``epoch``.
|
## Return the block root at the start of a recent ``epoch``.
|
||||||
get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch))
|
get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch))
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#get_total_balance
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#get_total_balance
|
||||||
template get_total_balance(
|
template get_total_balance(
|
||||||
state: SomeBeaconState, validator_indices: untyped): Gwei =
|
state: SomeBeaconState, validator_indices: untyped): Gwei =
|
||||||
## Return the combined effective balance of the ``indices``.
|
## Return the combined effective balance of the ``indices``.
|
||||||
|
|
|
@ -33,7 +33,7 @@ import
|
||||||
json_serialization/types as jsonTypes
|
json_serialization/types as jsonTypes
|
||||||
|
|
||||||
type
|
type
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#beaconstate
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#beaconstate
|
||||||
BeaconState* = object
|
BeaconState* = object
|
||||||
# Versioning
|
# Versioning
|
||||||
genesis_time*: uint64
|
genesis_time*: uint64
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Mainnet preset - Altair
|
# Mainnet preset - Altair
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.5/presets/mainnet/altair.yaml
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/presets/mainnet/altair.yaml
|
||||||
const
|
const
|
||||||
# Updated penalty values
|
# Updated penalty values
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
|
@ -123,7 +123,7 @@ func is_slashable_validator(validator: Validator, epoch: Epoch): bool =
|
||||||
(validator.activation_epoch <= epoch) and
|
(validator.activation_epoch <= epoch) and
|
||||||
(epoch < validator.withdrawable_epoch)
|
(epoch < validator.withdrawable_epoch)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#proposer-slashings
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#proposer-slashings
|
||||||
proc check_proposer_slashing*(
|
proc check_proposer_slashing*(
|
||||||
state: var SomeBeaconState, proposer_slashing: SomeProposerSlashing,
|
state: var SomeBeaconState, proposer_slashing: SomeProposerSlashing,
|
||||||
flags: UpdateFlags):
|
flags: UpdateFlags):
|
||||||
|
|
|
@ -971,7 +971,7 @@ proc process_epoch*(
|
||||||
|
|
||||||
process_inactivity_updates(cfg, state) # [New in Altair]
|
process_inactivity_updates(cfg, state) # [New in Altair]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#rewards-and-penalties-1
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#rewards-and-penalties-1
|
||||||
process_rewards_and_penalties(
|
process_rewards_and_penalties(
|
||||||
cfg, state, total_active_balance, unslashed_participating_balances)
|
cfg, state, total_active_balance, unslashed_participating_balances)
|
||||||
|
|
||||||
|
|
|
@ -319,7 +319,7 @@ func compute_shuffled_index*(
|
||||||
|
|
||||||
cur_idx_permuted
|
cur_idx_permuted
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#compute_proposer_index
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/beacon-chain.md#compute_proposer_index
|
||||||
func compute_proposer_index(state: SomeBeaconState,
|
func compute_proposer_index(state: SomeBeaconState,
|
||||||
indices: seq[ValidatorIndex], seed: Eth2Digest): Option[ValidatorIndex] =
|
indices: seq[ValidatorIndex], seed: Eth2Digest): Option[ValidatorIndex] =
|
||||||
## Return from ``indices`` a random index sampled by effective balance.
|
## Return from ``indices`` a random index sampled by effective balance.
|
||||||
|
|
|
@ -203,7 +203,7 @@ proc sign*(
|
||||||
else:
|
else:
|
||||||
await signWithRemoteValidator(v, signing_root)
|
await signWithRemoteValidator(v, signing_root)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/validator.md#randao-reveal
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.0/specs/phase0/validator.md#randao-reveal
|
||||||
func genRandaoReveal*(k: ValidatorPrivKey, fork: Fork,
|
func genRandaoReveal*(k: ValidatorPrivKey, fork: Fork,
|
||||||
genesis_validators_root: Eth2Digest,
|
genesis_validators_root: Eth2Digest,
|
||||||
slot: Slot): CookedSig =
|
slot: Slot): CookedSig =
|
||||||
|
|
Loading…
Reference in New Issue