This issue tracks the implementation of the standard Eth2 API at https://github.com/ethereum/eth2.0-APIs.
Note: this issue is assuming that #1569 has already been merged into master.
The standard is mostly implemented in #1569, however there are still some endpoints missing. Most notably, SSE endpoints have not been implemented.
This section documents the progress of each API endpoint. An endpoint should only be marked as complete if it is 100% complete, with nothing else to do.
status field.It would be nice to have /eth/v1/node/peers soon, as it's used by eth2stats
It would be nice to have
/eth/v1/node/peerssoon, as it's used by eth2stats
Yes, I've started work on it
Something else I noticed while using the API:
The /eth/v1/beacon/states/{state_id}/validators endpoint doesn't support filtering by validator ID or status, and the statuses returned are Lighthouse enum names, not the status strings from the spec. For example, the query /eth/v1/beacon/states/head/validators?status=active_slashed&status=exited_slashed returns:
{
"data": [
{
"index": "0",
"balance": "31760402067",
"status": "Active",
"validator": {
"pubkey": "0x8fcf28896a85e5e76ee9e508438e23e7253da1a23a6501e3a7d56182520dbcf4cdb44af3267318188f1f4168342146da",
"withdrawal_credentials": "0x0010361af430aa7ab4a9567eaaca50ec5e02315ca1513d9ee8d73bde96370091",
"effective_balance": 31000000000,
"slashed": false,
"activation_eligibility_epoch": 0,
"activation_epoch": 0,
"exit_epoch": 18446744073709552000,
"withdrawable_epoch": 18446744073709552000
}
},
...
]
}
The relevant bit of code is:
We need /eth/v1/validator/duties/proposer/{epoch} to also work for historical epochs for the explorer.
statuses returned are Lighthouse enum names, not the status strings from the spec
I'm working to update the spec for this: https://github.com/ethereum/eth2.0-APIs/pull/94#issuecomment-708110821 We will indeed need to switch to strings once that's finalized.
We need
/eth/v1/validator/duties/proposer/{epoch}to also work for historical epochs for the explorer.
Wanted to add my support for this, as well as the same for /eth/v1/beacon/states/{stateid}/committees. An example of where this is useful beyond explorers: ethdo has a block info command that dumps information about a block. The committees are required to unpick the aggregation bits in the block's attestations and show who attested for what.
I'd expand this to suggest that all data under /eth/v1/beacon/states and /eth/v1/beacon/blocks should allow arbitrarily far back state/block IDs. If the node doesn't have the data it can spit back a 404, but for data that can be retrieved or reconstituted it is very handy to be able to do so.
We need
/eth/v1/validator/duties/proposer/{epoch}to also work for historical epochs for the explorer.
Just want to throw my weight behind this -- apparently this endpoint is required for having a block explorer work with lighthouse, and I would very much like us to be able to have lighthouse based block explorers as a backup to prysm on launch.
I've just added historical lookups for /eth/v1/validator/duties/proposer/{epoch} to #1831 馃憤
@paulhauner this endpoint https://ethereum.github.io/eth2.0-APIs/#/Validator/getAttesterDuties should accept POST request, but your implementation doesn't do so. I use openapi generate tool to generate API client based on that openapi.
@roman-blox this will be updated with #1831
@realbigsean do you have any ETA of this PR?
@realbigsean one more issue. This generate tool generates multiple structures with the same name. This affects the block already redeclared error. Do you know how to fix that?
hello, we need /eth/v1/beacon/states/{state_id}/validator_balances to realize the pool function, it's not work when I pass the <slot>, <hex encoded stateRoot with 0x prefix>
@winlin if you're querying an old slot or state root, the queries can take a while to complete, but they should be working
Although we may not be exactly on spec, the spec is not yet stable and is still being modified. As such, I think we've achieved the goal of this issue and we can close it.
We can open new issues as we learn about spec changes or bugs.
Well done @realbigsean for getting this across the line!
Most helpful comment
Although we may not be exactly on spec, the spec is not yet stable and is still being modified. As such, I think we've achieved the goal of this issue and we can close it.
We can open new issues as we learn about spec changes or bugs.
Well done @realbigsean for getting this across the line!