Skip to content

feat: implement /eth/v1/validator/sync_committee_subscriptions endpoi… - #426

Closed
bomanaps wants to merge 1 commit into
ReamLabs:masterfrom
bomanaps:feat/eth-v1-validator-sync-committee-subscriptions
Closed

feat: implement /eth/v1/validator/sync_committee_subscriptions endpoi…#426
bomanaps wants to merge 1 commit into
ReamLabs:masterfrom
bomanaps:feat/eth-v1-validator-sync-committee-subscriptions

Conversation

@bomanaps

@bomanaps bomanaps commented May 22, 2025

Copy link
Copy Markdown
Contributor

What are you trying to achieve?

closes #236

How was it implemented/fixed?

This pull request adds a handler for the Beacon API endpoint POST /eth/v1/validator/sync_committee_subscriptions.
Run node:

cargo run --bin ream node 

Make post request

curl -X POST http://localhost:5052/eth/v1/validator/sync_committee_subscriptions \
  -H "Content-Type: application/json" \
  -d '[
    {
      "validator_index": 1234,
      "sync_committee_indices": [0, 1, 2],
      "until_epoch": 100
    }
  ]'

To-Do

@bomanaps

Copy link
Copy Markdown
Contributor Author

Hello @KolbyML please can you help me review this? thanks.

@KolbyML

KolbyML commented May 22, 2025

Copy link
Copy Markdown
Contributor

Hello @KolbyML please can you help me review this? thanks.

Hi @bomanaps this PR isn't updating the subnets we are subscribed to in our Enr

@bomanaps

Copy link
Copy Markdown
Contributor Author

this PR isn't updating the subnets we are subscribed to in our Enr

Yes am currently stuck on that and I need your input because from our current implementation of update_sync_committee_subnets is incomplete because the Discv5 struct takes ownership of the CombinedKey and doesn't expose it, which is making it impossible to update the ENR without either storing a duplicate key (with performance and security implications) or modifying the discv5 crate to expose the key or provide an ENR update method, or maybe am missing something?

@bomanaps

Copy link
Copy Markdown
Contributor Author

this PR isn't updating the subnets we are subscribed to in our Enr

Yes am currently stuck on that and I need your input because from our current implementation of update_sync_committee_subnets is incomplete because the Discv5 struct takes ownership of the CombinedKey and doesn't expose it, which is making it impossible to update the ENR without either storing a duplicate key (with performance and security implications) or modifying the discv5 crate to expose the key or provide an ENR update method, or maybe am missing something?

If I keep a copy of the CombinedKey in the Discovery struct it will require CombinedKey to implement Clone, which it doesn't

@KolbyML

KolbyML commented May 22, 2025

Copy link
Copy Markdown
Contributor

this PR isn't updating the subnets we are subscribed to in our Enr

Yes am currently stuck on that and I need your input because from our current implementation of update_sync_committee_subnets is incomplete because the Discv5 struct takes ownership of the CombinedKey and doesn't expose it, which is making it impossible to update the ENR without either storing a duplicate key (with performance and security implications) or modifying the discv5 crate to expose the key or provide an ENR update method, or maybe am missing something?

You can modify the Enr like this https://docs.rs/discv5/0.9.1/discv5/struct.Discv5.html#method.enr_insert

@bomanaps

Copy link
Copy Markdown
Contributor Author

Hello @KolbyML please can you help me review this once more, thanks

@KolbyML

KolbyML commented May 26, 2025

Copy link
Copy Markdown
Contributor

@bomanaps can you rebase to fix the conflicts and make CI pass first

@bomanaps
bomanaps force-pushed the feat/eth-v1-validator-sync-committee-subscriptions branch from 0b9b7d4 to d5e2d0d Compare May 27, 2025 01:03
@bomanaps

Copy link
Copy Markdown
Contributor Author

can you rebase to fix the conflicts and make CI pass first

Done

@bomanaps
bomanaps force-pushed the feat/eth-v1-validator-sync-committee-subscriptions branch from 1e78559 to a553edc Compare May 31, 2025 02:31

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

Left some directional feedback

Comment thread crates/networking/p2p/src/network.rs Outdated
Comment thread crates/networking/p2p/src/network.rs Outdated
Comment thread crates/networking/p2p/Cargo.toml Outdated
Comment thread crates/networking/discv5/src/discovery.rs Outdated
Comment thread crates/rpc/src/types/request.rs Outdated
@bomanaps
bomanaps force-pushed the feat/eth-v1-validator-sync-committee-subscriptions branch from a553edc to b095f4f Compare June 2, 2025 12:36
@bomanaps
bomanaps requested a review from KolbyML June 2, 2025 15:33
@KolbyML

KolbyML commented Jun 7, 2025

Copy link
Copy Markdown
Contributor

@bomanaps can you rebase the PR, I should be able to give it another look when I wake up tomorrow

@bomanaps
bomanaps force-pushed the feat/eth-v1-validator-sync-committee-subscriptions branch from d42280a to 954613e Compare June 7, 2025 17:25
@bomanaps

bomanaps commented Jun 7, 2025

Copy link
Copy Markdown
Contributor Author

@bomanaps can you rebase the PR, I should be able to give it another look when I wake up tomorrow

Done

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

Left some high level feedback, feel free to ask questions

Comment thread crates/rpc/src/lib.rs Outdated
Comment thread crates/rpc/Cargo.toml
Comment thread crates/networking/p2p/src/network.rs Outdated
Comment thread crates/networking/p2p/src/network.rs Outdated
Comment thread crates/networking/p2p/src/network.rs Outdated
Comment thread crates/networking/p2p/Cargo.toml Outdated
@bomanaps
bomanaps requested a review from KolbyML June 9, 2025 19:57

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

Left some feedback

Comment thread crates/rpc/src/handlers/validator.rs Outdated
Comment thread crates/rpc/src/handlers/validator.rs Outdated
Comment thread crates/rpc/src/handlers/validator.rs Outdated
Comment thread crates/rpc/src/handlers/validator.rs Outdated
Comment thread crates/networking/p2p/src/network.rs Outdated
Comment thread crates/networking/manager/src/service.rs Outdated
Comment thread crates/networking/manager/src/service.rs Outdated
Comment thread crates/networking/manager/src/service.rs Outdated
Comment thread crates/networking/manager/src/service.rs
Comment thread crates/common/beacon_api_types/src/request.rs
@Kayden-ML Kayden-ML closed this Jun 14, 2025
@KolbyML KolbyML reopened this Jun 14, 2025
@bomanaps
bomanaps force-pushed the feat/eth-v1-validator-sync-committee-subscriptions branch from 9db85ca to 93a0b97 Compare June 21, 2025 19:27
@bomanaps
bomanaps requested a review from KolbyML June 22, 2025 00:03

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

A lot of the PR looks improved, there are a few things I need to read more deeply on my next review

Comment thread crates/common/beacon_api_types/src/request.rs
Comment thread crates/networking/discv5/src/discovery.rs Outdated
Comment thread crates/networking/manager/src/service.rs Outdated
Comment thread crates/networking/manager/src/service.rs Outdated
Comment thread crates/networking/manager/src/service.rs Outdated
Comment thread crates/rpc/src/handlers/validator.rs
Comment thread crates/rpc/src/handlers/validator.rs Outdated
Comment thread crates/rpc/src/handlers/validator.rs Outdated
Comment thread crates/rpc/src/handlers/validator.rs Outdated
Comment thread crates/rpc/src/handlers/validator.rs Outdated
@bomanaps bomanaps closed this Jun 27, 2025
@bomanaps bomanaps reopened this Jul 1, 2025
@bomanaps
bomanaps force-pushed the feat/eth-v1-validator-sync-committee-subscriptions branch from 82f84e3 to 834c87e Compare July 5, 2025 01:00
@bomanaps
bomanaps requested a review from KolbyML July 5, 2025 03:35
@KolbyML

KolbyML commented Jul 5, 2025

Copy link
Copy Markdown
Contributor

@bomanaps could you squash all the commits so CI passes

…criptions endpoint

- Added full RPC handler and tests
- Updated p2p networking and discv5 for sync committee support
- Addressed PR review comments and cleanup
@bomanaps
bomanaps force-pushed the feat/eth-v1-validator-sync-committee-subscriptions branch from 45fab7a to 23b687a Compare July 6, 2025 09:20
@bomanaps

bomanaps commented Jul 6, 2025

Copy link
Copy Markdown
Contributor Author

@bomanaps could you squash all the commits so CI passes

Done

@KolbyML KolbyML closed this Aug 24, 2025
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.

Implement /eth/v1/validator/sync_committee_subscriptions

3 participants