Skip to content

fix(blend-adapter): authorize the pool transfer immediately before submit() - #651

Open
collinsezedike wants to merge 1 commit into
mainfrom
fix/650-blend-deposit-auth-ordering
Open

fix(blend-adapter): authorize the pool transfer immediately before submit()#651
collinsezedike wants to merge 1 commit into
mainfrom
fix/650-blend-deposit-auth-ordering

Conversation

@collinsezedike

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes [Bug] blend-adapter deposit() authorization tracker expires before submit() consumes it #650: every deposit into blend-usdc-fixed currently fails in production with HostError: Error(Auth, InvalidAction)
  • BlendAdapter::deposit() called env.authorize_as_current_contract(...) before get_reserve()/get_positions(), and those intervening cross-contract calls silently expire the authorization tracker before submit() ever gets to consume it
  • Moves the authorize_as_current_contract() call to immediately precede client.submit(), with no cross-contract call in between
  • Adds deposit_authorization_tree_matches_the_real_pool_call_shape, a test that runs under real, enforcing Soroban auth verification (mock_auths) instead of mock_all_auths_allowing_non_root_auth, so this class of bug is caught going forward

Test plan

  • cargo test in packages/contracts/blend-adapter — all 18 tests pass, including the new strict auth test, which fails against the pre-fix ordering and passes against the fix
  • Confirmed against live production logs (vercel logs) that the failing call shape and error match this bug exactly
  • Once merged, needs a fresh blend-adapter deploy + migrate_adapter to move the live vault onto the corrected contract (tracked in [Bug] blend-adapter deposit() authorization tracker expires before submit() consumes it #650; the position currently holds zero assets, so this carries no fund-safety risk)

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meridian Ready Ready Preview Aug 30, 2026 6:30pm

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] blend-adapter deposit() authorization tracker expires before submit() consumes it

1 participant