Skip to content

feat: enforce maximum Merkle proof length in claim_with_proof to prev…#348

Merged
kilodesodiq-arch merged 4 commits into
ChainForgee:mainfrom
Justprotocol:feature/claim-proof-cap
Jul 19, 2026
Merged

feat: enforce maximum Merkle proof length in claim_with_proof to prev…#348
kilodesodiq-arch merged 4 commits into
ChainForgee:mainfrom
Justprotocol:feature/claim-proof-cap

Conversation

@Justprotocol

@Justprotocol Justprotocol commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Enforces a maximum Merkle proof length of 32 in claim_with_proof to protect against CPU-exhaustion/DoS attacks from overly large proof vectors.

Changes

  • lib.rs: Added ProofTooLarge = 19 error code and validated proof.len() <= 32 at the start of claim_with_proof.
  • aid_escrow_tests.rs: Added unit tests verifying the contract safely rejects oversized proofs and throws ProofTooLarge.

Closes #227

@Justprotocol
Justprotocol force-pushed the feature/claim-proof-cap branch from b88dd7f to 587c210 Compare July 16, 2026 08:50

Copy link
Copy Markdown
Contributor

Awesome work on this! Thanks for the contribution 🚀 Merging now.

Copy link
Copy Markdown
Contributor

Hi 👋 Thanks for this PR! There are some merge conflicts with the current main. Could you rebase onto main and push when you have a moment? Once it's clean we'll get it merged 🚀

@Justprotocol

Copy link
Copy Markdown
Contributor Author

Hi 👋 Thanks for this PR! There are some merge conflicts with the current main. Could you rebase onto main and push when you have a moment? Once it's clean we'll get it merged 🚀

on it..

thanks for the feedback

@Justprotocol
Justprotocol force-pushed the feature/claim-proof-cap branch from 94dcee3 to f4d8dd2 Compare July 17, 2026 17:40
@Justprotocol

Copy link
Copy Markdown
Contributor Author

hi @kilodesodiq-arch please check now , i fixed the conflict

@kilodesodiq-arch kilodesodiq-arch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@kilodesodiq-arch
kilodesodiq-arch merged commit cd504c7 into ChainForgee:main Jul 19, 2026
5 checks passed
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.

Add claim_with_proof Merkle proof length cap

2 participants