Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Feature
This pull request implements validator custody.
Other notes for review
Please read commit by commmit.
Acknowledgements
1. Tracked validator cache
When a validator client sends a /eth/v1/validator/prepare_beacon_proposer message to the beacon node (or the equivalent gRPC message), the
TrackedValidatorsCache
remembers the corresponding validator indices.These indices are deleted from the cache one hour after the latest subscription.
One hour is a convenient duration to let the node operator do maintenance job on their infrastructure if they need to move/reboot some validators clients.
2. Target custody group count.
When a first block of an epoch is received, the content of the
TrackedValidatorsCache
is retrieved, and the total balance of validators managed by the beacon node is computed. From this, theTargetCustodyGroupCount
is computed. Target means the beacon node theoretically should custody this group count.3. Data columns subnets subscriptions.
The beacon node node subscribes to the subnets determined by the target custody group sampling size.
4. Data availability.
When receiving a block via gossip, the node considers data columns availability determined by the actual custody group sampling size. The actual custody group sampling size can never be higher than the target custody group sampling size.
5. To advertise custody group count.
When the correct amount of data column subnets are subscribed with respect to the target custody group count, then the to advertise custody group count is updated, and set to the target custody group count.
Currently, the only condition is the column subnets subscription. Later, the data columns backfill will also be considered.
6. Advertisement of the custody group count.
Twice per slot, the to advertise custody group count is sent to the network via ENR and Metadata.