-
Notifications
You must be signed in to change notification settings - Fork 44
chore: Improve signature validation logic for Solana #429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis change refactors signature validation by introducing blockchain-aware signature rules and relocating validation logic from the config module to the repository layer. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/repositories/monitor.rs`:
- Around line 65-104: The current validate_monitor_signatures function only
checks presence of '(' and ')' which allows malformed orders like
"transfer)address("; update the function and both validation loops (the checks
for func.signature and event.signature) to ensure the '(' appears before the
')', the signature ends with ')' (signature.ends_with(')')), and that there is
at least one non-empty identifier before '(' and at least zero chars between
parentheses (i.e., let open_idx = signature.find('('), close_idx =
signature.rfind(')') and require Some(open) < Some(close) and open > 0); when
any of these fail, push the same formatted validation_errors message for the
offending func.signature or event.signature.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #429 +/- ##
======================================
Coverage 95.5% 95.5%
======================================
Files 96 96
Lines 28100 28272 +172
======================================
+ Hits 26837 27013 +176
+ Misses 1263 1259 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Testing Process
Checklist
Note
If you are using Monitor in your stack, consider adding your team or organization to our list of Monitor Users in the Wild!
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.