Skip to content

Add Across Predict withdraw submit support#8761

Open
pedronfigueiredo wants to merge 1 commit into
pnf/predict-withdraw-across-quotesfrom
pnf/predict-withdraw-across-submit
Open

Add Across Predict withdraw submit support#8761
pedronfigueiredo wants to merge 1 commit into
pnf/predict-withdraw-across-quotesfrom
pnf/predict-withdraw-across-submit

Conversation

@pedronfigueiredo
Copy link
Copy Markdown
Contributor

@pedronfigueiredo pedronfigueiredo commented May 11, 2026

Summary

This is PR 3 of 4 in the core stack for Predict withdraws over Across.

  • Prepends the original Predict withdraw transaction when submitting post-quote Across flows.
  • Uses TransactionType.predictAcrossWithdraw for the Across deposit leg.
  • Forces 7702 batch submission when the parent withdraw transaction already has an authorization list.
  • Estimates final 7702 submit gas when the submit-time batch shape differs from the quote-time batch shape.
  • Moves original transaction gas parsing into a shared Across helper used by quote and submit paths.

Stack

  1. Add Across Predict withdraw plumbing #8759: plumbing to identify Predict Across withdraws
  2. Add Across Predict withdraw quote support #8760: quote support
  3. This PR: submit support
  4. Fix Across Predict withdraw gas payment edges #8762: gas payment edge cases

Validation

  • yarn workspace @metamask/transaction-pay-controller run jest --no-coverage src/strategy/across/across-submit.test.ts src/strategy/across/across-quotes.test.ts src/strategy/across/AcrossStrategy.test.ts
  • Full stack validation was run on the final stacked branch:
    • yarn changelog:validate
    • yarn workspace @metamask/transaction-pay-controller run test
    • yarn workspace @metamask/transaction-controller run test

Note

Medium Risk
Changes Across submission logic for post-quote flows, including conditional EIP-7702 batch handling and new gas-limit estimation paths, which can affect transaction construction and fee behavior.

Overview
Adds Across submit-time support for post-quote Predict withdraw flows by optionally prepending the original transaction to the submitted batch and using TransactionType.predictAcrossWithdraw for the Across leg.

Refactors Across submit to more aggressively choose EIP-7702 batch submission (e.g., when the parent has an authorizationList or when source gas is paid in-token) and to estimate the final 7702 batch gas limit via TransactionController:estimateGasBatch when the submit batch shape differs from what was quoted.

Also centralizes original-transaction gas parsing into getOriginalTransactionGas (used by both quote and submit), and ensures gas-fee-token submits pass gasFeeToken plus excludeNativeTokenForFee. Tests are expanded to cover these new post-quote/7702 edge cases, and the changelog is updated.

Reviewed by Cursor Bugbot for commit 013d596. Bugbot is set up for automated code reviews on this repo. Configure here.

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/predict-withdraw-across-submit branch from 4735d17 to 0e2bce3 Compare May 11, 2026 11:29
@pedronfigueiredo pedronfigueiredo self-assigned this May 11, 2026
@pedronfigueiredo pedronfigueiredo marked this pull request as ready for review May 11, 2026 13:33
@pedronfigueiredo pedronfigueiredo requested review from a team as code owners May 11, 2026 13:33
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/predict-withdraw-across-quotes branch from f4feefb to 86b0f66 Compare May 11, 2026 13:54
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/predict-withdraw-across-submit branch from 0e2bce3 to 013d596 Compare May 11, 2026 13:55
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.

1 participant