-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add /eth/v1/beacon/deposit_snapshot
endpoint
#13514
Conversation
/eth/v1/beacon/deposit_snapshot
endpoint
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.
SSZ support missing
api/server/structs/conversions.go
Outdated
func DepositSnapshotFromConsensus(ds *eth.DepositSnapshot) *DepositSnapshot { | ||
finalized := make([]string, 0, len(ds.Finalized)) | ||
for i, f := range ds.Finalized { | ||
if i >= depositsnapshot.DepositContractDepth { |
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.
This function should not have logic in it, it should purely convert between types. You should check the length of the returned value inside the handler. Although I find it peculiar that we add constraints to a returned value, I guess it might be OK as an indication that we have a bug somewhere in the deposit snapshot code.
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.
You are right, I have modified it to check ahead of time as if the length of finalized exceeds the deposit contract depth we likely have an invalid snapshot
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This PR adds the missing endpoint to retrieve deposit snapshot data.
https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getDepositSnapshot