Implement proposer lookahead endpoint#8815
Implement proposer lookahead endpoint#8815romeoscript wants to merge 6 commits intosigp:unstablefrom
Conversation
| finalized, | ||
| data, | ||
| ) | ||
| .map(|res| warp::reply::json(&res).into_response()) |
There was a problem hiding this comment.
This endpoint also need to support SSZ responses
https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getProposerLookahead
e.g:
lighthouse/beacon_node/http_api/src/lib.rs
Lines 1551 to 1552 in fc552a6
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.
There was a problem hiding this comment.
i've added the SSZ response , also about the pending_consolidations can you create an Issue for it ? so i'd work on it
jimmygchen
left a comment
There was a problem hiding this comment.
Looks good! Just a small comment on missing SSZ support.
498be71 to
de798df
Compare
| |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(), |
There was a problem hiding this comment.
state.proposer_lookahead only returns error when the state is pre-Fulu, the error can say that to be more informative
de798df to
2f57ab4
Compare
| self.get_fork_contextual(path, |fork| fork) | ||
| .await | ||
| .map(|opt| opt.map(BeaconResponse::ForkVersioned)) | ||
| } |
There was a problem hiding this comment.
Can you add a test too for the SSZ variant?
- 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
…ser-lookahead-endpoint
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.