-
Notifications
You must be signed in to change notification settings - Fork 37
[WIP] Committee aggregation #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b5b6d8a
4867d7d
7bcedca
980b5e8
60468af
213504a
4fac983
f2651d8
cc7548c
cb1a21b
e398823
90fc114
cdae6a4
b24d3ed
5c952ff
8a0c121
cb952f8
9d721bd
baddbeb
6556e81
3477d6e
9174f5b
3115ef5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,9 @@ | |
|
|
||
| ## Overview | ||
|
|
||
| Validators participate in consensus by proposing blocks and producing attestations. This | ||
| document describes what honest validators do. | ||
| Validators participate in consensus by proposing blocks and producing attestations. | ||
| Optionally validators can opt-in to behave as aggregators in a single or multiple | ||
| committees. This document describes what honest validators do. | ||
|
|
||
| ## Validator Assignment | ||
|
|
||
|
|
@@ -16,6 +17,32 @@ diversity helps test interoperability. | |
| In production, validator assignment will work differently. The current approach | ||
| is temporary for devnet testing. | ||
|
|
||
| ## Attestation Committees and Subnets | ||
|
|
||
| Attestation committee is a group of validators contributing to the common | ||
| aggregated attestations. Subnets are network channels dedicated to specific committees. | ||
|
|
||
| In the devnet-3 design, however, there is one global subnet for signed | ||
| attestations propagation, in addition to publishing into per committee subnets. | ||
| This is due to 3SF-mini consensus design, that requires 2/3+ of all | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this global bit is not required, once the aggregtors publish signed attestations in the 2nd interval, they can be imported by all validators in the 3rd interval |
||
| attestations to be observed by any validator to compute safe target correctly. | ||
|
|
||
| Note that non-aggregating validators do not need to subscribe to committee | ||
| attestation subnets. They only need to subscribe to the global attestation | ||
| subnet. | ||
|
|
||
| Every validator is assigned to a single committee. Number of committees is | ||
| defined in config.yaml. Each committee maps to a subnet ID. Validator's | ||
| subnet ID is derived using their validator index modulo number of committees. | ||
| This is to simplify debugging and testing. In the future, validator's subnet ID | ||
| will be assigned randomly per epoch. | ||
|
|
||
| ## Aggregator assignment | ||
|
|
||
| Some validators are self-assigned as aggregators. Aggregators collect and combine | ||
| attestations from other validators in their committee. To become an aggregator, | ||
| a validator sets `is_aggregator` flag to true as ENR record field. | ||
|
|
||
| ## Proposing Blocks | ||
|
|
||
| Each slot has exactly one designated proposer. The proposer is determined by | ||
|
|
@@ -52,7 +79,7 @@ receive and validate it. | |
|
|
||
| ## Attesting | ||
|
|
||
| Every validator attestations in every slot. Attesting happens in the second interval, | ||
| Every validator attests in every slot. Attesting happens in the second interval, | ||
| after proposals are made. | ||
|
|
||
| ### What to Attest For | ||
|
|
@@ -78,8 +105,8 @@ compute the head. | |
|
|
||
| ### Broadcasting Attestations | ||
|
|
||
| Validators sign their attestations and broadcast them. The network uses a single topic | ||
| for all attestations. No subnets or committees in the current design. | ||
| Validators sign their attestations and broadcast them into the global | ||
| attestation topic and its corresponding subnet topic. | ||
|
|
||
| ## Timing | ||
|
|
||
|
|
@@ -98,11 +125,7 @@ blocks and attestations. | |
| Attestation aggregation combines multiple attestations into one. This saves bandwidth and | ||
| block space. | ||
|
|
||
| Devnet 0 has no aggregation. Each attestation is separate. Future devnets will add | ||
| aggregation. | ||
|
|
||
| When aggregation is added, aggregators will collect attestations and combine them. | ||
| Aggregated attestations will be broadcast separately. | ||
| Devnet-3 introduces signatures aggregation. Aggregators will collect attestations and combine them. Aggregated attestations will be broadcast separately. | ||
|
|
||
| ## Signature Handling | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,12 @@ | |
| VALIDATOR_REGISTRY_LIMIT: Final = Uint64(2**12) | ||
| """The maximum number of validators that can be in the registry.""" | ||
|
|
||
| ATTESTATION_COMMITTEE_COUNT: Final = Uint64(1) | ||
| """The number of attestation committees per slot.""" | ||
|
|
||
| COMMITTEE_SIGNATURE_THRESHOLD_RATIO: Final = 0.9 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems too high, anyway the aggregation should be deadline based and not threshold based, this is something a client implementations can deal with themselves when to do optimistic aggregation |
||
| """Default ratio of committee signature participation required to trigger aggregation.""" | ||
|
|
||
|
|
||
| class _ChainConfig(StrictBaseModel): | ||
| """ | ||
|
|
@@ -52,11 +58,19 @@ class _ChainConfig(StrictBaseModel): | |
| historical_roots_limit: Uint64 | ||
| validator_registry_limit: Uint64 | ||
|
|
||
| # Attestation / Networking | ||
| attestation_committee_count: Uint64 | ||
|
|
||
| # Aggregation behavior | ||
| committee_signature_threshold_ratio: float | ||
|
|
||
|
|
||
| # The Devnet Chain Configuration. | ||
| DEVNET_CONFIG: Final = _ChainConfig( | ||
| seconds_per_slot=SECONDS_PER_SLOT, | ||
| justification_lookback_slots=JUSTIFICATION_LOOKBACK_SLOTS, | ||
| historical_roots_limit=HISTORICAL_ROOTS_LIMIT, | ||
| validator_registry_limit=VALIDATOR_REGISTRY_LIMIT, | ||
| attestation_committee_count=ATTESTATION_COMMITTEE_COUNT, | ||
| committee_signature_threshold_ratio=COMMITTEE_SIGNATURE_THRESHOLD_RATIO, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
| from lean_spec.subspecs.ssz import hash_tree_root | ||
| from lean_spec.types import Bytes32, Container, Uint64 | ||
|
|
||
| from ...xmss.aggregation import AggregatedSignatureProof | ||
| from ...xmss.containers import Signature | ||
| from ..checkpoint import Checkpoint | ||
| from .aggregation_bits import AggregationBits | ||
|
|
@@ -107,3 +108,10 @@ def aggregate_by_data( | |
| ) | ||
| for data, validator_ids in data_to_validator_ids.items() | ||
| ] | ||
|
|
||
| class SignedAggregatedAttestation(Container): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anshalshukla / @GrapeBaBa do we already have this type?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also better to use message, signature terminlogy
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we also need aggregated bit vector here as well, |
||
| data: AttestationData | ||
| """Combined attestation data similar to the beacon chain format.""" | ||
|
|
||
| proof: AggregatedSignatureProof | ||
| """Aggregated signature proof covering all participating validators.""" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A validator is assigned to a certain subnet but can they perform an aggregator role in multiple subnets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I think we may add this possibility in future. But lets start with one subnet per aggregator.
I think we may consider similar logic to how validators self-assign themselves for sampling of single or multiple columns data in PeerDAS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds great! We can update this description to a single committee and modify it later once we introduce multiple subnets aggregator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to define this properly, just to clarify, nodes self-assign themselves (validators attached or not), a distinction required here because a signedaggregatedattestation can't be produced here without a validator