From 7594fa660d7631c05499dfa13b7c85171279987d Mon Sep 17 00:00:00 2001 From: tersec Date: Wed, 5 Jan 2022 11:07:14 +0000 Subject: [PATCH] copyright year and spec URL updates (#3243) --- beacon_chain/spec/datatypes/altair.nim | 8 ++++---- beacon_chain/spec/datatypes/base.nim | 8 ++++---- beacon_chain/spec/datatypes/merge.nim | 7 +++---- beacon_chain/spec/network.nim | 2 +- beacon_chain/spec/presets/minimal/phase0_preset.nim | 2 +- beacon_chain/spec/state_transition_block.nim | 4 ++-- .../consensus_spec/altair/test_fixture_sync_protocol.nim | 6 +++--- tests/mocking/mock_blocks.nim | 8 ++++---- tests/testblockutil.nim | 4 ++-- 9 files changed, 24 insertions(+), 25 deletions(-) diff --git a/beacon_chain/spec/datatypes/altair.nim b/beacon_chain/spec/datatypes/altair.nim index d16118acf..dbdaea901 100644 --- a/beacon_chain/spec/datatypes/altair.nim +++ b/beacon_chain/spec/datatypes/altair.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021 Status Research & Development GmbH +# Copyright (c) 2021-2022 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -52,7 +52,7 @@ const TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE* = 16 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 NEXT_SYNC_COMMITTEE_INDEX* = 55.GeneralizedIndex @@ -150,7 +150,7 @@ type ### 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 attested_header*: BeaconBlockHeader ##\ ## The beacon block header that is attested to by the sync committee @@ -170,7 +170,7 @@ type fork_version*: Version ##\ ## 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 finalized_header*: BeaconBlockHeader ##\ ## Beacon block header that is finalized diff --git a/beacon_chain/spec/datatypes/base.nim b/beacon_chain/spec/datatypes/base.nim index b8b2838a5..d6ae28595 100644 --- a/beacon_chain/spec/datatypes/base.nim +++ b/beacon_chain/spec/datatypes/base.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2021 Status Research & Development GmbH +# Copyright (c) 2018-2022 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -219,7 +219,7 @@ type 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 current_version*: Version genesis_validators_root*: Eth2Digest @@ -229,7 +229,7 @@ type epoch*: Epoch 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 slot*: Slot @@ -400,7 +400,7 @@ type sync_committees*: Table[SyncCommitteePeriod, SyncCommitteeCache] # 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 branch*: array[DEPOSIT_CONTRACT_TREE_DEPTH, Eth2Digest] deposit_count*: array[32, byte] # Uint256 diff --git a/beacon_chain/spec/datatypes/merge.nim b/beacon_chain/spec/datatypes/merge.nim index 17a5b7dae..85a6f4c42 100644 --- a/beacon_chain/spec/datatypes/merge.nim +++ b/beacon_chain/spec/datatypes/merge.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021 Status Research & Development GmbH +# Copyright (c) 2021-2022 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -23,7 +23,7 @@ import nimcrypto/utils 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] ExecutionAddress* = object @@ -72,11 +72,10 @@ type block_hash*: Eth2Digest # Hash of execution block transactions_root*: Eth2Digest - # https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/merge/beacon-chain.md#execution-engine ExecutePayload* = proc( 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 block_hash*: Eth2Digest parent_hash*: Eth2Digest diff --git a/beacon_chain/spec/network.nim b/beacon_chain/spec/network.nim index 4c423c68e..0e3e62bcc 100644 --- a/beacon_chain/spec/network.nim +++ b/beacon_chain/spec/network.nim @@ -27,7 +27,7 @@ const TTFB_TIMEOUT* = 5.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 MAX_CHUNK_SIZE_MERGE* = 10 * 1024 * 1024 # bytes diff --git a/beacon_chain/spec/presets/minimal/phase0_preset.nim b/beacon_chain/spec/presets/minimal/phase0_preset.nim index 83d51690c..cb5236043 100644 --- a/beacon_chain/spec/presets/minimal/phase0_preset.nim +++ b/beacon_chain/spec/presets/minimal/phase0_preset.nim @@ -1,5 +1,5 @@ # 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 # diff --git a/beacon_chain/spec/state_transition_block.nim b/beacon_chain/spec/state_transition_block.nim index 3acd1ece9..0f09e6121 100644 --- a/beacon_chain/spec/state_transition_block.nim +++ b/beacon_chain/spec/state_transition_block.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2021 Status Research & Development GmbH +# Copyright (c) 2018-2022 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -488,7 +488,7 @@ proc process_sync_aggregate*( 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*( state: var merge.BeaconState, payload: ExecutionPayload, execute_payload: ExecutePayload): Result[void, cstring] = diff --git a/tests/consensus_spec/altair/test_fixture_sync_protocol.nim b/tests/consensus_spec/altair/test_fixture_sync_protocol.nim index 57e7eda63..1cf88cf29 100644 --- a/tests/consensus_spec/altair/test_fixture_sync_protocol.nim +++ b/tests/consensus_spec/altair/test_fixture_sync_protocol.nim @@ -20,7 +20,7 @@ import # Test utilities ../../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( forked: ForkedHashedBeaconState, participants: openArray[ValidatorIndex], @@ -72,7 +72,7 @@ let full_sync_committee_bits = block: res.bytes.fill(byte.high) 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 = LightClientStore( finalized_header: BeaconBlockHeader(), @@ -92,7 +92,7 @@ suite "EF - Altair - Unittests - Sync protocol" & preset(): res 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": var forked = assignClone(genesisState[]) template state: untyped {.inject.} = forked[].altairData.data diff --git a/tests/mocking/mock_blocks.nim b/tests/mocking/mock_blocks.nim index d3e8fa322..9e60419ea 100644 --- a/tests/mocking/mock_blocks.nim +++ b/tests/mocking/mock_blocks.nim @@ -29,7 +29,7 @@ func apply_randao_reveal(state: ForkyBeaconState, blck: var ForkySignedBeaconBlo blck.message.slot.compute_epoch_at_slot, 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) = let proposer_index = blck.message.proposer_index.ValidatorIndex @@ -43,7 +43,7 @@ func sign_block(state: ForkyBeaconState, blck: var ForkySignedBeaconBlock) = blck.root, 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 = ## Assuming a pre-state of the same slot, build a valid ExecutionPayload ## without any transactions. @@ -70,7 +70,7 @@ func build_empty_execution_payload(state: merge.BeaconState): ExecutionPayload = 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*( state: ForkedHashedBeaconState, slot: Slot, @@ -110,7 +110,7 @@ proc mockBlock*( 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*( state: ForkedHashedBeaconState): ForkedSignedBeaconBlock = ## Mock a BeaconBlock for the next slot diff --git a/tests/testblockutil.nim b/tests/testblockutil.nim index f0b88f5ca..857251d02 100644 --- a/tests/testblockutil.nim +++ b/tests/testblockutil.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2021 Status Research & Development GmbH +# Copyright (c) 2018-2022 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -22,7 +22,7 @@ const MockPrivKeys* = MockPrivKeysT() 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 = # 0 is not a valid BLS private key - 1000 helps interop with rust BLS library, # lighthouse. EF tests use 1 instead of 1000.