Skip to content

fix: refresh target adapter before pricing in migrate_adapter - #596

Open
nobodieair wants to merge 1 commit into
drydocs:mainfrom
nobodieair:fix/issue-571-bug-migrate-adapter-doesn-t-refresh-the-target
Open

fix: refresh target adapter before pricing in migrate_adapter#596
nobodieair wants to merge 1 commit into
drydocs:mainfrom
nobodieair:fix/issue-571-bug-migrate-adapter-doesn-t-refresh-the-target

Conversation

@nobodieair

Copy link
Copy Markdown

Overview

This PR fixes migrate_adapter so it refreshes the target adapter before reading its post-migration total_assets(), matching deposit's existing refresh-before-pricing pattern. This prevents spurious MigrationValueDrift errors caused by stale cache-backed (e.g. Blend) target adapter values.

Related Issue

Changes

🔧 Adapter migration pricing fix

  • [MODIFY] packages/contracts/vault/src/lib.rs
    • Add new_adapter_client.refresh() immediately before reading new_adapter_client.total_assets() in migrate_adapter.
    • Keep the old adapter refresh unchanged.
    • No storage changes, no breaking interface changes, and no public API changes.

Verification Results

cargo test -p vault
✅ existing suite passes

Static review:
✅ Target adapter refreshed before total_assets() read
✅ Pre/post migration values measured with fresh adapter state
✅ Spurious MigrationValueDrift avoided in stale-cache scenario
Acceptance Criteria Status
Target adapter is refreshed before its post-migration total_assets() is read ✅ Refresh added in migrate_adapter
Pattern matches deposit()'s refresh-before-pricing behavior ✅ Same client refresh pattern used
No breaking changes to public API or storage ✅ Only internal refresh call added
Existing test suite passes ✅ cargo test -p vault passes

Closes #571

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

@nobodieair is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@nobodieair Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] migrate_adapter doesn't refresh the target adapter before pricing it

1 participant