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

Gas Estimate Bug for SuperchainWETH relays #143

Open
tremarkley opened this issue Sep 12, 2024 · 2 comments · Fixed by #180
Open

Gas Estimate Bug for SuperchainWETH relays #143

tremarkley opened this issue Sep 12, 2024 · 2 comments · Fixed by #180

Comments

@tremarkley
Copy link
Contributor

tremarkley commented Sep 12, 2024

Ran into an interesting issue while sending SuperchainWETH crosschain using supersim.

Repro steps:

  1. deposit 10 eth into SuperchainWETH contract for dev account 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
  2. on chain A call sendERC20 on SuperchainWETH and send all 10 ETH to 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 on chain B (tx succeeds)
  3. Execute the relayERC20 message on chain B through the CrossL2Inbox

On step 3 when executing the message the tx succeeds but the message execution fails and the FailedRelayedMessage event is emitted and the transfer of superchain WETH does not happen. After tracing the transaction I found that the transfer fails because the relayERC20 call made within the execute message ends up running out of gas.

Debugging this was pretty tricky and ultimately ended up having to use the debug_traceTransaction RPC to figure out where the revert was occurring. Another interesting thing is that using cast call --trace to simulate the transaction would show that the tx should succeed and correctly estimates the gas used, but then cast send ends up not setting the gas limit properly and the message relay fails.

@tremarkley tremarkley changed the title Gast Estimate Bug for SuperchainWETH relays Gas Estimate Bug for SuperchainWETH relays Sep 13, 2024
@tremarkley
Copy link
Contributor Author

Discussed this with @tynes and this is most likely a bug in the way that anvil estimates gas, since anvil has its own method for estimating gas.

Next steps is to do more investigation into how anvil estimates gas and once interop is live on testnet confirm whether we run into the same gas estimation issue there as well.

@tremarkley
Copy link
Contributor Author

It seems like this issue has come back after the SuperchainERC20 redesign: ethereum-optimism/optimism#12321

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 a pull request may close this issue.

1 participant