feat: Support validator-requested undelegation in DLP finalize paths#1391
feat: Support validator-requested undelegation in DLP finalize paths#1391snawaz wants to merge 1 commit into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
📝 WalkthroughWalkthroughChangesThis PR removes explicit Sequence Diagram(s)Not applicable — changes are primarily internal logic restructuring, dependency version bumps, and documentation updates rather than new user-facing interaction flows. Suggested reviewers: ✨ 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 `@magicblock-committor-service/src/tasks/task_builder.rs`:
- Around line 445-449: Add direct test coverage for the
`commit_finalize_and_undelegate` path in `finalize_tasks()` so the wiring to
`create_post_undelegate_action_tasks` is exercised, not just
`CommitFinalizeTask::instruction()` account layout. Add a test in the same area
as `finalize_tasks`/`task_builder` that builds an intent bundle with
`commit_bundle.commit_finalize_and_undelegate`, calls `finalize_tasks()`, and
asserts the returned tasks include the expected post-undelegate BaseAction
ordering. Use the existing `create_post_undelegate_action_tasks`,
`finalize_tasks`, and `commit_finalize_and_undelegate` symbols to locate the
branch and verify it behaves like the `commit_and_undelegate` coverage.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: bb5c68be-7594-4d83-9c8d-e4ca56964b60
⛔ Files ignored due to path filters (3)
Cargo.lockis excluded by!**/*.locktest-integration/Cargo.lockis excluded by!**/*.locktest-integration/schedulecommit/elfs/dlp.sois excluded by!**/*.so
📒 Files selected for processing (7)
.agents/context/crates/magicblock-committor-service.md.agents/specs/validator-specification.mdCargo.tomlmagicblock-committor-service/src/tasks/mod.rsmagicblock-committor-service/src/tasks/task_builder.rsmagicblock-committor-service/src/tasks/task_strategist.rstest-integration/Cargo.toml
| if let Some(ref value) = | ||
| intent_bundle.intent_bundle.commit_finalize_and_undelegate | ||
| { | ||
| tasks.extend(create_undelegate_tasks(value, &delegation_metadata)?); | ||
| tasks.extend(create_post_undelegate_action_tasks(value)); | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Add direct test coverage for commit_finalize_and_undelegate in finalize_tasks.
task_strategist.rs gained tests for commit_and_undelegate (auto-undelegate + post-undelegate BaseAction ordering), but no equivalent test exercises this commit_finalize_and_undelegate branch through finalize_tasks() to confirm create_post_undelegate_action_tasks output for it. The mod.rs tests only cover CommitFinalizeTask::instruction() account layout, not this wiring path.
🤖 Prompt for 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.
In `@magicblock-committor-service/src/tasks/task_builder.rs` around lines 445 -
449, Add direct test coverage for the `commit_finalize_and_undelegate` path in
`finalize_tasks()` so the wiring to `create_post_undelegate_action_tasks` is
exercised, not just `CommitFinalizeTask::instruction()` account layout. Add a
test in the same area as `finalize_tasks`/`task_builder` that builds an intent
bundle with `commit_bundle.commit_finalize_and_undelegate`, calls
`finalize_tasks()`, and asserts the returned tasks include the expected
post-undelegate BaseAction ordering. Use the existing
`create_post_undelegate_action_tasks`, `finalize_tasks`, and
`commit_finalize_and_undelegate` symbols to locate the branch and verify it
behaves like the `commit_and_undelegate` coverage.
|
discarded because the idea of undelegation in finalize step is discarded. |

Summary
Breaking Changes
Test Plan
Summary by CodeRabbit
Bug Fixes
Documentation
Tests