-
Notifications
You must be signed in to change notification settings - Fork 293
Description
Describe the bug
Hello Developers,
I am currently conducting API testing on an Electra PoS devnet chain and have observed inconsistencies in the Beacon-API
responses across different CL clients: Prysm, Lighthouse, Nimbus, Lodestar, and Grandine.
Specifically, when testing the endpoint getSyncCommitteeRewards
, I noticed that Nimbus is returning 8 identical rewards for the same validator_index
, which is not an aggregation and differs from the behavior of other CL clients. This issue is inconsistent with the expected behavior outlined in the SPEC.
This is the results from all CL clients:
# nimbus
{"data": [{"reward": "-177", "validator_index": "2"}, {"reward": "-177", "validator_index": "2"}, {"reward": "-177", "validator_index": "2"}, {"reward": "-177", "validator_index": "2"}, {"reward": "-177", "validator_index": "2"}, {"reward": "-177", "validator_index": "2"}, {"reward": "-177", "validator_index": "2"}, {"reward": "-177", "validator_index": "2"}], "execution_optimistic": false, "finalized": false}
# prysm
{"data": [{"reward": "-1416", "validator_index": "2"}], "execution_optimistic": false, "finalized": false}
# lighthouse
{"data": [{"reward": "-1416", "validator_index": "2"}], "execution_optimistic": false, "finalized": false}
# teku
{"data": [{"reward": "-1416", "validator_index": "2"}], "execution_optimistic": false, "finalized": false}
# lodestar
{"data": [{"reward": "-1416", "validator_index": "2"}], "execution_optimistic": false, "finalized": false}
# grandine
{"data": [{"reward": "-1416", "validator_index": "2"}], "execution_optimistic": false, "finalized": false}
Possible related implementation:
nimbus-eth2/beacon_chain/rpc/rest_rewards_api.nim
Lines 170 to 197 in 660ebee
let response = | |
withState(tmpState[]): | |
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] | |
for item in idents: | |
case item.kind | |
of ValidatorQueryKind.Index: | |
let vindex = item.index.toValidatorIndex().valueOr: | |
case error | |
of ValidatorIndexError.TooHighValue: | |
return RestApiResponse.jsonError( | |
Http400, TooHighValidatorIndexValueError) | |
of ValidatorIndexError.UnsupportedValue: | |
return RestApiResponse.jsonError( | |
Http500, UnsupportedValidatorIndexValueError) | |
if uint64(vindex) >= lenu64(forkyState.data.validators): | |
return RestApiResponse.jsonError( | |
Http400, ValidatorNotFoundError) | |
res.incl(forkyState.data.validators.item(vindex).pubkey) | |
of ValidatorQueryKind.Key: | |
res.incl(item.key) | |
res |
Thanks for your time!
To Reproduce
Steps to reproduce the behavior:
curl -X POST http://127.0.0.1:2600/eth/v1/beacon/rewards/sync_committee/head -d '["2"]' -H "Content-Type: application/json"
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Version: statusim/nimbus-eth2:multiarch-v25.7.1