copyright year and spec URL updates (#3243)
This commit is contained in:
parent
cd77377375
commit
7594fa660d
|
@ -1,5 +1,5 @@
|
||||||
# beacon_chain
|
# beacon_chain
|
||||||
# Copyright (c) 2021 Status Research & Development GmbH
|
# Copyright (c) 2021-2022 Status Research & Development GmbH
|
||||||
# Licensed and distributed under either of
|
# Licensed and distributed under either of
|
||||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
|
@ -52,7 +52,7 @@ const
|
||||||
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE* = 16
|
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE* = 16
|
||||||
SYNC_COMMITTEE_SUBNET_COUNT* = 4
|
SYNC_COMMITTEE_SUBNET_COUNT* = 4
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/setup.py#L478-L479
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/setup.py#L478-L479
|
||||||
FINALIZED_ROOT_INDEX* = 105.GeneralizedIndex
|
FINALIZED_ROOT_INDEX* = 105.GeneralizedIndex
|
||||||
NEXT_SYNC_COMMITTEE_INDEX* = 55.GeneralizedIndex
|
NEXT_SYNC_COMMITTEE_INDEX* = 55.GeneralizedIndex
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ type
|
||||||
|
|
||||||
### Modified/overloaded
|
### Modified/overloaded
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/altair/sync-protocol.md#lightclientupdate
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/altair/sync-protocol.md#lightclientupdate
|
||||||
LightClientUpdate* = object
|
LightClientUpdate* = object
|
||||||
attested_header*: BeaconBlockHeader ##\
|
attested_header*: BeaconBlockHeader ##\
|
||||||
## The beacon block header that is attested to by the sync committee
|
## The beacon block header that is attested to by the sync committee
|
||||||
|
@ -170,7 +170,7 @@ type
|
||||||
fork_version*: Version ##\
|
fork_version*: Version ##\
|
||||||
## Fork version for the aggregate signature
|
## Fork version for the aggregate signature
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/altair/sync-protocol.md#lightclientstore
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/altair/sync-protocol.md#lightclientstore
|
||||||
LightClientStore* = object
|
LightClientStore* = object
|
||||||
finalized_header*: BeaconBlockHeader ##\
|
finalized_header*: BeaconBlockHeader ##\
|
||||||
## Beacon block header that is finalized
|
## Beacon block header that is finalized
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# beacon_chain
|
# beacon_chain
|
||||||
# Copyright (c) 2018-2021 Status Research & Development GmbH
|
# Copyright (c) 2018-2022 Status Research & Development GmbH
|
||||||
# Licensed and distributed under either of
|
# Licensed and distributed under either of
|
||||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
|
@ -219,7 +219,7 @@ type
|
||||||
|
|
||||||
ForkDigest* = distinct array[4, byte]
|
ForkDigest* = distinct array[4, byte]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#forkdata
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/phase0/beacon-chain.md#forkdata
|
||||||
ForkData* = object
|
ForkData* = object
|
||||||
current_version*: Version
|
current_version*: Version
|
||||||
genesis_validators_root*: Eth2Digest
|
genesis_validators_root*: Eth2Digest
|
||||||
|
@ -229,7 +229,7 @@ type
|
||||||
epoch*: Epoch
|
epoch*: Epoch
|
||||||
root*: Eth2Digest
|
root*: Eth2Digest
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#AttestationData
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/phase0/beacon-chain.md#AttestationData
|
||||||
AttestationData* = object
|
AttestationData* = object
|
||||||
slot*: Slot
|
slot*: Slot
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ type
|
||||||
sync_committees*: Table[SyncCommitteePeriod, SyncCommitteeCache]
|
sync_committees*: Table[SyncCommitteePeriod, SyncCommitteeCache]
|
||||||
|
|
||||||
# This matches the mutable state of the Solidity deposit contract
|
# This matches the mutable state of the Solidity deposit contract
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.2/solidity_deposit_contract/deposit_contract.sol
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/solidity_deposit_contract/deposit_contract.sol
|
||||||
DepositContractState* = object
|
DepositContractState* = object
|
||||||
branch*: array[DEPOSIT_CONTRACT_TREE_DEPTH, Eth2Digest]
|
branch*: array[DEPOSIT_CONTRACT_TREE_DEPTH, Eth2Digest]
|
||||||
deposit_count*: array[32, byte] # Uint256
|
deposit_count*: array[32, byte] # Uint256
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# beacon_chain
|
# beacon_chain
|
||||||
# Copyright (c) 2021 Status Research & Development GmbH
|
# Copyright (c) 2021-2022 Status Research & Development GmbH
|
||||||
# Licensed and distributed under either of
|
# Licensed and distributed under either of
|
||||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
|
@ -23,7 +23,7 @@ import
|
||||||
nimcrypto/utils
|
nimcrypto/utils
|
||||||
|
|
||||||
type
|
type
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#custom-types
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/bellatrix/beacon-chain.md#custom-types
|
||||||
Transaction* = List[byte, Limit MAX_BYTES_PER_TRANSACTION]
|
Transaction* = List[byte, Limit MAX_BYTES_PER_TRANSACTION]
|
||||||
|
|
||||||
ExecutionAddress* = object
|
ExecutionAddress* = object
|
||||||
|
@ -72,11 +72,10 @@ type
|
||||||
block_hash*: Eth2Digest # Hash of execution block
|
block_hash*: Eth2Digest # Hash of execution block
|
||||||
transactions_root*: Eth2Digest
|
transactions_root*: Eth2Digest
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#execution-engine
|
|
||||||
ExecutePayload* = proc(
|
ExecutePayload* = proc(
|
||||||
execution_payload: ExecutionPayload): bool {.gcsafe, raises: [Defect].}
|
execution_payload: ExecutionPayload): bool {.gcsafe, raises: [Defect].}
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/fork-choice.md#powblock
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/bellatrix/fork-choice.md#powblock
|
||||||
PowBlock* = object
|
PowBlock* = object
|
||||||
block_hash*: Eth2Digest
|
block_hash*: Eth2Digest
|
||||||
parent_hash*: Eth2Digest
|
parent_hash*: Eth2Digest
|
||||||
|
|
|
@ -27,7 +27,7 @@ const
|
||||||
TTFB_TIMEOUT* = 5.seconds
|
TTFB_TIMEOUT* = 5.seconds
|
||||||
RESP_TIMEOUT* = 10.seconds
|
RESP_TIMEOUT* = 10.seconds
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/p2p-interface.md#configuration
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/p2p-interface.md#configuration
|
||||||
GOSSIP_MAX_SIZE_MERGE* = 10 * 1024 * 1024 # bytes
|
GOSSIP_MAX_SIZE_MERGE* = 10 * 1024 * 1024 # bytes
|
||||||
MAX_CHUNK_SIZE_MERGE* = 10 * 1024 * 1024 # bytes
|
MAX_CHUNK_SIZE_MERGE* = 10 * 1024 * 1024 # bytes
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Minimal preset - Phase0
|
# Minimal preset - Phase0
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/presets/minimal/phase0.yaml
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/presets/minimal/phase0.yaml
|
||||||
|
|
||||||
const
|
const
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# beacon_chain
|
# beacon_chain
|
||||||
# Copyright (c) 2018-2021 Status Research & Development GmbH
|
# Copyright (c) 2018-2022 Status Research & Development GmbH
|
||||||
# Licensed and distributed under either of
|
# Licensed and distributed under either of
|
||||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
|
@ -488,7 +488,7 @@ proc process_sync_aggregate*(
|
||||||
|
|
||||||
ok()
|
ok()
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.4/specs/merge/beacon-chain.md#process_execution_payload
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/specs/bellatrix/beacon-chain.md#process_execution_payload
|
||||||
proc process_execution_payload*(
|
proc process_execution_payload*(
|
||||||
state: var merge.BeaconState, payload: ExecutionPayload,
|
state: var merge.BeaconState, payload: ExecutionPayload,
|
||||||
execute_payload: ExecutePayload): Result[void, cstring] =
|
execute_payload: ExecutePayload): Result[void, cstring] =
|
||||||
|
|
|
@ -20,7 +20,7 @@ import
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../testutil, ../../testblockutil
|
../../testutil, ../../testblockutil
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.4/tests/core/pyspec/eth2spec/test/helpers/sync_committee.py#L27-L44
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/tests/core/pyspec/eth2spec/test/helpers/sync_committee.py#L27-L44
|
||||||
proc compute_aggregate_sync_committee_signature(
|
proc compute_aggregate_sync_committee_signature(
|
||||||
forked: ForkedHashedBeaconState,
|
forked: ForkedHashedBeaconState,
|
||||||
participants: openArray[ValidatorIndex],
|
participants: openArray[ValidatorIndex],
|
||||||
|
@ -72,7 +72,7 @@ let full_sync_committee_bits = block:
|
||||||
res.bytes.fill(byte.high)
|
res.bytes.fill(byte.high)
|
||||||
res
|
res
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/tests/core/pyspec/eth2spec/test/altair/unittests/test_sync_protocol.py#L24-L33
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/tests/core/pyspec/eth2spec/test/altair/unittests/test_sync_protocol.py#L24-L33
|
||||||
func initialize_light_client_store(state: auto): LightClientStore =
|
func initialize_light_client_store(state: auto): LightClientStore =
|
||||||
LightClientStore(
|
LightClientStore(
|
||||||
finalized_header: BeaconBlockHeader(),
|
finalized_header: BeaconBlockHeader(),
|
||||||
|
@ -92,7 +92,7 @@ suite "EF - Altair - Unittests - Sync protocol" & preset():
|
||||||
res
|
res
|
||||||
genesisState = newClone(initGenesisState(cfg = cfg))
|
genesisState = newClone(initGenesisState(cfg = cfg))
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.7/tests/core/pyspec/eth2spec/test/altair/unittests/test_sync_protocol.py#L36-L90
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/tests/core/pyspec/eth2spec/test/altair/unittests/test_sync_protocol.py#L36-L90
|
||||||
test "test_process_light_client_update_not_timeout":
|
test "test_process_light_client_update_not_timeout":
|
||||||
var forked = assignClone(genesisState[])
|
var forked = assignClone(genesisState[])
|
||||||
template state: untyped {.inject.} = forked[].altairData.data
|
template state: untyped {.inject.} = forked[].altairData.data
|
||||||
|
|
|
@ -29,7 +29,7 @@ func apply_randao_reveal(state: ForkyBeaconState, blck: var ForkySignedBeaconBlo
|
||||||
blck.message.slot.compute_epoch_at_slot,
|
blck.message.slot.compute_epoch_at_slot,
|
||||||
privkey).toValidatorSig()
|
privkey).toValidatorSig()
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/tests/core/pyspec/eth2spec/test/helpers/block.py#L38-L54
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/tests/core/pyspec/eth2spec/test/helpers/block.py#L38-L54
|
||||||
func sign_block(state: ForkyBeaconState, blck: var ForkySignedBeaconBlock) =
|
func sign_block(state: ForkyBeaconState, blck: var ForkySignedBeaconBlock) =
|
||||||
let
|
let
|
||||||
proposer_index = blck.message.proposer_index.ValidatorIndex
|
proposer_index = blck.message.proposer_index.ValidatorIndex
|
||||||
|
@ -43,7 +43,7 @@ func sign_block(state: ForkyBeaconState, blck: var ForkySignedBeaconBlock) =
|
||||||
blck.root,
|
blck.root,
|
||||||
privkey).toValidatorSig()
|
privkey).toValidatorSig()
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py#L1-L31
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py#L1-L31
|
||||||
func build_empty_execution_payload(state: merge.BeaconState): ExecutionPayload =
|
func build_empty_execution_payload(state: merge.BeaconState): ExecutionPayload =
|
||||||
## Assuming a pre-state of the same slot, build a valid ExecutionPayload
|
## Assuming a pre-state of the same slot, build a valid ExecutionPayload
|
||||||
## without any transactions.
|
## without any transactions.
|
||||||
|
@ -70,7 +70,7 @@ func build_empty_execution_payload(state: merge.BeaconState): ExecutionPayload =
|
||||||
|
|
||||||
payload
|
payload
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/tests/core/pyspec/eth2spec/test/helpers/block.py#L75-L104
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/tests/core/pyspec/eth2spec/test/helpers/block.py#L75-L104
|
||||||
proc mockBlock*(
|
proc mockBlock*(
|
||||||
state: ForkedHashedBeaconState,
|
state: ForkedHashedBeaconState,
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
|
@ -110,7 +110,7 @@ proc mockBlock*(
|
||||||
|
|
||||||
sign_block(state.data, blck)
|
sign_block(state.data, blck)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/tests/core/pyspec/eth2spec/test/helpers/block.py#L107-L108
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/tests/core/pyspec/eth2spec/test/helpers/block.py#L107-L108
|
||||||
proc mockBlockForNextSlot*(
|
proc mockBlockForNextSlot*(
|
||||||
state: ForkedHashedBeaconState): ForkedSignedBeaconBlock =
|
state: ForkedHashedBeaconState): ForkedSignedBeaconBlock =
|
||||||
## Mock a BeaconBlock for the next slot
|
## Mock a BeaconBlock for the next slot
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# beacon_chain
|
# beacon_chain
|
||||||
# Copyright (c) 2018-2021 Status Research & Development GmbH
|
# Copyright (c) 2018-2022 Status Research & Development GmbH
|
||||||
# Licensed and distributed under either of
|
# Licensed and distributed under either of
|
||||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
|
@ -22,7 +22,7 @@ const
|
||||||
MockPrivKeys* = MockPrivKeysT()
|
MockPrivKeys* = MockPrivKeysT()
|
||||||
MockPubKeys* = MockPubKeysT()
|
MockPubKeys* = MockPubKeysT()
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/tests/core/pyspec/eth2spec/test/helpers/keys.py
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.8/tests/core/pyspec/eth2spec/test/helpers/keys.py
|
||||||
func `[]`*(_: MockPrivKeysT, index: ValidatorIndex): ValidatorPrivKey =
|
func `[]`*(_: MockPrivKeysT, index: ValidatorIndex): ValidatorPrivKey =
|
||||||
# 0 is not a valid BLS private key - 1000 helps interop with rust BLS library,
|
# 0 is not a valid BLS private key - 1000 helps interop with rust BLS library,
|
||||||
# lighthouse. EF tests use 1 instead of 1000.
|
# lighthouse. EF tests use 1 instead of 1000.
|
||||||
|
|
Loading…
Reference in New Issue