fix: validate ML-DSA-65 signatures before on-chain RPC queries#61
Merged
mickvandijke merged 1 commit intomainfrom Apr 3, 2026
Merged
fix: validate ML-DSA-65 signatures before on-chain RPC queries#61mickvandijke merged 1 commit intomainfrom
mickvandijke merged 1 commit intomainfrom
Conversation
Move signature validation ahead of the expensive on-chain payment lookup to prevent DoS via garbage proofs that trigger RPC calls. Cheap local crypto checks now gate the costly network round-trip. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Reorders merkle payment verification so ML-DSA-65 candidate signatures are validated before any on-chain RPC query, preventing invalid/garbage proofs from triggering expensive chain lookups.
Changes:
- Added an early loop to validate all candidate ML-DSA-65 signatures immediately after deriving the pool hash and before cache/RPC usage.
- Split the prior combined loop so the post-RPC phase only checks timestamp consistency against on-chain (or cached) payment info.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
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.
Summary
Context
Extracted from #58 — this is just the DoS prevention reorder, without the close group checker feature.
Test plan
cargo fmt/cargo clippypass🤖 Generated with Claude Code