mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-18 10:31:04 +00:00
rm unused code (#5596)
This commit is contained in:
parent
14c68ea285
commit
54bdda13b4
@ -170,7 +170,7 @@ proc updateExecutionClientHead(self: ref ConsensusManager,
|
|||||||
payloadAttributes = none attributes)
|
payloadAttributes = none attributes)
|
||||||
|
|
||||||
# Can't use dag.head here because it hasn't been updated yet
|
# 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)
|
case self.dag.cfg.consensusForkAtEpoch(newHead.blck.bid.slot.epoch)
|
||||||
of ConsensusFork.Deneb:
|
of ConsensusFork.Deneb:
|
||||||
callForkchoiceUpdated(PayloadAttributesV3)
|
callForkchoiceUpdated(PayloadAttributesV3)
|
||||||
@ -369,17 +369,6 @@ proc runProposalForkchoiceUpdated*(
|
|||||||
get_randao_mix(forkyState.data, get_current_epoch(forkyState.data)).data
|
get_randao_mix(forkyState.data, get_current_epoch(forkyState.data)).data
|
||||||
feeRecipient = self[].getFeeRecipient(
|
feeRecipient = self[].getFeeRecipient(
|
||||||
nextProposer, Opt.some(validatorIndex), nextWallSlot.epoch)
|
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)
|
beaconHead = self.attestationPool[].getBeaconHead(self.dag.head)
|
||||||
headBlockHash = self.dag.loadExecutionBlockHash(beaconHead.blck)
|
headBlockHash = self.dag.loadExecutionBlockHash(beaconHead.blck)
|
||||||
|
|
||||||
|
@ -1039,7 +1039,7 @@ proc validateBlsToExecutionChange*(
|
|||||||
if deferredCrypto.isErr():
|
if deferredCrypto.isErr():
|
||||||
return pool.checkedReject(deferredCrypto.error)
|
return pool.checkedReject(deferredCrypto.error)
|
||||||
|
|
||||||
let (cryptoFut, sig) = deferredCrypto.get()
|
let (cryptoFut, _) = deferredCrypto.get()
|
||||||
case await cryptoFut
|
case await cryptoFut
|
||||||
of BatchResult.Invalid:
|
of BatchResult.Invalid:
|
||||||
return pool.checkedReject(
|
return pool.checkedReject(
|
||||||
|
@ -455,7 +455,7 @@ proc addObject*(
|
|||||||
|
|
||||||
let
|
let
|
||||||
wallTime = self.getBeaconTime()
|
wallTime = self.getBeaconTime()
|
||||||
(afterGenesis, wallSlot) = wallTime.toSlot()
|
(afterGenesis, _) = wallTime.toSlot()
|
||||||
|
|
||||||
if not afterGenesis:
|
if not afterGenesis:
|
||||||
error "Processing LC object before genesis, clock turned back?"
|
error "Processing LC object before genesis, clock turned back?"
|
||||||
|
@ -533,7 +533,7 @@ proc init*(T: type BeaconNode,
|
|||||||
taskpool = TaskPoolPtr.new(numThreads = config.numThreads)
|
taskpool = TaskPoolPtr.new(numThreads = config.numThreads)
|
||||||
|
|
||||||
info "Threadpool started", numThreads = taskpool.numThreads
|
info "Threadpool started", numThreads = taskpool.numThreads
|
||||||
except Exception as exc:
|
except Exception:
|
||||||
raise newException(Defect, "Failure in taskpool initialization.")
|
raise newException(Defect, "Failure in taskpool initialization.")
|
||||||
|
|
||||||
if metadata.genesis.kind == BakedIn:
|
if metadata.genesis.kind == BakedIn:
|
||||||
|
@ -805,7 +805,7 @@ template withBlck*(
|
|||||||
body
|
body
|
||||||
of ConsensusFork.Bellatrix:
|
of ConsensusFork.Bellatrix:
|
||||||
const consensusFork {.inject, used.} = ConsensusFork.Bellatrix
|
const consensusFork {.inject, used.} = ConsensusFork.Bellatrix
|
||||||
template forkyBlck: untyped {.inject.} = x.bellatrixData
|
template forkyBlck: untyped {.inject, used.} = x.bellatrixData
|
||||||
body
|
body
|
||||||
of ConsensusFork.Capella:
|
of ConsensusFork.Capella:
|
||||||
const consensusFork {.inject, used.} = ConsensusFork.Capella
|
const consensusFork {.inject, used.} = ConsensusFork.Capella
|
||||||
|
@ -279,10 +279,10 @@ proc query[E](
|
|||||||
let didProgress = cast[Future[bool]](future).read()
|
let didProgress = cast[Future[bool]](future).read()
|
||||||
if didProgress and not progressFut.finished:
|
if didProgress and not progressFut.finished:
|
||||||
progressFut.complete()
|
progressFut.complete()
|
||||||
except CancelledError as exc:
|
except CancelledError:
|
||||||
if not progressFut.finished:
|
if not progressFut.finished:
|
||||||
progressFut.cancelSoon()
|
progressFut.cancelSoon()
|
||||||
except CatchableError as exc:
|
except CatchableError:
|
||||||
discard
|
discard
|
||||||
finally:
|
finally:
|
||||||
inc numCompleted
|
inc numCompleted
|
||||||
@ -297,7 +297,7 @@ proc query[E](
|
|||||||
workers[i].addCallback(handleFinishedWorker)
|
workers[i].addCallback(handleFinishedWorker)
|
||||||
except CancelledError as exc:
|
except CancelledError as exc:
|
||||||
raise exc
|
raise exc
|
||||||
except CatchableError as exc:
|
except CatchableError:
|
||||||
workers[i] = newFuture[bool]()
|
workers[i] = newFuture[bool]()
|
||||||
workers[i].complete(false)
|
workers[i].complete(false)
|
||||||
|
|
||||||
@ -316,13 +316,13 @@ proc query[E](
|
|||||||
try:
|
try:
|
||||||
await allFutures(workers[0 ..< maxCompleted])
|
await allFutures(workers[0 ..< maxCompleted])
|
||||||
break
|
break
|
||||||
except CancelledError as exc:
|
except CancelledError:
|
||||||
continue
|
continue
|
||||||
while true:
|
while true:
|
||||||
try:
|
try:
|
||||||
await doneFut
|
await doneFut
|
||||||
break
|
break
|
||||||
except CancelledError as exc:
|
except CancelledError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not progressFut.finished:
|
if not progressFut.finished:
|
||||||
|
@ -1604,7 +1604,6 @@ template runShufflingTests(cfg: RuntimeConfig, numRandomTests: int) =
|
|||||||
stateEpoch = forkyState.data.get_current_epoch
|
stateEpoch = forkyState.data.get_current_epoch
|
||||||
blckEpoch = blck.bid.slot.epoch
|
blckEpoch = blck.bid.slot.epoch
|
||||||
minEpoch = min(stateEpoch, blckEpoch)
|
minEpoch = min(stateEpoch, blckEpoch)
|
||||||
lowSlot = epoch.lowSlotForAttesterShuffling
|
|
||||||
shufflingRef = dag.computeShufflingRef(forkyState, blck, epoch)
|
shufflingRef = dag.computeShufflingRef(forkyState, blck, epoch)
|
||||||
mix = dag.computeRandaoMix(forkyState,
|
mix = dag.computeRandaoMix(forkyState,
|
||||||
dependentBsi.get.bid, epoch.lowSlotForAttesterShuffling)
|
dependentBsi.get.bid, epoch.lowSlotForAttesterShuffling)
|
||||||
|
@ -413,7 +413,7 @@ suite "Validator Client test suite":
|
|||||||
ok RestJson.decode(value, T,
|
ok RestJson.decode(value, T,
|
||||||
requireAllFields = true,
|
requireAllFields = true,
|
||||||
allowUnknownFields = true)
|
allowUnknownFields = true)
|
||||||
except SerializationError as exc:
|
except SerializationError:
|
||||||
err("Serialization error")
|
err("Serialization error")
|
||||||
else:
|
else:
|
||||||
err("Content-Type not supported")
|
err("Content-Type not supported")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user