rm unused code (#5596)

This commit is contained in:
tersec 2023-11-11 11:49:34 +03:00 committed by GitHub
parent 14c68ea285
commit 54bdda13b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 23 deletions

View File

@ -170,7 +170,7 @@ proc updateExecutionClientHead(self: ref ConsensusManager,
payloadAttributes = none attributes)
# Can't use dag.head here because it hasn't been updated yet
let (payloadExecutionStatus, latestValidHash) =
let (payloadExecutionStatus, _) =
case self.dag.cfg.consensusForkAtEpoch(newHead.blck.bid.slot.epoch)
of ConsensusFork.Deneb:
callForkchoiceUpdated(PayloadAttributesV3)
@ -369,17 +369,6 @@ proc runProposalForkchoiceUpdated*(
get_randao_mix(forkyState.data, get_current_epoch(forkyState.data)).data
feeRecipient = self[].getFeeRecipient(
nextProposer, Opt.some(validatorIndex), nextWallSlot.epoch)
withdrawals =
if self.dag.headState.kind >= ConsensusFork.Capella:
# Head state is not eventual proposal state, but withdrawals will be
# identical within an epoch.
withState(self.dag.headState):
when consensusFork >= ConsensusFork.Capella:
Opt.some get_expected_withdrawals(forkyState.data)
else:
Opt.none(seq[Withdrawal])
else:
Opt.none(seq[Withdrawal])
beaconHead = self.attestationPool[].getBeaconHead(self.dag.head)
headBlockHash = self.dag.loadExecutionBlockHash(beaconHead.blck)

View File

@ -1039,7 +1039,7 @@ proc validateBlsToExecutionChange*(
if deferredCrypto.isErr():
return pool.checkedReject(deferredCrypto.error)
let (cryptoFut, sig) = deferredCrypto.get()
let (cryptoFut, _) = deferredCrypto.get()
case await cryptoFut
of BatchResult.Invalid:
return pool.checkedReject(

View File

@ -455,7 +455,7 @@ proc addObject*(
let
wallTime = self.getBeaconTime()
(afterGenesis, wallSlot) = wallTime.toSlot()
(afterGenesis, _) = wallTime.toSlot()
if not afterGenesis:
error "Processing LC object before genesis, clock turned back?"

View File

@ -533,7 +533,7 @@ proc init*(T: type BeaconNode,
taskpool = TaskPoolPtr.new(numThreads = config.numThreads)
info "Threadpool started", numThreads = taskpool.numThreads
except Exception as exc:
except Exception:
raise newException(Defect, "Failure in taskpool initialization.")
if metadata.genesis.kind == BakedIn:

View File

@ -805,7 +805,7 @@ template withBlck*(
body
of ConsensusFork.Bellatrix:
const consensusFork {.inject, used.} = ConsensusFork.Bellatrix
template forkyBlck: untyped {.inject.} = x.bellatrixData
template forkyBlck: untyped {.inject, used.} = x.bellatrixData
body
of ConsensusFork.Capella:
const consensusFork {.inject, used.} = ConsensusFork.Capella

View File

@ -279,10 +279,10 @@ proc query[E](
let didProgress = cast[Future[bool]](future).read()
if didProgress and not progressFut.finished:
progressFut.complete()
except CancelledError as exc:
except CancelledError:
if not progressFut.finished:
progressFut.cancelSoon()
except CatchableError as exc:
except CatchableError:
discard
finally:
inc numCompleted
@ -297,7 +297,7 @@ proc query[E](
workers[i].addCallback(handleFinishedWorker)
except CancelledError as exc:
raise exc
except CatchableError as exc:
except CatchableError:
workers[i] = newFuture[bool]()
workers[i].complete(false)
@ -316,13 +316,13 @@ proc query[E](
try:
await allFutures(workers[0 ..< maxCompleted])
break
except CancelledError as exc:
except CancelledError:
continue
while true:
try:
await doneFut
break
except CancelledError as exc:
except CancelledError:
continue
if not progressFut.finished:

View File

@ -1604,7 +1604,6 @@ template runShufflingTests(cfg: RuntimeConfig, numRandomTests: int) =
stateEpoch = forkyState.data.get_current_epoch
blckEpoch = blck.bid.slot.epoch
minEpoch = min(stateEpoch, blckEpoch)
lowSlot = epoch.lowSlotForAttesterShuffling
shufflingRef = dag.computeShufflingRef(forkyState, blck, epoch)
mix = dag.computeRandaoMix(forkyState,
dependentBsi.get.bid, epoch.lowSlotForAttesterShuffling)

View File

@ -413,7 +413,7 @@ suite "Validator Client test suite":
ok RestJson.decode(value, T,
requireAllFields = true,
allowUnknownFields = true)
except SerializationError as exc:
except SerializationError:
err("Serialization error")
else:
err("Content-Type not supported")