mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-17 08:56:45 +00:00
fix ATTESTATION_PROPAGATION_SLOT_RANGE
unknown constant warning (#5433)
* fix ATTESTATION_PROPAGATION_SLOT_RANGE unknown constant warning * verify underflow not an issue
This commit is contained in:
parent
521e7f535c
commit
ee75d45a8b
@ -99,9 +99,10 @@ func check_propagation_slot_range(
|
||||
# The spec value of ATTESTATION_PROPAGATION_SLOT_RANGE is 32, but it can
|
||||
# retransmit attestations on the cusp of being out of spec, and which by
|
||||
# the time they reach their destination might be out of spec.
|
||||
const ATTESTATION_PROPAGATION_SLOT_RANGE = 28
|
||||
|
||||
if msgSlot + ATTESTATION_PROPAGATION_SLOT_RANGE < pastSlot.slot:
|
||||
const TIME_IN_FLIGHT_BUFFER = 4
|
||||
static: doAssert ATTESTATION_PROPAGATION_SLOT_RANGE > TIME_IN_FLIGHT_BUFFER
|
||||
if msgSlot + (ATTESTATION_PROPAGATION_SLOT_RANGE - TIME_IN_FLIGHT_BUFFER) <
|
||||
pastSlot.slot:
|
||||
return errIgnore("Attestation slot in the past")
|
||||
else:
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/deneb/p2p-interface.md#beacon_attestation_subnet_id
|
||||
|
@ -66,6 +66,7 @@ const
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#configuration
|
||||
MAX_REQUEST_BLOCKS* = 1024'u64
|
||||
RESP_TIMEOUT* = 10'u64
|
||||
ATTESTATION_PROPAGATION_SLOT_RANGE*: uint64 = 32
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/bellatrix/p2p-interface.md#configuration
|
||||
GOSSIP_MAX_SIZE* = 10'u64 * 1024 * 1024 # bytes
|
||||
|
@ -599,6 +599,7 @@ proc readRuntimeConfig*(
|
||||
checkCompatibility TTFB_TIMEOUT
|
||||
checkCompatibility MESSAGE_DOMAIN_INVALID_SNAPPY
|
||||
checkCompatibility MAX_REQUEST_BLOCKS_DENEB
|
||||
checkCompatibility ATTESTATION_PROPAGATION_SLOT_RANGE
|
||||
|
||||
# Isn't being used as a preset in the usual way: at any time, there's one correct value
|
||||
checkCompatibility PROPOSER_SCORE_BOOST
|
||||
|
Loading…
x
Reference in New Issue
Block a user