Skip to content

fix: serialize signatures to fixed bytes#435

Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom
unnawut:fixed-bytes-signature-type
Mar 6, 2026
Merged

fix: serialize signatures to fixed bytes#435
tcoratger merged 1 commit intoleanEthereum:mainfrom
unnawut:fixed-bytes-signature-type

Conversation

@unnawut
Copy link
Collaborator

@unnawut unnawut commented Mar 6, 2026

🗒️ Description

This PR aligns leanSpec signature encoding (as SSZ container with subfields) with how the client implementations are doing (fixed bytes).

Because leanSpec has flags for different signature scheme (test and prod currently), I've updated the Signature container to calculate its length dynamically with TARGET_CONFIG.SIGNATURE_LEN_BYTES so it aligns with the --scheme flag used. However, in the cross client signature test, it's hardcoded to use PROD_CONFIG.SIGNATURE_LEN_BYTES for consistent test result.

The _empty_signature() function also has to be updated to reflect this change, but instead I replace it with consensus_testing.keys import create_dummy_signature() so there's one less place to maintain the logic.

This PR is a spec change but it aligns the specs with how the clients are doing, so no changes would be needed on the clients.

🔗 Related Issues or PRs

✅ Checklist

  • Ran tox checks to avoid unnecessary CI fails:
    uvx tox
  • Considered adding appropriate tests for the changes.
  • Considered updating the online docs in the ./docs/ directory.

@unnawut unnawut added this to the pq-devnet-3 milestone Mar 6, 2026
@unnawut unnawut added the specs Scope: Changes to the specifications label Mar 6, 2026
@unnawut unnawut requested a review from tcoratger March 6, 2026 11:22
@tcoratger tcoratger merged commit 79a347b into leanEthereum:main Mar 6, 2026
22 of 23 checks passed
@unnawut unnawut deleted the fixed-bytes-signature-type branch March 7, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

specs Scope: Changes to the specifications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants