perf: short-circuit TrieProof.verify on traversal error#6280
perf: short-circuit TrieProof.verify on traversal error#6280Fibonacci747 wants to merge 1 commit intoOpenZeppelin:masterfrom
Conversation
|
WalkthroughThe pull request modifies the Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (1)
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. Comment |
PR Checklist
Reordered the condition in TrieProof.verify so that it first checks whether tryTraverse finished with NO_ERROR before calling Bytes.equal on the returned value. This preserves the existing behavior while avoiding unnecessary keccak256 computations for invalid proofs, making verification slightly cheaper in the common failure path.
npx changeset add)