Skip to content

refactor(dlp): migrate v1 integration to the legacy interface - #1859

Open
snawaz wants to merge 3 commits into
refactor/committor-service-boundariesfrom
refactor/dlp-legacy-interface
Open

snawaz wants to merge 3 commits into
refactor/committor-service-boundariesfrom
refactor/dlp-legacy-interface

Conversation

@snawaz

@snawaz snawaz commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Adopts the DLP v2 interface at 356930ea as dpi and moves existing v1 integration to dpi::legacy. This prepares the validator for v2 integration in #1858.

Closes #1857.

Impact

Existing v1 delegation and settlement behavior is preserved. The ScheduleCommit* instructions and arguments stay unchanged.

@snawaz
snawaz added this pull request to stack #1844 October 28, 2026 13:07
@snawaz snawaz added the dependencies Pull requests that update a dependency file label Oct 28, 2026 — with ChatGPT Codex Connector
@snawaz
snawaz marked this pull request as ready for review October 28, 2026 13:08
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between af87f93 and ddf9938.

Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 2
  • .github/actions/run-redsuite/action.yml
  • chainlink/src/chainlink/fetch_cloner/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The workspace dependency and its consumers now use magicblock-delegation-program-interface at the specified revision. Existing delegation references use the interface crate’s legacy APIs. The supplied summaries report no changes to existing behavior.

Changes: DPI interface migration

Layer / File(s) Summary
Workspace dependency declarations
Cargo.toml, bins/*/Cargo.toml, chainlink/Cargo.toml, committor/Cargo.toml, programs/magic-program/Cargo.toml, services/Cargo.toml, .github/actions/run-redsuite/action.yml
The workspace dependency and consuming package manifests replace delegation-program-api with magicblock-delegation-program-interface at the specified revision. The RedSuite checkout ref also changes.
Binary and service API references
bins/magicblock/src/claim_fees.rs, bins/validator/src/leader.rs, services/src/undelegation_request_service.rs
Fee-vault claims and setup use interface legacy builders and PDA helpers. The undelegation service imports its PDA helper from the interface’s legacy module.
Chainlink delegation handling
chainlink/src/chainlink/*, chainlink/src/remote_account_provider/*
Chainlink runtime code uses the interface crate for delegation IDs, legacy state and PDA helpers, and account-owner checks.
Chainlink fixtures and tests
chainlink/src/testing/*, chainlink/tests/*
Test fixtures, imports, account owners, and assertions use the interface crate and its legacy APIs.
Committor execution and state references
committor/src/execution/*, committor/src/intake/intent_limits.rs, committor/src/shared/account_state.rs, committor/src/shared/tasks/buffer_task.rs, committor/src/test_utils.rs
Commit finalization, error references, state helpers, and related tests now refer to the interface crate.
Committor instruction and budget builders
committor/src/shared/tasks/*
Task instruction builders, account-size budget helpers, and assertions use the interface crate’s legacy APIs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Possibly related issues

Suggested reviewers: bmuddha, gabrielepicco

Merge Risk: Minimal · up to ddf99

The migration appears consistent with the stated compatibility goal and is mergeable subject to normal checks.

Pre-merge checks: Passed 2 · Failed 2 · Inconclusive 1

Failed Failed checks: 2 warnings · 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Warning Issue [#1857] requires the workspace dependency to be named dpi. The raw summary states that the workspace dependency is magicblock-delegation-program-interface, which replaces `delegation-program… Set the workspace dependency key in the root Cargo.toml to dpi, pinned to 356930ea1fe58908057bbe99293a0383b242a40b. Update each member manifest that references the dependency (bins/magicblock, bins/validator, chainlink, `committ…
Docstring Coverage Warning Docstring coverage is 41.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check Inconclusive The reported changes cover dependency declarations, v1 import paths, legacy instruction builders, program identifiers, and tests. These changes match the scope of [#1857]. The raw summary also reports… Provide the reason for the RedSuite checkout commit change. Show how this change relates to the dpi interface adoption, such as a compatibility requirement for the RedSuite tests. Without this evidence, the assessment cannot conclude.
Passed Passed checks: 2 passed
Check name Status Explanation
Title check Passed The title "refactor(dlp): migrate v1 integration to the legacy interface" matches the main change. The PR moves existing v1 delegation-program references from the old delegation_program_api crate to…
Description check Passed The description states that the PR adopts the DLP v2 interface at commit 356930ea as dpi and moves existing v1 integration to dpi::legacy. It also states that v1 delegation and settlement behavior…
Full details: Title check

Explanation

The title "refactor(dlp): migrate v1 integration to the legacy interface" matches the main change. The PR moves existing v1 delegation-program references from the old delegation_program_api crate to the new delegation_program_interface crate under its legacy namespace, across committor, chainlink, services, binaries, and tests. The title names the primary change and uses a Conventional Commits style scope.

Full details: Description check

Explanation

The description states that the PR adopts the DLP v2 interface at commit 356930ea as dpi and moves existing v1 integration to dpi::legacy. It also states that v1 delegation and settlement behavior is preserved and that ScheduleCommit* instructions are unchanged. These statements match the changeset. The description is brief and does not list test results.

Full details: Linked Issues check

Explanation

Issue [#1857] requires the workspace dependency to be named dpi. The raw summary states that the workspace dependency is magicblock-delegation-program-interface, which replaces delegation-program-api. Source files use dpi only as a Rust import alias (for example chainlink/src/chainlink/mod.rs and committor/src/shared/tasks/mod.rs). This does not meet the workspace naming requirement. The pin requirement is met. The summary states that the workspace dependency points to revision 356930ea1fe58908057bbe99293a0383b242a40b. The v1 references move to delegation_program_interface::legacy in committor, chainlink, services, bins/validator, bins/magicblock, and tests. Shared APIs stay at the crate root in the reviewed files. The required Cargo.lock update cannot be verified. Cargo.lock is excluded by the !**/*.lock rule. The manifest evidence alone establishes the naming failure, so this verdict does not depend on the excluded file. The summary imports the crate as delegation_program_interface, but the workspace key is magicblock-delegation-program-interface. The summary does not show how this import name resolves. The PR reports no test results, so the outcome that existing legacy tests pass is not verified.

Resolution

Set the workspace dependency key in the root Cargo.toml to dpi, pinned to 356930ea1fe58908057bbe99293a0383b242a40b. Update each member manifest that references the dependency (bins/magicblock, bins/validator, chainlink, committor, programs/magic-program, services) to use the dpi key. Make the delegation_program_interface imports in source files resolve under that key. Include the Cargo.lock update and confirm it matches the pinned revision.

Full details: Docstring Coverage

Explanation

Docstring coverage is 41.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 29 functions across 44 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Out of Scope Changes check

Explanation

The reported changes cover dependency declarations, v1 import paths, legacy instruction builders, program identifiers, and tests. These changes match the scope of [#1857]. The raw summary also reports a change to .github/actions/run-redsuite/action.yml. This change moves the RedSuite checkout from 14eb286dc09c02883eecb6a00827c0caa8a37584 to 6315f0a659d8a1ea3d50a76c67996d58ea417dba. [#1857] allows only compatibility changes needed for the new dependency. The PR description does not mention this CI change, and the summary gives no reason for it. A link to the DLP interface adoption is possible but not shown. No concrete lack of connection is established, so this change cannot be marked out of scope. No other unrelated change is shown. The Cargo.lock change is excluded from review. It belongs to the in-scope lockfile update and does not add evidence of unrelated work.

Resolution

Provide the reason for the RedSuite checkout commit change. Show how this change relates to the dpi interface adoption, such as a compatibility requirement for the RedSuite tests. Without this evidence, the assessment cannot conclude.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Adopt the DLP v2 interface package while keeping the validator on the
existing v1 delegation and settlement paths. This prepares a separate v2
integration PR without changing the ScheduleCommit instructions.

Replace magicblock-delegation-program-api with the workspace dependency
dpi, pointing to magicblock-delegation-program-interface at the DLP stack
tip 356930ea1fe58908057bbe99293a0383b242a40b. Update Cargo.lock with the
new interface and its Wheels dependencies.

Move v1 account types, PDA helpers, instruction builders, discriminators,
and size estimates under dpi::legacy across committor, chainlink,
services, binaries, and their existing tests. Keep shared APIs such as
the program ID, diff and encryption helpers, errors, and exported PDA
macros at the crate root where the new interface exposes them.

Preserve the existing instruction selection, account layouts, resource
limits, and recovery paths. Test changes only update imports and paths;
no v2 execution paths or new tests are introduced.

Validation: cargo fmt --check and cargo check --tests passed for all six
affected packages. The existing test_all_commit_intents_use_combined_tasks
regression passed with cargo test (nextest is unavailable locally).

Closes #1857
Use the full magicblock-delegation-program-interface dependency name in
the workspace and consuming manifests. Define dpi locally with Rust
imports wherever qualified calls need it, combining self as dpi with
direct imports of descriptive types and helpers when appropriate.

Keep exported test macros on the full crate path so their callers do
not need to define the alias. Consolidate the matching test-helper
imports under their existing configuration guard.

The dependency revision, lockfile, and delegation behavior are unchanged.
Move the RedSuite revision update to PR8 so it and the v2 integration PR
use the same test stack. Pin the top RedSuite commit containing lifecycle,
buffered settlement, and mixed legacy/v2 scenarios.

Only the checkout ref changes here. The matching local DLP program build
remains in PR9, and the earlier seven PRs keep their existing RedSuite ref.
@snawaz
snawaz force-pushed the refactor/dlp-legacy-interface branch from e0ad0e6 to ddf9938 Compare October 31, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move existing DLP integration to the legacy interface

1 participant