Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #30221. [Fix] Adjust gas calculations for L2-to-L2 bridge transactions (Arbitrum to Optimism) #30223

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

Description

This PR fixes an issue where bridge transactions of unapproved USDC from Arbitrum to ETH on Optimism were failing due to insufficient gas fee calculations. The problem occurred during the approval transaction phase, regardless of STX (Secure Transaction) settings.

  1. Reason for change: Bridge transactions between L2 networks (specifically Arbitrum to Optimism) were failing due to underestimated gas fees during the token approval phase.

  2. Improvement/solution:

    • Added a 20% buffer to gas calculations specifically for L2-to-L2 bridge transactions
    • Enhanced the transaction controller to properly handle cross-chain message passing costs
    • Updated gas estimation logic to account for execution costs on both L2 chains

Related issues

Fixes: #30221

Manual testing steps

  1. Ensure you have unapproved USDC on Arbitrum network
  2. Navigate to the bridge interface in MetaMask
  3. Attempt to bridge USDC from Arbitrum to ETH on Optimism
  4. Verify that the approval transaction succeeds with proper gas estimation
  5. Complete the bridge transaction and verify it processes successfully
  6. Test with both STX enabled and disabled to ensure consistent behavior

Screenshots/Recordings

Before

Transaction would fail with "extra fees" error during approval phase

After

Transaction succeeds with proper gas estimation including L2 bridge overhead

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR
  • I confirm that this PR addresses all acceptance criteria described in the ticket

@VolodymyrBg VolodymyrBg requested review from a team as code owners February 8, 2025 16:16
Copy link
Contributor

github-actions bot commented Feb 8, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@VolodymyrBg
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

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

Successfully merging this pull request may close these issues.

[Bug]: Bridge of unapproved USDC on Arbitrum to ETH on Optimism is stopped because costing extra fees
3 participants