Skip to content

getStateRandao can not query old historic value of the RANDAO mix #15649

@Alleysira

Description

@Alleysira

Describe the bug

Hi there,

This appears to be a discompliance of Prysm implementation of endpoint getStateRandao with the specification.

According to the Beacon-API spec:

By adjusting the state_id parameter you can query for any historic value of the RANDAO mix.

However, when querying the state from an older history (e.g., in slot 431, epoch 13, querying slot 31 from epoch 0), I receive the following error:

{"message":"Epoch is out of range for the randao mixes of the state","code":400}

In contrast, other clients like Nimbus, Teku, and Lodestar successfully return the RANDAO mix for the same query:

{"execution_optimistic":false,"finalized":true,"data":{"randao":"0x9504f7c08724a673793669c15bb6b4b77d456ae0d216cfe4868a41e798d70244"}}

Related implementation in Prysm:

if epoch > stEpoch || uint64(epoch) < randaoEpochLowerBound+1 {
httputil.HandleError(w, "Epoch is out of range for the randao mixes of the state", http.StatusBadRequest)
return
}

Thanks for your time!

Has this worked before in a previous version?

N/A

🔬 Minimal Reproduction

curl -s -X GET "http://127.0.0.1:$port/eth/v1/beacon/states/31/randao" -H "Content-Type: application/json" -d {}

Error

{"message":"Epoch is out of range for the randao mixes of the state","code":400}

Platform(s)

Linux (x86)

What version of Prysm are you running? (Which release)

Prysm/v6.0.4 (linux amd64)

Anything else relevant (validator index / public key)?

gcr.io/offchainlabs/prysm/beacon-chain:HEAD-278b79
gcr.io/offchainlabs/prysm/validator:HEAD-278b79

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions