untrusted filler - #186
Conversation
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds cached trusted-fill metadata, uses it during close and balance handling, and extends closeTrustedFill to return a registry-disable signal based on realized price versus floor price. New tests cover dishonest filler behavior and emergency close flows. ChangesTrusted-fill circuit breaker with cached metadata
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@contracts/Folio.sol`:
- Around line 1174-1181: The cleanup code in the catch block following
emergencyCloseFiller() deletes the activeTrustedFill and activeTrustedFillInfo
without first revoking the sell-token allowance that was granted to the filler
at line 841. If emergencyCloseFiller() reverts, the filler retains approval to
transfer tokens from Folio even though the fill is no longer tracked, creating a
security vulnerability. Before deleting activeTrustedFill and
activeTrustedFillInfo, add code to revoke the sell-token allowance granted to
the filler address by setting the approval to zero, ensuring the filler cannot
execute transfers after the fill record is deleted.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a0527e16-8155-4f7c-beae-38a85d07182d
📒 Files selected for processing (5)
contracts/Folio.solcontracts/interfaces/IFolio.solcontracts/utils/RebalancingLib.soltest/Folio.t.soltest/utils/MockDishonestTrustedFiller.sol
Summary by CodeRabbit
Summary
Bug Fixes
Tests
poke()state transitions.Limitations of this approach
stateChangeActive()returns true in more cases. Easier to DoS systems built on top, but not substantially so.activeTrustedFill.emergencyCloseFiller()call. Gas griefing also possible withinCowSwapFillerthough for the ERC20 transfers, so seems like this doesn't substantially change things either.