Skip to content

Add builders endpoints under /eth/v1/beacon/states/{state_id}#610

Open
potuz wants to merge 1 commit into
ethereum:masterfrom
potuz:builders-endpoint
Open

Add builders endpoints under /eth/v1/beacon/states/{state_id}#610
potuz wants to merge 1 commit into
ethereum:masterfrom
potuz:builders-endpoint

Conversation

@potuz

@potuz potuz commented May 21, 2026

Copy link
Copy Markdown

Add builder endpoints similar to the validator endpoints. This is useful for builder clients to track and resolve their builder indices, status, balances etc when preparing bids.

get:
operationId: "getStateBuilder"
summary: "Get builder from state by id"
description: "Returns builder specified by state and id or public key along with status and balance."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
description: "Returns builder specified by state and id or public key along with status and balance."
description: "Returns builder specified by state and builder id."

- name: state_id
in: path
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/StateId'
- name: id

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getStateBuilder calls it builder_id maybe we should call it that

@rolfyone rolfyone added the Gloas api's needed in Gloas fork. label May 25, 2026

@nflaig nflaig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to mirror the validator apis 1:1, especially not the validator apis we know have a bad design (eg. using non spec containers).

There is a big difference in how builders work compared to validators and how consumers will use the api.

  • we don't expect builders to be nearly as many as validators, so fetching all builders always will likely be fine
  • even if we don't wanna fetch all builders, having getStateBuilders as defined in this PR would be sufficient as it allows to pass the pubkey
  • in contrast to validators, there should not be the use case to fetch thousands of records, it will likely just be a few at most, so returning the full Builder object should always be fine

There is likely more, but I think we can have a single api here which allows consumers to fetch all builders, or filter them by pubkey (or index) to just get the builders they care about.

Comment thread types/api.yaml
$ref: "./primitive.yaml#/Gwei"
description: "Current builder balance in gwei."
status:
$ref: "#/BuilderStatus"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am definitely against introducing a custom type like this with a status field, especially because the status in case of builders it much simpler compared to validators

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe if we can conclude #601 this is fine, but I really like to avoid having another endpoint that cannot support ssz

the argument for the status in the response is to have all computation done on the beacon node side which is also valid and simplifies clients consuming the response

@@ -0,0 +1,143 @@
get:
operationId: "getStateBuilderBalances"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need a separate api for balances? seems overkill

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not against being easily able to get balances but we can probably just retain the 'post', and remove the get...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why does it need to be a separate endpoint? we can just get that by accessing builder.balance

this is in contrast to validators, as balances are separatly stored in the state via state.balances which is different from validator.effective_balance (actual balance vs. effective balance)

@@ -0,0 +1,74 @@
post:
operationId: "postStateBuilderIdentities"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this shouldn't be required, what's the most amount of builders a consumer needs to query? returning the full Builder spec object seems fine to me

@@ -0,0 +1,60 @@
get:
operationId: "getStateBuilder"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this? I feel like this was already a mistake in the validators api, can't we just have getStateBuilders?

@@ -0,0 +1,168 @@
get:
operationId: "getStateBuilders"

@nflaig nflaig May 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having both the get and post endpoint is too much, we should decide on whether we need post here, but if we wanna be on the safe side, likely best to just go with post here

@nflaig

nflaig commented May 29, 2026

Copy link
Copy Markdown
Member

I recommend closing this in favor of #614

@rolfyone

rolfyone commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@potuz happy with #614 as an alternative? Wondering if we can close this one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gloas api's needed in Gloas fork.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants