Skip to content

Comments

Implement proposer lookahead endpoint#8815

Open
romeoscript wants to merge 6 commits intosigp:unstablefrom
romeoscript:implement-proposer-lookahead-endpoint
Open

Implement proposer lookahead endpoint#8815
romeoscript wants to merge 6 commits intosigp:unstablefrom
romeoscript:implement-proposer-lookahead-endpoint

Conversation

@romeoscript
Copy link

Issue Addressed

closes #8809

Proposed Changes

Implement GET /eth/v1/beacon/states/{state_id}/proposer_lookahead (beacon-APIs#565). Returns the proposer lookahead from Fulu+ states; 400 for pre-Fulu. Includes integration test.

Additional Info

Follows the existing pending_consolidations endpoint pattern.

@michaelsproul michaelsproul added HTTP-API ready-for-review The code is ready for review labels Feb 15, 2026
finalized,
data,
)
.map(|res| warp::reply::json(&res).into_response())
Copy link
Member

Choose a reason for hiding this comment

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

This endpoint also need to support SSZ responses

https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getProposerLookahead

e.g:

I noticed that a few of the existing endpoints (including pending_consolidations) aren't fully spec compliant either, we could fix those in a separate PR.

Copy link
Author

Choose a reason for hiding this comment

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

i've added the SSZ response , also about the pending_consolidations can you create an Issue for it ? so i'd work on it

Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

Looks good! Just a small comment on missing SSZ support.

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Feb 16, 2026
@romeoscript romeoscript force-pushed the implement-proposer-lookahead-endpoint branch from 498be71 to de798df Compare February 16, 2026 12:32
@jimmygchen jimmygchen added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Feb 17, 2026
|state, execution_optimistic, finalized| {
let Ok(lookahead) = state.proposer_lookahead() else {
return Err(warp_utils::reject::custom_bad_request(
"Proposer lookahead not available".to_string(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

state.proposer_lookahead only returns error when the state is pre-Fulu, the error can say that to be more informative

@romeoscript romeoscript force-pushed the implement-proposer-lookahead-endpoint branch from de798df to 2f57ab4 Compare February 19, 2026 11:47
self.get_fork_contextual(path, |fork| fork)
.await
.map(|opt| opt.map(BeaconResponse::ForkVersioned))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a test too for the SSZ variant?

Copy link
Author

Choose a reason for hiding this comment

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

yh , done @dapplion

- Add get_beacon_states_proposer_lookahead_ssz client method
- Add test_beacon_states_proposer_lookahead_ssz test
- Invoke SSZ test in beacon_get_state_info_fulu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HTTP-API ready-for-review The code is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants