Caplin: Add sync committees aggregation
Sync Committee Contribution pooling
First of all, a distinction:
- Sync Committee Messages are single unaggregated messages from a specific validator
- Sync Committee Contributions are aggregated messages from many validators.
We get these 2 messages from 2 different gossip sources, and then after validating the Gossip rules, we send everything to the pool which aggregate the sync committee or contribution into another aggregate.
Sync Committee subscription: /eth/v1/validator/sync_committee_subscriptions
The subscription just starts to subscribe to the Sync Committee's Gossip channel. it is actually really simple, here is the pseudo-code for how the subscription happen for each ValidatorIndex requested:
Function PostEthV1ValidatorSyncCommitteeSubscriptions
Request: ValidatorIndicies []uint64
Get the head state of the blockchain
For each subRequest in ValidatorIndicies do
Compute the subnets for the validator index from subRequest using the headState
For each subnet in syncnets do
Construct a topic name for the sync committee subnet
Subscribe to the topic with the sync committee subnet the topic with the calculated expiry time in sentinel
End Function
Extras
- /eth/v1/validator/contribution_and_proofs - Submit to the node a contribution to be republished on the Gossip.
- /eth/v1/validator/sync_committee_contribution - Retrieve a contribution (from the pool) that we have aggregated from the gossip.
- /eth/v1/beacon/pool/sync_committees - Submit to the node a sync sync committee messages to be republished on the Gossip.
Please retry analysis of this Pull-Request directly on SonarCloud
bro didn't pass lint check
bro didn't pass lint check
Bro now passes lint check
Quality Gate passed
Issues
5 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code