Repository navigation
feat(key-wallet): address pools gap limit can be externally modified runtime - #822
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a ChangesGap Limit Widening Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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: 2
🤖 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 `@key-wallet/src/managed_account/address_pool.rs`:
- Around line 889-896: The set_gap_limit path in address_pool::set_gap_limit
currently allows a zero gap_limit, which later causes underflow in
maintain_gap_limit when it computes self.gap_limit - 1. Clamp the input to a
minimum of 1 before storing it, while still respecting
crate::gap_limit::MAX_GAP_LIMIT, and keep the existing maintain_gap_limit call
so staged address generation remains bounded.
In `@key-wallet/src/managed_account/managed_account_trait.rs`:
- Around line 557-570: The set_gap_limit method in managed_account_trait can
leave monitor_revision stale if an earlier address pool is updated and a later
pool returns an error before bump_monitor_revision() runs. Change the flow in
set_gap_limit so revision tracking is updated atomically with the address-pool
mutations: either avoid partial updates by collecting results/errors before
returning, or ensure any successful state changes still trigger
bump_monitor_revision() even on failure. Use set_gap_limit and
bump_monitor_revision as the key points to adjust.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0bf6bc99-a210-4dd7-a21e-5ca11eb8c692
📒 Files selected for processing (2)
key-wallet/src/managed_account/address_pool.rskey-wallet/src/managed_account/managed_account_trait.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #822 +/- ##
==========================================
- Coverage 73.04% 72.82% -0.22%
==========================================
Files 323 323
Lines 72046 72095 +49
==========================================
- Hits 52623 52505 -118
- Misses 19423 19590 +167
|
e5e170e to
bbfa00b
Compare
Summary by CodeRabbit