feat(types): carry proposer signature outside the block proof#467
Draft
MegaRedHand wants to merge 1 commit into
Draft
feat(types): carry proposer signature outside the block proof#467MegaRedHand wants to merge 1 commit into
MegaRedHand wants to merge 1 commit into
Conversation
Split `SignedBlock.proof` into `BlockProof { proposer_signature,
attestation_proof }`. The proposer's raw XMSS signature is now carried as
a standalone field and verified directly with the hash-based XMSS verifier,
while `attestation_proof` is a lean-multisig Type-2 over the block body's
attestations only.
Previously the proposer signature was wrapped as a singleton Type-1 and
merged into a single block Type-2 alongside every attestation, so even a
block with zero attestations needed a prover call. Decoupling the proposer
lets the attestation aggregate be built independently of the block root (a
prerequisite for proposer prebuild) and removes prover work from the
empty-attestation case.
before: block-proof = aggregate([prop-sig, att0, att1])
after: block-proof = (prop-sig, aggregate([att0, att1]))
before (no atts): aggregate([prop-sig])
after (no atts): (prop-sig, empty-proof)
Verification now checks the raw proposer signature against the proposer's
proposal pubkey, then verifies the attestation Type-2 over attestation
components only (and rejects a stray aggregate on an attestation-less block).
Reaggregation drops the proposer component from the split layout.
NOTE: this diverges from the leanSpec #799 single-merged-proof wire format,
so the signature/SSZ spec tests fail against the current cross-client
fixtures until those are regenerated for the new layout. Draft PR.
8494da8 to
eff6b8b
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Moves the proposer signature outside the block proof.
SignedBlock.proofbecomes a two-fieldBlockProof:The proposer signature reuses the existing
XmssSignaturetype (SszVector<u8, SIGNATURE_SIZE>) already carried bySignedAttestation.signature— no new wrapper type.sign_block_rootalready returns anXmssSignature, sopropose_blockcarries it verbatim; genesis anchors use the existingblank_xmss_signature()placeholder.Why
Previously the proposer signature was wrapped as a singleton Type-1 and merged into a single block Type-2 alongside every attestation, so even a block with zero attestations required a prover call, and the merge could only run once the block root was known.
Decoupling the proposer:
ValidatorSignature::is_valid), never entering the lean-multisig prover/verifier.Changes
types/block.rsBlockProof { proposer_signature: XmssSignature, attestation_proof };SignedBlock.proof: BlockProof.Default= blank XMSS placeholder + empty aggregateblockchain/lib.rspropose_block: carry the rawXmssSignaturedirectly; aggregate attestation Type-1s only (skip the merge entirely when there are no attestations)blockchain/store.rsverify_block_signatures: verify raw proposer sig vsproposal_pubkey, then verify the attestation Type-2 over attestation components only; reject a stray aggregate on an attestation-less block (UnexpectedAttestationProof)blockchain/reaggregate.rsattestation_proofstorage/store.rsBlockProofin theBlockSignaturesrownet/p2p,net/rpcTest status
cargo check --workspace --all-targets: ✅cargo clippy --workspace --all-targets -- -D warnings: ✅--lib): ✅ (incl.SignedBlockSSZ round-trip with a populated proposer signature + blank-default)signature_spectests/ssz_spectestsfail against the current cross-client fixtures until those are regenerated. The fixture crate carries only a minimal type-only compile fix (no adapter logic).Open questions
🤖 Draft — opened for review of the restructure.