Skip to content

Inconsistent getSyncCommitteeRewards responses for reward #7452

@Alleysira

Description

@Alleysira

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions