-
Notifications
You must be signed in to change notification settings - Fork 1
Spec sync: Rename votes → attestations and restructure container architecture #8
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
Conversation
|
@copilot Match 3100. |
…n types - Renamed Vote → AttestationData, SignedVote → SignedAttestation - Added intermediate Attestation container (validator_id moved from SignedAttestation) - Changed signature size from 4000 bytes to 3100 bytes (U3100 = 31 * 100) - Added aggregation types: AggregatedAttestations, SignedAggregatedAttestations, AggregationBits, AggregatedSignatures - Updated all references in containers, networking, and test modules - Renamed VOTE_TOPIC → ATTESTATION_TOPIC - Renamed GossipsubKind::Vote → Attestation, ProcessVote → ProcessAttestation - Updated all test files to use new attestation terminology - All tests passing Co-authored-by: malajevas <[email protected]>
Implemented all requested changes in commit 9226dbc: ✅ Signature size matched to 3100 bytes (U3100 = 31 * 100) All 38 tests passing. The codebase is now fully synchronized with the spec's attestation terminology and structure. |
|
@copilot Check in leanSpec containers again and compare to the containers implementation in grandine/lean, are you sure there are no things missing? |
Found critical architectural differences after re-examining leanSpec: Major Issues:
Architectural Difference:
This is a fundamental design mismatch. The spec separates signature aggregation from attestation data, while our implementation couples them. Should I align with spec's architecture (breaking change) or is our simpler design intentional? |
|
@copilot Does this fundamentally change the way our attestations work? |
Critical Analysis: Yes, this fundamentally breaks compatibility:
Bottom line: Our current implementation cannot:
This requires architectural changes to match spec. Should I proceed with the breaking changes to align with spec? |
|
@copilot alright put these fundamental issues in the background first check if: check if the tests work, fix if they dont |
Integration tests are working correctly. Ran ✅ test_invalid_proposer No fixes needed - all integration tests pass successfully with the current attestation implementation. |
|
@copilot Spec test vectors serialize Block with List (no signatures in body) Alright fix this, rework the architecture. |
…natures Major architectural change to match spec: - BlockBody.attestations changed from List<SignedAttestation> to List<Attestation> - Added type aliases: Attestations, BlockSignatures - Added BlockWithAttestation and SignedBlockWithAttestation types - SignedBlockWithAttestation uses BlockSignatures (list) instead of single signature - Updated state.rs process_attestations to handle Attestation (no signatures) - Updated all tests to create Attestation objects instead of SignedAttestation - All 38 tests passing (27 unit + 4 integration + 7 lib/other) This aligns with spec where signatures are aggregated separately from attestation data. Co-authored-by: malajevas <[email protected]>
Architectural rework complete in commit 4cf99ce. Changes:
Test Results:
Compatibility: Architecture now matches spec: signatures aggregated separately from attestation data. |
|
@copilot Check again if there are any architectural differences between the leanspec and our implementation for what involves the containers. Also, find out why rustrover shows a good number of problems all relating to Trait |
Architectural Comparison Complete: ✅ NO architectural differences found - our implementation fully matches the spec:
SszHash Trait Issue: ❌ False positive - RustRover shows errors but code compiles perfectly:
Verified: cargo test state::tests::test_hash_tree_root # ✅ passes
cargo test -p containers # ✅ all 38 tests passThe IDE errors can be safely ignored - they're an IDE limitation, not actual compiler errors. |
Synchronize with leanEthereum/leanSpec (commits 3fb2b01, d1e02a8): replace "vote" terminology with "attestation" throughout codebase and perform major architectural rework to separate signatures from attestation data, matching the spec's design.
Type Structure Changes
Original structure:
After renaming:
After architectural rework:
BlockBody.attestationsnow usesList<Attestation>(without signatures) instead ofList<SignedAttestation>BlockSignatureslistBlockWithAttestationandSignedBlockWithAttestationtypesArchitectural Changes
Critical Rework to Match Spec
BlockBody Structure:
attestations: List<SignedAttestation>(signatures embedded in attestations)attestations: Attestations(List, signatures separated)New Types Added:
Attestations- Type alias forList<Attestation, VALIDATOR_REGISTRY_LIMIT>BlockSignatures- Type alias forList<Signature, VALIDATOR_REGISTRY_LIMIT>BlockWithAttestation- Container bundling Block + proposer_attestationSignedBlockWithAttestation- Signed container with message + BlockSignatures listDesign Philosophy:
The spec separates signature aggregation from attestation data. Attestations are stored in blocks WITHOUT signatures, and signatures are maintained in a separate list. This architecture:
Scope
vote.rs→attestation.rs(single file)BlockBodyto useAttestations(unsigned)BlockWithAttestationandSignedBlockWithAttestationtypeslib.rsprocess_attestations()to handle unsigned attestationsVOTE_TOPIC→ATTESTATION_TOPIC,GossipsubMessage::Vote→::Attestation,ProcessVote→ProcessAttestation,GossipVote→GossipAttestationAggregatedAttestations,SignedAggregatedAttestations,AggregationBits, andAggregatedSignaturesImplementation Details
attestation.rsfile containing all attestation types and aggregation typespub type Signature = ByteVector<U3100>whereU3100 = Prod<U31, U100>SignedBlocktype kept for backwards compatibilityCompatibility
Files Changed
lean_client/containers/src/attestation.rslean_client/containers/src/vote.rsBreaking Changes
This PR includes a breaking architectural change in the container types to align with the spec. The separation of signatures from attestation data is now fully implemented, ensuring compatibility with spec test vectors and other spec-compliant clients in the devnet.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.