fix XDeclaredButNotUsed hints (#5652)

This commit is contained in:
tersec 2023-12-06 16:23:45 +00:00 committed by GitHub
parent 2f694b9279
commit 91029ce6d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 20 deletions

View File

@ -1117,9 +1117,6 @@ proc handleIncomingStream(network: Eth2Node,
nbc_reqresp_messages_received.inc(1, [shortProtocolId(protocolId)])
# TODO(zah) The TTFB timeout is not implemented in LibP2P streams back-end
let deadline = sleepAsync RESP_TIMEOUT_DUR
const isEmptyMsg = when MsgRec is object:
# We need nested `when` statements here, because Nim doesn't properly
# apply boolean short-circuit logic at compile time and this causes
@ -1135,6 +1132,10 @@ proc handleIncomingStream(network: Eth2Node,
when isEmptyMsg:
NetRes[MsgRec].ok default(MsgRec)
else:
# TODO(zah) The TTFB timeout is not implemented in LibP2P streams
# back-end
let deadline = sleepAsync RESP_TIMEOUT_DUR
awaitWithTimeout(
readChunkPayload(conn, peer, MsgRec), deadline):
# Timeout, e.g., cancellation due to fulfillment by different peer.

View File

@ -20,12 +20,6 @@ export
results, eth2_rest_serialization, blockchain_dag, presto, rest_types,
rest_constants, rest_common
func match(data: openArray[char], charset: set[char]): int =
for ch in data:
if ch notin charset:
return 1
0
proc getSyncedHead*(
node: BeaconNode,
slot: Slot

View File

@ -46,12 +46,6 @@ import
from std/sequtils import mapIt
from eth/async_utils import awaitWithTimeout
const
delayBuckets = [-Inf, -4.0, -2.0, -1.0, -0.5, -0.1, -0.05,
0.05, 0.1, 0.5, 1.0, 2.0, 4.0, 8.0, Inf]
BUILDER_VALIDATOR_REGISTRATION_DELAY_TOLERANCE = 6.seconds
# Metrics for tracking attestation and beacon block loss
declareCounter beacon_light_client_finality_updates_sent,
"Number of LC finality updates sent by this peer"
@ -1418,10 +1412,7 @@ proc signAndSendContribution(node: BeaconNode,
proc handleSyncCommitteeContributions(
node: BeaconNode, head: BlockRef, slot: Slot) {.async.} =
let
fork = node.dag.forkAtEpoch(slot.epoch)
genesis_validators_root = node.dag.genesis_validators_root
syncCommittee = node.dag.syncCommitteeParticipants(slot + 1)
let syncCommittee = node.dag.syncCommitteeParticipants(slot + 1)
for subcommitteeIdx in SyncSubcommitteeIndex:
for valIdx in syncSubcommittee(syncCommittee, subcommitteeIdx):
@ -1595,7 +1586,9 @@ proc getValidatorRegistration(
proc registerValidatorsPerBuilder(
node: BeaconNode, payloadBuilderAddress: string, epoch: Epoch,
attachedValidatorPubkeys: seq[ValidatorPubKey]) {.async.} =
const HttpOk = 200
const
HttpOk = 200
BUILDER_VALIDATOR_REGISTRATION_DELAY_TOLERANCE = 6.seconds
try:
let payloadBuilderClient =