mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-26 06:21:38 +00:00
fix /eth/v1/beacon/rewards/block/{block_id} sync_aggregate value (#6829)
* fix /eth/v1/beacon/rewards/block/{block_id} sync_aggregate value * adjust tests * copyright year linting
This commit is contained in:
parent
8a494e9c34
commit
4cca50873e
@ -850,6 +850,7 @@ proc process_sync_aggregate*(
|
||||
|
||||
# Apply participant and proposer rewards
|
||||
let indices = get_sync_committee_cache(state, cache).current_sync_committee
|
||||
var total_proposer_reward: Gwei
|
||||
|
||||
for i in 0 ..< min(
|
||||
state.current_sync_committee.pubkeys.len,
|
||||
@ -858,10 +859,11 @@ proc process_sync_aggregate*(
|
||||
if sync_aggregate.sync_committee_bits[i]:
|
||||
increase_balance(state, participant_index, participant_reward)
|
||||
increase_balance(state, proposer_index, proposer_reward)
|
||||
increase_balance(total_proposer_reward, proposer_reward)
|
||||
else:
|
||||
decrease_balance(state, participant_index, participant_reward)
|
||||
|
||||
ok(proposer_reward)
|
||||
ok(total_proposer_reward)
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/bellatrix/beacon-chain.md#process_execution_payload
|
||||
proc process_execution_payload*(
|
||||
|
@ -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).
|
||||
@ -149,9 +149,9 @@ suite baseDescription & "Sync Aggregate " & preset():
|
||||
preState: var altair.BeaconState, syncAggregate: SyncAggregate):
|
||||
Result[void, cstring] =
|
||||
var cache: StateCache
|
||||
doAssert (? process_sync_aggregate(
|
||||
discard ? process_sync_aggregate(
|
||||
preState, syncAggregate, get_total_active_balance(preState, cache),
|
||||
{}, cache)) > 0.Gwei
|
||||
{}, cache)
|
||||
ok()
|
||||
|
||||
for path in walkTests(OpSyncAggregateDir):
|
||||
|
@ -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).
|
||||
@ -174,9 +174,9 @@ suite baseDescription & "Sync Aggregate " & preset():
|
||||
preState: var bellatrix.BeaconState, syncAggregate: SyncAggregate):
|
||||
Result[void, cstring] =
|
||||
var cache: StateCache
|
||||
doAssert (? process_sync_aggregate(
|
||||
discard ? process_sync_aggregate(
|
||||
preState, syncAggregate, get_total_active_balance(preState, cache),
|
||||
{}, cache)) > 0.Gwei
|
||||
{}, cache)
|
||||
ok()
|
||||
|
||||
for path in walkTests(OpSyncAggregateDir):
|
||||
|
@ -1,5 +1,5 @@
|
||||
# beacon_chain
|
||||
# Copyright (c) 2022-2024 Status Research & Development GmbH
|
||||
# Copyright (c) 2022-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).
|
||||
@ -191,9 +191,9 @@ suite baseDescription & "Sync Aggregate " & preset():
|
||||
preState: var capella.BeaconState, syncAggregate: SyncAggregate):
|
||||
Result[void, cstring] =
|
||||
var cache: StateCache
|
||||
doAssert (? process_sync_aggregate(
|
||||
discard ? process_sync_aggregate(
|
||||
preState, syncAggregate, get_total_active_balance(preState, cache),
|
||||
{}, cache)) > 0.Gwei
|
||||
{}, cache)
|
||||
ok()
|
||||
|
||||
for path in walkTests(OpSyncAggregateDir):
|
||||
|
@ -1,5 +1,5 @@
|
||||
# beacon_chain
|
||||
# Copyright (c) 2022-2024 Status Research & Development GmbH
|
||||
# Copyright (c) 2022-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).
|
||||
@ -193,9 +193,9 @@ suite baseDescription & "Sync Aggregate " & preset():
|
||||
preState: var deneb.BeaconState, syncAggregate: SyncAggregate):
|
||||
Result[void, cstring] =
|
||||
var cache: StateCache
|
||||
doAssert (? process_sync_aggregate(
|
||||
discard ? process_sync_aggregate(
|
||||
preState, syncAggregate, get_total_active_balance(preState, cache),
|
||||
{}, cache)) > 0.Gwei
|
||||
{}, cache)
|
||||
ok()
|
||||
|
||||
for path in walkTests(OpSyncAggregateDir):
|
||||
|
@ -1,5 +1,5 @@
|
||||
# beacon_chain
|
||||
# Copyright (c) 2024 Status Research & Development GmbH
|
||||
# Copyright (c) 2024-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).
|
||||
@ -245,9 +245,9 @@ suite baseDescription & "Sync Aggregate " & preset():
|
||||
preState: var electra.BeaconState, syncAggregate: SyncAggregate):
|
||||
Result[void, cstring] =
|
||||
var cache: StateCache
|
||||
doAssert (? process_sync_aggregate(
|
||||
discard ? process_sync_aggregate(
|
||||
preState, syncAggregate, get_total_active_balance(preState, cache),
|
||||
{}, cache)) > 0.Gwei
|
||||
{}, cache)
|
||||
ok()
|
||||
|
||||
for path in walkTests(OpSyncAggregateDir):
|
||||
|
Loading…
x
Reference in New Issue
Block a user