remove 4 more missing constants in preset handling warning (#5428)

This commit is contained in:
tersec 2023-09-14 12:37:35 +00:00 committed by GitHub
parent bb8584c58a
commit 7a001d4896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 10 deletions

View File

@ -2258,9 +2258,7 @@ func gossipId(
data: openArray[byte], phase0Prefix, topic: string): seq[byte] =
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#topics-and-messages
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/p2p-interface.md#topics-and-messages
const
MESSAGE_DOMAIN_INVALID_SNAPPY = [0x00'u8, 0x00, 0x00, 0x00]
MESSAGE_DOMAIN_VALID_SNAPPY = [0x01'u8, 0x00, 0x00, 0x00]
const MESSAGE_DOMAIN_VALID_SNAPPY = [0x01'u8, 0x00, 0x00, 0x00]
let messageDigest = withEth2Hash:
h.update(MESSAGE_DOMAIN_VALID_SNAPPY)

View File

@ -65,11 +65,12 @@ const
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/p2p-interface.md#configuration
MAX_REQUEST_BLOCKS* = 1024'u64
RESP_TIMEOUT* = 10
RESP_TIMEOUT* = 10'u64
# 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
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/p2p-interface.md#configuration
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS* = 4096'u64
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS*: uint64 = 4096
MAX_REQUEST_BLOCKS_DENEB*: uint64 = 128 # TODO Make use of in request code

View File

@ -23,16 +23,16 @@ const
topicAggregateAndProofsSuffix* = "beacon_aggregate_and_proof/ssz_snappy"
topicBlsToExecutionChangeSuffix* = "bls_to_execution_change/ssz_snappy"
# The spec now includes this as a bare integer as `RESP_TIMEOUT`
RESP_TIMEOUT_DUR* = RESP_TIMEOUT.seconds
const
# The spec now includes this as a bare uint64 as `RESP_TIMEOUT`
RESP_TIMEOUT_DUR* = RESP_TIMEOUT.int64.seconds
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/light-client/p2p-interface.md#configuration
MAX_REQUEST_LIGHT_CLIENT_UPDATES* = 128
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/p2p-interface.md#configuration
MAX_REQUEST_BLOCKS_DENEB* = 128 # TODO Make use of in request code
MAX_REQUEST_BLOB_SIDECARS* = MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
# TODO MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS
MAX_REQUEST_BLOB_SIDECARS*: uint64 =
MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
defaultEth2TcpPort* = 9000
defaultEth2TcpPortDesc* = $defaultEth2TcpPort

View File

@ -23,7 +23,11 @@ const
# Constants from `validator.md` not covered by config/presets in the spec
TARGET_AGGREGATORS_PER_COMMITTEE*: uint64 = 16
# Not used anywhere; only for network preset checking
EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION: uint64 = 256
MESSAGE_DOMAIN_INVALID_SNAPPY = 0'u64
TTFB_TIMEOUT = 5'u64
type
Version* = distinct array[4, byte]
@ -591,6 +595,10 @@ proc readRuntimeConfig*(
checkCompatibility ATTESTATION_SUBNET_PREFIX_BITS
checkCompatibility BLOB_SIDECAR_SUBNET_COUNT
checkCompatibility MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS
checkCompatibility RESP_TIMEOUT
checkCompatibility TTFB_TIMEOUT
checkCompatibility MESSAGE_DOMAIN_INVALID_SNAPPY
checkCompatibility MAX_REQUEST_BLOCKS_DENEB
# Isn't being used as a preset in the usual way: at any time, there's one correct value
checkCompatibility PROPOSER_SCORE_BOOST