Skip to content

Add PTC state endpoint - #657

Merged
nflaig merged 5 commits into
masterfrom
nflaig/ptc-state-endpoint
Oct 7, 2026
Merged

nflaig merged 5 commits into
masterfrom
nflaig/ptc-state-endpoint

Conversation

@nflaig

@nflaig nflaig commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Adds GET /eth/v1/beacon/states/{state_id}/ptc to retrieve the ordered PTC for a slot without fetching the full state.

Returns the slot and validator indices, preserving duplicates. Defaults to the state's slot and rejects pre-Gloas slots and slots outside the state's PTC window.

Closes #623

@nflaig nflaig added the Gloas api's needed in Gloas fork. label Sep 26, 2026
@nflaig
nflaig marked this pull request as ready for review September 26, 2026 14:58
Comment thread beacon-node-oapi.yaml
$ref: "./apis/beacon/states/committee.yaml"
/eth/v1/beacon/states/{state_id}/sync_committees:
$ref: "./apis/beacon/states/sync_committees.yaml"
/eth/v1/beacon/states/{state_id}/ptc:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

alternatively, or in addition could add a /eth/v1/beacon/states/{state_id}/ptc_window endpoint, similar to the existing /proposer_lookahead endpoint

Comment thread apis/beacon/states/ptc.yaml

@james-prysm james-prysm left a comment

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.

LGTM

@nflaig
nflaig merged commit 64c5ff6 into master Oct 7, 2026
3 checks passed
@nflaig
nflaig deleted the nflaig/ptc-state-endpoint branch October 7, 2026 16:49
nflaig added a commit to ChainSafe/lodestar that referenced this pull request Oct 7, 2026
**Motivation**

Implement ethereum/beacon-APIs#657 and SSZ
support from ethereum/beacon-APIs#661 so
consumers can retrieve the PTC for a slot without fetching the full
state.

**Description**

- add the endpoint to the API client and beacon node with JSON and SSZ
responses
- preserve committee order and duplicates, default to the state's slot
and validate the fork and PTC window
- cover the endpoint with client/server tests and focused handler tests
nflaig added a commit that referenced this pull request Oct 7, 2026
Adds SSZ responses to `GET /eth/v1/beacon/states/{state_id}/ptc`,
encoding `slot` and `validators` in a container, following the validator
balances endpoint.

Follow-up to #657.
allpacat pushed a commit to allpacat/prysm that referenced this pull request Oct 9, 2026
…s#17641)

**What type of PR is this?**

Feature

**What does this PR do? Why is it needed?**

- Implements
[ethereum/beacon-APIs#657](ethereum/beacon-APIs#657):
returns the payload timeliness committee for the requested slot from the
given state, read from the state's PTC window via the existing `get_ptc`
getter.
- The slot defaults to the state's slot; pre-Gloas states and slots and
slots outside the window return 400.

**Which issue(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
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.

Gloas: add an endpoint to retrieve the PTC (Payload Timeliness Committee) for a slot

3 participants