Add POST builders query endpoint - #614
Conversation
| - **1** - active: `is_active_builder(state, index)` returns `True`, i.e. `builder.deposit_epoch < state.finalized_checkpoint.epoch` and `builder.withdrawable_epoch == FAR_FUTURE_EPOCH` | ||
| - **2** - exited: `builder.withdrawable_epoch != FAR_FUTURE_EPOCH` | ||
| type: integer | ||
| enum: [0, 1, 2] |
There was a problem hiding this comment.
echoing what @etan-status mentioned here #601 (comment), we might wanna follow the validators api for now and figure out a proper enum solution later, it's definitely not ideal that this api won't support ssz initially but especially for builders it should not be as problematic as there won't be that many compared to validators
There was a problem hiding this comment.
It's fairly academic.
The thing i don't like about strings also is they also bloat the json output, but it does make it easier because you don't need to decode it i guess.
Also given how hard it is to change ssz this may be many hard forks.
There was a problem hiding this comment.
may be many hard forks.
enum ssz type doesn't require a hard fork, it will be optional so once we have a well-defined enum ssz type with a spec we can start implementing this already and clients that do have it can support ssz on the validators and builders api since adding it later is backward compatible
|
addressed feedback @nflaig , not going to change teku until output is agreed on, as the status output is non trivial if we go that way. |
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation**
Implement `POST /eth/v1/beacon/states/{state_id}/builders` added to the
beacon-api spec in ethereum/beacon-APIs#614.
**Description**
- add `getStateBuilders` route, filterable by builder ids (hex encoded
public key or builder index) and statuses (`pending`, `active`,
`exited`)
- add `getBuildersLength()` to the beacon state view to enumerate the
builder registry
- returns 400 if the requested state is prior to gloas, ids that do not
match a known builder are skipped without error as per spec
- builder pubkey lookups are a linear scan over the registry, can
consider a builder pubkey cache if this becomes a performance issue
---------
Co-authored-by: Lodekeeper <258435968+lodekeeper@users.noreply.github.com>
Co-authored-by: lodekeeper <lodekeeper@users.noreply.github.com>
No description provided.