-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Endpoint for state RANDAO mix #242
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
## 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_randao
from 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_randao
value using/eth/v1/beacon/states/head/randao
prior to block construction (or can use thestate_id
corresponding to the parent block).