Skip to content

Commit

Permalink
rm unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Nov 11, 2023
1 parent 9ec7b70 commit 5a5e4ec
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 23 deletions.
13 changes: 1 addition & 12 deletions beacon_chain/consensus_object_pools/consensus_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/gossip_processing/gossip_validation.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/gossip_processing/light_client_processor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/spec/forks.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions beacon_chain/sync/light_client_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand All @@ -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:
Expand Down
1 change: 0 additions & 1 deletion tests/test_blockchain_dag.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validator_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 5a5e4ec

Please sign in to comment.