2022-09-19 09:07:46 +00:00
|
|
|
# beacon_chain
|
2023-01-09 22:44:44 +00:00
|
|
|
# Copyright (c) 2022-2023 Status Research & Development GmbH
|
2022-09-19 09:07:46 +00:00
|
|
|
# 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).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
|
|
|
type
|
|
|
|
Slot* = distinct uint64
|
|
|
|
Epoch* = distinct uint64
|
|
|
|
SyncCommitteePeriod* = distinct uint64
|
|
|
|
|
2023-04-21 18:52:43 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/capella/beacon-chain.md#custom-types
|
2022-10-28 08:02:33 +00:00
|
|
|
WithdrawalIndex* = uint64
|
|
|
|
|
2022-09-19 09:07:46 +00:00
|
|
|
DomainType* = distinct array[4, byte]
|
|
|
|
|
2023-06-23 09:30:46 +00:00
|
|
|
const
|
2023-08-09 03:58:47 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#constants
|
2023-06-23 09:30:46 +00:00
|
|
|
NODE_ID_BITS* = 256
|
|
|
|
|
2023-08-09 03:58:47 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#configuration
|
2023-08-12 03:10:12 +00:00
|
|
|
EPOCHS_PER_SUBNET_SUBSCRIPTION* = 256'u64
|
2023-06-23 09:30:46 +00:00
|
|
|
SUBNETS_PER_NODE* = 2'u64
|
|
|
|
ATTESTATION_SUBNET_COUNT*: uint64 = 64
|
2023-08-21 19:58:51 +00:00
|
|
|
ATTESTATION_SUBNET_EXTRA_BITS* = 0'u64
|
|
|
|
ATTESTATION_SUBNET_PREFIX_BITS* = 6'u64 ## \
|
2023-06-23 09:30:46 +00:00
|
|
|
## int(ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS)
|
|
|
|
|
|
|
|
static: doAssert 1 shl (ATTESTATION_SUBNET_PREFIX_BITS - ATTESTATION_SUBNET_EXTRA_BITS) ==
|
|
|
|
ATTESTATION_SUBNET_COUNT
|
|
|
|
|
2022-09-19 09:07:46 +00:00
|
|
|
const
|
|
|
|
# 2^64 - 1 in spec
|
|
|
|
FAR_FUTURE_SLOT* = Slot(not 0'u64)
|
|
|
|
FAR_FUTURE_EPOCH* = Epoch(not 0'u64)
|
|
|
|
FAR_FUTURE_PERIOD* = SyncCommitteePeriod(not 0'u64)
|
|
|
|
|
2023-09-14 18:23:59 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/beacon-chain.md#domain-types
|
2022-09-19 09:07:46 +00:00
|
|
|
DOMAIN_BEACON_PROPOSER* = DomainType([byte 0x00, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_BEACON_ATTESTER* = DomainType([byte 0x01, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_RANDAO* = DomainType([byte 0x02, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_DEPOSIT* = DomainType([byte 0x03, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_VOLUNTARY_EXIT* = DomainType([byte 0x04, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_SELECTION_PROOF* = DomainType([byte 0x05, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_AGGREGATE_AND_PROOF* = DomainType([byte 0x06, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_APPLICATION_MASK* = DomainType([byte 0x00, 0x00, 0x00, 0x01])
|
|
|
|
|
2023-09-14 18:23:59 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/beacon-chain.md#domain-types
|
2022-09-19 09:07:46 +00:00
|
|
|
DOMAIN_SYNC_COMMITTEE* = DomainType([byte 0x07, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF* = DomainType([byte 0x08, 0x00, 0x00, 0x00])
|
|
|
|
DOMAIN_CONTRIBUTION_AND_PROOF* = DomainType([byte 0x09, 0x00, 0x00, 0x00])
|
|
|
|
|
2023-08-09 03:58:47 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/capella/beacon-chain.md#domain-types
|
2022-10-27 06:29:24 +00:00
|
|
|
DOMAIN_BLS_TO_EXECUTION_CHANGE* = DomainType([byte 0x0a, 0x00, 0x00, 0x00])
|
|
|
|
|
2023-08-25 15:58:44 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/beacon-chain.md#domain-types
|
2023-04-04 15:12:34 +00:00
|
|
|
DOMAIN_BLOB_SIDECAR* = DomainType([byte 0x0b, 0x00, 0x00, 0x00])
|
|
|
|
|
2023-08-09 03:58:47 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/fork-choice.md#configuration
|
2022-09-19 09:07:46 +00:00
|
|
|
PROPOSER_SCORE_BOOST*: uint64 = 40
|
2023-06-28 17:55:31 +00:00
|
|
|
|
2023-08-09 03:58:47 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/p2p-interface.md#configuration
|
2023-06-28 17:55:31 +00:00
|
|
|
BLOB_SIDECAR_SUBNET_COUNT*: uint64 = 6
|
2023-08-12 03:10:12 +00:00
|
|
|
|
2023-09-14 18:23:59 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#configuration
|
2023-08-12 03:10:12 +00:00
|
|
|
MAX_REQUEST_BLOCKS* = 1024'u64
|
2023-09-14 12:37:35 +00:00
|
|
|
RESP_TIMEOUT* = 10'u64
|
2023-08-12 03:10:12 +00:00
|
|
|
|
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/bellatrix/p2p-interface.md#configuration
|
|
|
|
GOSSIP_MAX_SIZE* = 10'u64 * 1024 * 1024 # bytes
|
|
|
|
MAX_CHUNK_SIZE* = 10'u64 * 1024 * 1024 # bytes
|
2023-08-21 19:58:51 +00:00
|
|
|
|
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/p2p-interface.md#configuration
|
2023-09-14 12:37:35 +00:00
|
|
|
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS*: uint64 = 4096
|
|
|
|
MAX_REQUEST_BLOCKS_DENEB*: uint64 = 128 # TODO Make use of in request code
|