Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions beacon_chain/consensus_object_pools/attestation_pool.nim
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func candidateIdx(
Opt[int] =
static: doAssert pool.phase0Candidates.len == pool.electraCandidates.len

let poolLength = if candidateIdxtype == CandidateIdxType.electraIdx:
let poolLength = if candidateIdxType == CandidateIdxType.electraIdx:
pool.electraCandidates.lenu64 else: pool.phase0Candidates.lenu64

if slot >= pool.startingSlot and
Expand Down Expand Up @@ -1033,10 +1033,10 @@ proc getElectraAttestationsForBlock*(
var e2 = entry.data
e2.index = 0
e2
key = (hash_tree_root(entry2), entry.data.slot.Slot)
key = (hash_tree_root(entry2), entry.data.slot)
newAtt = entry[].toElectraAttestation(entry[].aggregates[j])

candidatesPerBlock.mGetOrPut(key, @[]).add(newAtt)
candidatesPerBlock.mgetOrPut(key, @[]).add(newAtt)

# Update cache so that the new votes are taken into account when updating
# the score below
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 @@ -274,7 +274,7 @@ proc checkWeakSubjectivityCheckpoint(

from ./spec/state_transition_block import kzg_commitment_to_versioned_hash

proc isSlotWithinWeakSubjectivityPeriod(dag: ChainDagRef, slot: Slot): bool =
proc isSlotWithinWeakSubjectivityPeriod(dag: ChainDAGRef, slot: Slot): bool =
let
checkpoint = Checkpoint(
epoch: epoch(getStateField(dag.headState, slot)),
Expand Down
6 changes: 3 additions & 3 deletions beacon_chain/rpc/rest_rewards_api.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2018-2024 Status Research & Development GmbH
# Copyright (c) 2018-2025 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).
Expand Down Expand Up @@ -169,11 +169,11 @@ proc installRewardsApiHandlers*(router: var RestRouter, node: BeaconNode) =

let response =
withState(tmpState[]):
let total_active_balance =
get_total_active_balance(forkyState.data, cache)
var resp: seq[RestSyncCommitteeReward]
when consensusFork > ConsensusFork.Phase0:
let
total_active_balance =
get_total_active_balance(forkyState.data, cache)
keys =
block:
var res: HashSet[ValidatorPubKey]
Expand Down
8 changes: 4 additions & 4 deletions beacon_chain/spec/forks_light_client.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2023-2024 Status Research & Development GmbH
# Copyright (c) 2023-2025 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).
Expand Down Expand Up @@ -958,13 +958,13 @@ func migrateToDataFork*(
discard
elif newKind < x.kind:
# Downgrade not supported, re-initialize
x = ForkedLightClientStore(kind: newKind)
x = static(ForkedLightClientStore(kind: newKind))
else:
# Upgrade to Altair
when newKind >= LightClientDataFork.Altair:
if x.kind == LightClientDataFork.None:
x = ForkedLightClientStore(
kind: LightClientDataFork.Altair)
x = static(ForkedLightClientStore(
kind: LightClientDataFork.Altair))

# Upgrade to Capella
when newKind >= LightClientDataFork.Capella:
Expand Down
6 changes: 3 additions & 3 deletions beacon_chain/validators/beacon_validators.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1011,16 +1011,16 @@ proc getBuilderBid[
return err unsignedBlindedBlock.error()

template execution_requests: untyped =
unsignedBlindedBlock.get.message.body.execution_requests
unsignedBlindedBlock.get.message.body.execution_requests
when SBBB is deneb_mev.SignedBlindedBeaconBlock:
return ok(BuilderBid[SBBB](
return ok(BuilderBid[SBBB](
blindedBlckPart: unsignedBlindedBlock.get,
executionRequests: default(ExecutionRequests),
executionPayloadValue: bidValue,
consensusBlockValue: consensusValue))
elif SBBB is electra_mev.SignedBlindedBeaconBlock or
SBBB is fulu_mev.SignedBlindedBeaconBlock:
return ok(BuilderBid[SBBB](
return ok(BuilderBid[SBBB](
blindedBlckPart: unsignedBlindedBlock.get,
executionRequests: execution_requests,
executionPayloadValue: bidValue,
Expand Down
6 changes: 3 additions & 3 deletions config.nims
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2020-2024 Status Research & Development GmbH
# Copyright (c) 2020-2025 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).
Expand Down Expand Up @@ -114,8 +114,8 @@ elif defined(macosx) and defined(arm64):
switch("passC", "-mcpu=apple-m1")
switch("passL", "-mcpu=apple-m1")
elif defined(riscv64):
# riscv64 needs specification of ISA with extensions. 'gc' is widely supported
# and seems to be the minimum extensions needed to build.
# riscv64 needs specification of ISA with extensions. 'gc' is widely supported
# and seems to be the minimum extensions needed to build.
switch("passC", "-march=rv64gc")
switch("passL", "-march=rv64gc")
else:
Expand Down
6 changes: 3 additions & 3 deletions tests/consensus_spec/test_fixture_kzg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ proc runComputeCellsTest(suiteName, suitePath, path: string) =
if p[].isErr:
check output.kind == JNull
else:
let p_val = p[].get
let p_val = newClone p[].get
for i in 0..<len(p[].get):
check p_val[i].bytes == fromHex[2048](output[i].getStr).get
check p_val[][i].bytes == fromHex[2048](output[i].getStr).get

proc runComputeCellsAndKzgProofsTest(suiteName, suitePath, path: string) =
let relativePathComponent = path.relativeTestPathComponent(suitePath)
Expand All @@ -240,7 +240,7 @@ proc runComputeCellsAndKzgProofsTest(suiteName, suitePath, path: string) =
if p[].isErr:
check output.kind == JNull
else:
let p_val = p[].get
let p_val = newClone p[].get
for i in 0..<kzg_abi.CELLS_PER_EXT_BLOB:
check p_val.cells[i].bytes == fromHex[2048](output[0][i].getStr).get
check p_val.proofs[i].bytes == fromHex[48](output[1][i].getStr).get
Expand Down
2 changes: 1 addition & 1 deletion tests/test_keymanager_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ proc addDynamicValidator(kmtest: KeymanagerToTest,
pubkey: pubkey,
remotes: @[
RemoteSignerInfo(
url: HttpHostUri(HttpHostUri(parseUri("http://127.0.0.1"))),
url: HttpHostUri(parseUri("http://127.0.0.1")),
pubkey: pubkey
)
],
Expand Down
17 changes: 6 additions & 11 deletions tests/test_sync_committee_pool.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2021-2024 Status Research & Development GmbH
# Copyright (c) 2021-2025 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).
Expand Down Expand Up @@ -176,11 +176,7 @@ suite "Sync committee pool":
let
fork = altairFork(cfg)
genesis_validators_root = eth2digest(@[5.byte, 6, 7])

privkey1 = MockPrivKeys[1.ValidatorIndex]
privkey2 = MockPrivKeys[2.ValidatorIndex]
privkey3 = MockPrivKeys[3.ValidatorIndex]
privkey4 = MockPrivKeys[4.ValidatorIndex]
privkey = MockPrivKeys[1.ValidatorIndex]

bid1 = BlockId(slot: Slot(100), root: eth2digest(@[1.byte]))
bid2 = BlockId(slot: Slot(101), root: eth2digest(@[1.byte, 2]))
Expand All @@ -190,16 +186,15 @@ suite "Sync committee pool":
subcommittee2 = SyncSubcommitteeIndex(1)

sig1 = get_sync_committee_message_signature(
fork, genesis_validators_root, bid1.slot, bid1.root, privkey1)
fork, genesis_validators_root, bid1.slot, bid1.root, privkey)
sig2 = get_sync_committee_message_signature(
fork, genesis_validators_root, bid2.slot, bid2.root, privkey1)
fork, genesis_validators_root, bid2.slot, bid2.root, privkey)
sig3 = get_sync_committee_message_signature(
fork, genesis_validators_root, bid3.slot, bid3.root, privkey1)
fork, genesis_validators_root, bid3.slot, bid3.root, privkey)
sig4 = get_sync_committee_message_signature(
fork, genesis_validators_root, bid3.slot, bid2.root, privkey1)
fork, genesis_validators_root, bid3.slot, bid2.root, privkey)

# Inserting sync committee messages
#
pool.addSyncCommitteeMessage(
bid1.slot, bid1, 1, sig1, subcommittee1, @[1'u64])
pool.addSyncCommitteeMessage(
Expand Down
Loading