enable --styleCheck:error in ncli/ and research/ (#6014)

This commit is contained in:
tersec 2024-03-02 05:25:17 +00:00 committed by GitHub
parent d8b8aee7b7
commit b4db011daf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 13 additions and 13 deletions

View File

@ -32,19 +32,19 @@ func forkEpochConfigKey*(consensusFork: ConsensusFork): string =
doAssert consensusFork > ConsensusFork.Phase0
($consensusFork).toUpperAscii() & "_FORK_EPOCH"
proc getOrDefault*(info: VCRuntimeConfig, name: string,
func getOrDefault*(info: VCRuntimeConfig, name: string,
default: uint64): uint64 =
let numstr = info.getOrDefault(name, "missing")
if numstr == "missing": return default
Base10.decode(uint64, numstr).valueOr:
return default
proc getOrDefault*(info: VCRuntimeConfig, name: string, default: Epoch): Epoch =
func getOrDefault*(info: VCRuntimeConfig, name: string, default: Epoch): Epoch =
Epoch(info.getOrDefault(name, uint64(default)))
func getForkVersion(
info: VCRuntimeConfig,
consensusFork: Consensusfork): Result[Opt[Version], string] =
consensusFork: ConsensusFork): Result[Opt[Version], string] =
let key = consensusFork.forkVersionConfigKey()
let stringValue = info.getOrDefault(key, "missing")
if stringValue == "missing": return ok Opt.none(Version)

View File

@ -112,7 +112,7 @@ proc registerSyncDuty*(
tracker.syncDuties[pubkey] = until_epoch
reset(tracker.lastSyncUpdate)
proc hasSyncDuty*(
func hasSyncDuty*(
tracker: ActionTracker, pubkey: ValidatorPubKey, epoch: Epoch): bool =
epoch < tracker.syncDuties.getOrDefault(pubkey, GENESIS_EPOCH)
@ -227,7 +227,7 @@ func updateActions*(
# Update proposals
tracker.proposingSlots[epoch mod 2] = 0
for i, proposer in beacon_proposers:
for i, proposer in beaconProposers:
if proposer.isSome and proposer.get() in validatorIndices:
tracker.proposingSlots[epoch mod 2] =
tracker.proposingSlots[epoch mod 2] or (1'u32 shl i)

View File

@ -976,9 +976,9 @@ proc cmdValidatorDb(conf: DbConf, cfg: RuntimeConfig) =
startEpoch = startEpoch, endEpoch = endEpoch
let
startSlot = startEpoch.start_slot
startEpochSlot = startEpoch.start_slot
endSlot = endEpoch.start_slot + SLOTS_PER_EPOCH
blockRefs = dag.getBlockRange(startSlot, endSlot)
blockRefs = dag.getBlockRange(startEpochSlot, endSlot)
if not unaggregatedFilesOutputDir.dirExists:
try:
@ -1006,7 +1006,7 @@ proc cmdValidatorDb(conf: DbConf, cfg: RuntimeConfig) =
let tmpState = newClone(dag.headState)
var cache = StateCache()
let slot = if startSlot > 0: startSlot - 1 else: 0.Slot
let slot = if startEpochSlot > 0: startEpochSlot - 1 else: 0.Slot
if blockRefs.len > 0:
discard dag.updateState(
tmpState[], dag.atSlot(blockRefs[^1], slot).expect("block"), false, cache)

View File

@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2019-2023 Status Research & Development GmbH
# Copyright (c) 2019-2024 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -10,6 +10,6 @@
-d:"libp2p_pki_schemes=secp256k1"
--styleCheck:usages
--styleCheck:hint
--styleCheck:error
--hint[ConvFromXtoItselfNotNeeded]:off
--hint[Processing]:off

View File

@ -85,7 +85,7 @@ proc getInfo(parent_hash: Eth2Digest):
parent_hash: parent_hash,
fee_recipient: default(ExecutionAddress), # only a CL suggestion
logs_bloom: default(BloomLogs),
timestamp: parentBlockInfo.timestamp,
timestamp: parent_block_info.timestamp,
prev_randao: prev_randao,
block_number: parent_block_info.block_number,
gas_limit: DEFAULT_GAS_LIMIT,

View File

@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2022-2023 Status Research & Development GmbH
# Copyright (c) 2022-2024 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -10,6 +10,6 @@
-d:"libp2p_pki_schemes=secp256k1"
--styleCheck:usages
--styleCheck:hint
--styleCheck:error
--hint[ConvFromXtoItselfNotNeeded]:off
--hint[Processing]:off