Skip to content

Implement PTC state getter endpoint - #10256

Open
SamAg19 wants to merge 3 commits into
sigp:unstablefrom
SamAg19:ptc-state-endpoint
Open

SamAg19 wants to merge 3 commits into
sigp:unstablefrom
SamAg19:ptc-state-endpoint

Conversation

@SamAg19

@SamAg19 SamAg19 commented Oct 7, 2026

Copy link
Copy Markdown

Issue Addressed

Addresses the following 2 points

Proposed Changes

  • Add get_beacon_states_ptc and get_beacon_states_ptc_ssz to BeaconNodeHttpClient.
  • Add PtcData and PtcQuery types. validators is a FixedVector to match the SSZ encoding mentioned in the spec for SSZ support.
  • Add the get_beacon_state_ptc handler in states.rs and register its route
  • Add tests for JSON and SSZ responses

@chong-he chong-he added ready-for-review The code is ready for review HTTP-API labels Oct 8, 2026
@chong-he chong-he mentioned this pull request Oct 8, 2026
2 tasks
Comment thread beacon_node/http_api/src/lib.rs Outdated
let get_beacon_state_proposer_lookahead =
states::get_beacon_state_proposer_lookahead(beacon_states_path.clone());

// `GET /eth/v1/beacon/states/{state_id}/ptc`

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.

nit: we can just have this to maintaining continuity

Suggested change
// `GET /eth/v1/beacon/states/{state_id}/ptc`
// `GET /beacon/states/{state_id}/ptc`

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed 38fef29

}

self
}

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.

We can have more tests to enforce 400 responses. exercising pre-gloas behavior and PTC window.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed 38fef29

Test has been written in /http_api/tests/fork_tests.rs

@hopinheimer hopinheimer 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.

Overall looks pretty good. Rounding up the tests would be nice.

This branch has not been deployed

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

Labels

gloas 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