Skip to content

fix(lee)!: reject duplicate witness keys - #894

Merged
moudyellaz merged 2 commits into
devfrom
erhant/fix-duplicate-witness-keys
Sep 24, 2026
Merged

moudyellaz merged 2 commits into
devfrom
erhant/fix-duplicate-witness-keys

Conversation

@erhant

@erhant erhant commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Purpose

A witness set could list the same key twice; validation passed and the nonce advanced once per entry. This PR adds checks for that to reject such a case.

Closes #893 which was created as a future work from #880 .

⚙️ Approach

  • Reject repeated signers in both authenticate_public_transaction_signers and from_privacy_preserving_transaction, before signature verification.
  • Reject at transaction_stateless_check too, with a new DuplicateSigner malformation error, so the tx doesnt enter the mempool
  • One test per path, asserting on the duplicate error specifically.

Warning

BREAKING: Block-validity rule change: a block carrying such a tx was valid before and is invalid now.

🧪 How to Test

RISC0_DEV_MODE=1 cargo test -p lee duplicate_signers
cargo test -p common

🔗 Dependencies

None

🔜 Future Work

None

📋 PR Completion Checklist

  • Complete PR description
  • Implement the core functionality
  • Add/update tests
  • Add/update documentation and inline comments

@erhant erhant self-assigned this Sep 16, 2026
@erhant erhant added the bug Something isn't working label Sep 16, 2026
@moudyellaz moudyellaz added the priority:medium Normal priority label Sep 17, 2026

@jonesmarvin8 jonesmarvin8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. One minor comment.

@Pravdyvy Pravdyvy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@moudyellaz
moudyellaz merged commit f84b6e4 into dev Sep 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority:medium Normal priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(lee): reject duplicate witness keys in public and private transactions

4 participants