-
Notifications
You must be signed in to change notification settings - Fork 33
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
Feat/fb v2 sender nonce [SLT-183] #3212
Conversation
WalkthroughThe changes in this pull request primarily enhance the nonce management and transaction handling within the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Deploying sanguine-fe with Cloudflare Pages
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3212 +/- ##
====================================================
+ Coverage 40.97804% 90.59486% +49.61682%
====================================================
Files 459 60 -399
Lines 25643 1244 -24399
Branches 343 148 -195
====================================================
- Hits 10508 1127 -9381
+ Misses 14383 113 -14270
+ Partials 752 4 -748
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- packages/contracts-rfq/contracts/FastBridgeV2.sol (3 hunks)
- packages/contracts-rfq/test/FastBridgeV2.Src.t.sol (1 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
packages/contracts-rfq/contracts/FastBridgeV2.sol
[warning] 161-161: packages/contracts-rfq/contracts/FastBridgeV2.sol#L161
Added line #L161 was not covered by tests
🔇 Additional comments (4)
packages/contracts-rfq/test/FastBridgeV2.Src.t.sol (2)
141-142
: Correct verification of per-sender nonce initializationThe assertions accurately confirm that after
userA
performs a bridge, their nonce is incremented to 1, whileuserB
's nonce remains at 0. This validates that nonces are tracked individually per sender.
150-151
: Proper nonce incrementation foruserB
after bridgingThe assertions correctly ensure that after
userB
performs a bridge transaction, their nonce is incremented to 1, whileuserA
's nonce remains unchanged at 1. This verifies independent nonce incrementation for each sender.packages/contracts-rfq/contracts/FastBridgeV2.sol (2)
31-32
: Good implementation of per-sender nonce trackingThe introduction of the
senderNonces
mapping effectively implements per-sender nonce tracking, enhancing security against replay attacks as outlined in the PR objectives.
73-73
: Verify nonce incrementation safetyThe use of
senderNonces[params.sender]++
increments the nonce for the sender after it's used in the transaction. While this is generally acceptable, it's important to ensure that there are no potential reentrancy vulnerabilities that could exploit the nonce incrementation.To confirm that the nonce incrementation is secure and not susceptible to reentrancy attacks, please run the following script:
Description
Replace chain-scoped nonce with one that increments per-sender
Additional context
Reduces risk of reorgs resulting in a different nonce
Summary by CodeRabbit