Skip to content

fix(rpc): align Beacon API routes with spec and register missing handlers (#1579) - #1592

Open
alok-108 wants to merge 1 commit into
ReamLabs:masterfrom
alok-108:fix/beacon-api-spec-routes
Open

alok-108 wants to merge 1 commit into
ReamLabs:masterfrom
alok-108:fix/beacon-api-spec-routes

Conversation

@alok-108

@alok-108 alok-108 commented Oct 5, 2026

Copy link
Copy Markdown

What was wrong?

Several non-spec route paths and missing handler registrations in crates/rpc/beacon/ prevented standard Ethereum Beacon API compliance, resulting in 404 Not Found errors when clients (validator clients, builder relays, slashers) made standard requests:

  1. Non-spec Blinded Blocks Route: GET /eth/v1/beacon/blind_block/{block_id} was exposed instead of the spec-mandated GET /eth/v1/beacon/blinded_blocks/{block_id} (Ethereum Beacon API - getBlindedBlock).
  2. Proposer Slashings Pool Route & Method Typo: The endpoint was mapped with a typo as #[get("/beacon/pool/prposer_slashings")] (missing o), causing GET /eth/v1/beacon/pool/proposer_slashings to 404. Furthermore, OperationPool::get_all_proposer_slahsings contained a typo.
  3. Unregistered Sync Committee Selections Handler: POST /eth/v1/validator/sync_committee_selections handler was implemented in handlers/validator.rs but never registered in register_validator_routes_v1. In addition, the spec defines the request body as an array Vec<SyncCommitteeSelection>, whereas the handler accepted a single object SyncCommitteeSelection.

Closes #1579

How was it fixed?

  1. Blinded Blocks Route:
    • Changed route macro from #[get("/beacon/blind_block/{block_id}")] to #[get("/beacon/blinded_blocks/{block_id}")].
    • Renamed handler to get_blinded_block and updated its registration in routes/beacon.rs.
  2. Proposer Slashings Route & OperationPool:
    • Fixed route macro to #[get("/beacon/pool/proposer_slashings")] and updated doc comment to v1.
    • Renamed OperationPool::get_all_proposer_slahsings to get_all_proposer_slashings while retaining a #[deprecated] alias for backwards compatibility.
    • Updated calls in crates/rpc/beacon/src/handlers/pool.rs and crates/rpc/beacon/src/handlers/validator.rs.
  3. Sync Committee Selections:
    • Registered post_sync_committee_selections on register_validator_routes_v1.
    • Updated parameter to Json<Vec<SyncCommitteeSelection>> to adhere to the spec schema.
  4. Testing & Validation:
    • Added unit test in ream-operation-pool testing get_all_proposer_slashings.
    • Added integration tests in crates/rpc/beacon/src/tests.rs verifying that:
      • GET /eth/v1/beacon/pool/proposer_slashings returns 200 OK (and old /prposer_slashings returns 404).
      • POST /eth/v1/validator/sync_committee_selections returns 501 Not Implemented with vector payload (verifying registration instead of 404).
      • GET /eth/v1/beacon/blinded_blocks/{block_id} is routed properly.
    • Verified clean formatting via cargo +nightly fmt --check.
    • Verified zero clippy warnings via cargo clippy --features devnet5 -p ream-rpc-beacon -p ream-operation-pool.

To-Do

…lers (ReamLabs#1579)

Corrects multiple non-spec routes and missing handler registrations in crates/rpc/beacon:

- Correct blinded blocks GET route from /beacon/blind_block/{block_id} to /beacon/blinded_blocks/{block_id} and rename handler to get_blinded_block per Ethereum Beacon API spec.
- Fix route path typo /beacon/pool/prposer_slashings to /beacon/pool/proposer_slashings and method typo get_all_proposer_slahsings to get_all_proposer_slashings in OperationPool (retaining deprecated alias for backwards compatibility).
- Register post_sync_committee_selections in register_validator_routes_v1 and update payload parameter to Json<Vec<SyncCommitteeSelection>> to match spec.
- Add unit and integration tests covering spec routes and handler status codes.

Closes ReamLabs#1579
@alok-108

alok-108 commented Oct 5, 2026

Copy link
Copy Markdown
Author

Hey @KolbyML @Kayden-ML @shariqnaiyer, opened a fix for #1579 (route typos and the missing sync committee handler). Whenever you get a chance, could you approve the CI run? Thanks.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Non-spec route paths and missing handler registrations breaking Beacon API compliance

1 participant