-
Notifications
You must be signed in to change notification settings - Fork 66
fix: validate gossip aggregated attestations before storing #487
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
Merged
unnawut
merged 8 commits into
leanEthereum:main
from
shaaibu7:fix/validate-aggregated-attestation
Mar 28, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c58a08b
fix: validate gossip aggregated attestations before storing
shaaibu7 faaa479
fix: update validate attestation
shaaibu7 504858f
fix: update tests for validate_attestation data change
shaaibu7 62009ff
test: implement test vectors generation for gossip aggregate attestat…
shaaibu7 f9fd5f1
Merge branch 'main' into fix/validate-aggregated-attestation
shaaibu7 938ba63
fix(test-fixtures): remove unreachable attestation signing block in f…
shaaibu7 dafc9a7
refactor(gossip-attestations): apply review suggestions
shaaibu7 4bd0e90
test(fc): fix aggregated head-slot-mismatch vector to trigger expecte…
shaaibu7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/testing/src/consensus_testing/test_types/gossip_aggregated_attestation_spec.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| """Lightweight aggregated-gossip attestation specification.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from lean_spec.subspecs.containers.slot import Slot | ||
| from lean_spec.subspecs.containers.validator import ValidatorIndex | ||
| from lean_spec.types import Bytes32, CamelModel | ||
|
|
||
|
|
||
| class GossipAggregatedAttestationSpec(CamelModel): | ||
| """ | ||
| Specification for an aggregated attestation received via gossip. | ||
|
|
||
| The spec allows overriding head/source checkpoints to exercise validation logic. | ||
| """ | ||
|
|
||
| validator_ids: list[ValidatorIndex] | ||
| """Claimed validators participating in the aggregation.""" | ||
|
|
||
| slot: Slot | ||
| """Slot of the attestation.""" | ||
|
|
||
| target_slot: Slot | ||
| """Slot of the attestation target checkpoint.""" | ||
|
|
||
| target_root_label: str | None = None | ||
| """Label referencing the target block root.""" | ||
|
|
||
| target_root: Bytes32 | None = None | ||
| """Optional explicit target root (bypasses label lookup).""" | ||
|
|
||
| head_root_label: str | None = None | ||
| """Optional label for the head checkpoint.""" | ||
|
|
||
| head_root: Bytes32 | None = None | ||
| """Optional explicit head root.""" | ||
|
|
||
| head_slot: Slot | None = None | ||
| """Optional override for the head checkpoint slot.""" | ||
|
|
||
| source_root_label: str | None = None | ||
| """Optional label for the source checkpoint.""" | ||
|
|
||
| source_root: Bytes32 | None = None | ||
| """Optional explicit source root.""" | ||
|
|
||
| source_slot: Slot | None = None | ||
| """Optional override for the source checkpoint slot.""" | ||
|
|
||
| valid_signature: bool = True | ||
| """Whether the aggregated proof should be generated with valid signatures.""" | ||
|
|
||
| signer_ids: list[ValidatorIndex] | None = None | ||
| """Optional override for which validators actually produce the signatures.""" |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.