Endpoint for state RANDAO mix#242
Conversation
djrtwo
left a comment
There was a problem hiding this comment.
should there be a bound on state accessor or is it fine/easy to do for any depth?
Like the other state APIs it depends on the node's configuration & pruning settings. In Lighthouse's default config these queries will be fast close to the head, and unavailable for most historic states unless the user has opted into reconstructing and storing them (in which case they could be slow or fast). |
cbc6958 to
f3d5815
Compare
|
This is ready for review again |
|
Any chance you could also return the beacon node's current slot in the response? Otherwise you may not be receiving the randao you're expecting. |
f3d5815 to
21611a2
Compare
|
@riposteX For consistency with the other state APIs I'd prefer to leave the For block building there's also work to standardise a new event type with all the required information: #244. |
## Issue Addressed ethereum/beacon-APIs#241 ethereum/beacon-APIs#242 ## Proposed Changes Implement two new endpoints for fetching blinded blocks and RANDAO mixes. Co-authored-by: realbigsean <sean@sigmaprime.io>
## Issue Addressed ethereum/beacon-APIs#241 ethereum/beacon-APIs#242 ## Proposed Changes Implement two new endpoints for fetching blinded blocks and RANDAO mixes. Co-authored-by: realbigsean <sean@sigmaprime.io>
## Issue Addressed ethereum/beacon-APIs#241 ethereum/beacon-APIs#242 ## Proposed Changes Implement two new endpoints for fetching blinded blocks and RANDAO mixes. Co-authored-by: realbigsean <sean@sigmaprime.io>
## Issue Addressed ethereum/beacon-APIs#241 ethereum/beacon-APIs#242 ## Proposed Changes Implement two new endpoints for fetching blinded blocks and RANDAO mixes. Co-authored-by: realbigsean <sean@sigmaprime.io>
## Issue Addressed ethereum/beacon-APIs#241 ethereum/beacon-APIs#242 ## Proposed Changes Implement two new endpoints for fetching blinded blocks and RANDAO mixes. Co-authored-by: realbigsean <sean@sigmaprime.io>
Add an endpoint to fetch the RANDAO mix from a given state at some epoch.
The endpoint path is
/eth/v1/beacon/states/{state_id}/randao.With the merge the RANDAO mix has taken on increased significance, as it is embedded in execution payloads and available in the EVM.
Currently for tools that want to access the
prev_randaofrom outside the beacon node for the purposes of payload construction or validation, they must load an entire beacon state using the debug endpoint. This is prohibitively slow for something that should be fast with the right API.With this API, they can immediately get access to the correct
prev_randaovalue using/eth/v1/beacon/states/head/randaoprior to block construction (or can use thestate_idcorresponding to the parent block).