erigon icon indicating copy to clipboard operation
erigon copied to clipboard

Implement `/eth/v1/validator/beacon_committee_subscriptions`

Open Giulio2002 opened this issue 1 year ago • 0 comments

Objective

The goal of this ticket is to integrate the /eth/v1/validator/beacon_committee_subscriptions endpoint from the Ethereum Beacon API into Caplin. This integration aims to enable validators within our system to subscribe to committees for the purpose of attestation, aligning with Ethereum's consensus mechanism.

Scope

  • Integration of the Beacon Committee Subscription Endpoint: Implement the /eth/v1/validator/beacon_committee_subscriptions functionality to allow validators to subscribe and unsubscribe to beacon committees.
  • Validator Subscription Management: Ensure that the system can manage validator subscriptions efficiently, handling requests to subscribe to specific committees based on the validator's duties.
  • Compatibility and Testing: Validate the integration's compatibility with existing Ethereum Beacon Chain specifications and ensure comprehensive testing to cover various scenarios involving committee subscriptions.Documentation and Guides: Update internal documentation and guides to include information on how to use the new endpoint, detailing the request parameters, expected responses, and any error handling.

Expected Outcomes

  • Also implement /eth/v1/validator/aggregate_attestation to check if the aggregation happens and is correct.
  • the endpoint does not need to be production-ready but it needs to have unit tests, for starting out it is fine to start caplin standalone and just use curl to interact with the endpoint.

Additional Notes

  • Considerations for scalability and security should be prioritized, ensuring that the implementation can handle an increasing number of requests and validators without compromising on performance or data integrity.

  • A suggested way of implementing is to make class encapsulate the attestation aggregations and use different threads for each subnet to commit to this. here is a diagram: Screenshot 2024-03-08 at 23 13 56

  • to find the appropriate documentation for how the p2p network works see: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md

  • to find appropriate documentation for how the attestation flow works see: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/validator.md

  • for the OpenAI specs of the Beacon API: https://ethereum.github.io/beacon-APIs/#/Validator/getAggregatedAttestation

Giulio2002 avatar Mar 08 '24 22:03 Giulio2002