Skip to content

fix: canonicalize evnode sponsor signatures and strictly decode payload txs - #426

Merged
tac0turtle merged 2 commits into
mainfrom
fix/canonical-sponsor-signature-and-strict-decode
Oct 27, 2026
Merged

tac0turtle merged 2 commits into
mainfrom
fix/canonical-sponsor-signature-and-strict-decode

Conversation

@damiannolan

Copy link
Copy Markdown
Contributor

Description

  • decode_optional_signature rejects non-canonical signature encodings (e.g. v = 0/1 or EIP-155) by requiring the bytes to round-trip, so a sponsor signature has a single valid encoding and transaction hash.
  • recover_sponsor rejects malleable high-s signatures (EIP-2), matching the executor recovery path.
  • payload transactions are decoded with decode_2718_exact so trailing bytes after a transaction are rejected instead of silently ignored.

Adds regression tests for each.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring

Related Issues

Fixes #(issue)

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

Additional Notes

…ad txs

- decode_optional_signature rejects non-canonical signature encodings
  (e.g. v = 0/1 or EIP-155) by requiring the bytes to round-trip, so a
  sponsor signature has a single valid encoding and transaction hash.
- recover_sponsor rejects malleable high-s signatures (EIP-2), matching
  the executor recovery path.
- payload transactions are decoded with decode_2718_exact so trailing
  bytes after a transaction are rejected instead of silently ignored.

Adds regression tests for each.
@damiannolan
damiannolan requested a review from a team as a code owner October 27, 2026 10:09
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bd7fd056-ecbf-4b99-a559-fd997de7cc92
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…ct decode

The non-canonical-v check required the as_bytes() form (v = 27/28), but
clients encode the fee-payer signature with v = 0/1 (matching the executor
signature), so valid sponsored transactions were rejected. Enforcing a
single canonical v requires aligning the encoder, decoder, and tx hash on
one form, which is a protocol-level change; defer it.

The high-s (EIP-2) sponsor check and strict decode_2718_exact are kept.
Also applies cargo fmt.
@tac0turtle
tac0turtle merged commit 10fbee0 into main Oct 27, 2026
16 checks passed
@tac0turtle
tac0turtle deleted the fix/canonical-sponsor-signature-and-strict-decode branch October 27, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants