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

Arbitrum Sepolia - "intrinsic gas too low" error while running "forge script" #6243

Closed
2 tasks done
trmid opened this issue Nov 7, 2023 · 0 comments · Fixed by #6244
Closed
2 tasks done

Arbitrum Sepolia - "intrinsic gas too low" error while running "forge script" #6243

trmid opened this issue Nov 7, 2023 · 0 comments · Fixed by #6244
Assignees
Labels
T-bug Type: bug

Comments

@trmid
Copy link

trmid commented Nov 7, 2023

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (059aa45 2023-11-07T08:13:53.055005635Z)

What command(s) is the bug in?

forge script

Operating System

Linux

Describe the bug

When running forge script on the new Arbitrum Sepolia Testnet (chain ID: 421614) the following error is thrown:

(code: -32000, message: intrinsic gas too low, data: None)

My EOA has ample ETH balance and I've tried running the script with a higher gas limit (ex: 24000000), but it still fails.

This seems similar to a previous issue for Arbitrum Goerli: #3487

The temporary fix in that thread was to do the following:

Ok I managed to get the script working...

I had to pass --skip-simulation

The estimated gas usage with simulation was 1,859,794

Without simulation, the gas limit was set to ~20M while the gas used was ~14M

So the gas estimation is off. Does forge estimate gas with the local EVM (rEVM?)? Does it call out to the provider?

Passing --skip-simulation worked and the transactions went through, but it seems that the broadcast information is incomplete and does not contain information such as "contractName" and "arguments". Transactions that should have a type of CREATE now have a type of CALL instead.

Example broadcast JSON snippet:

{
  "transactions": [
    {
      "hash": "0x307ee35d60d3b35860c75a7cc06e9263430c5470151bab39d8b2be13db850a9e",
      "transactionType": "CALL",
      "contractName": null,
      "contractAddress": null,
      "function": null,
      "arguments": null,
    ...
    }
  ]
}

vs. what it should look like:

{
  "transactions": [
    {
      "hash": "0x307ee35d60d3b35860c75a7cc06e9263430c5470151bab39d8b2be13db850a9e",
      "transactionType": "CREATE",
      "contractName": "ERC20Mintable",
      "contractAddress": "0xCb10ddAE13dEA1513291589dE9364dF6A645504b",
      "function": null,
      "arguments": [
        "Wrapped BTC",
        "WBTC",
        "8",
        "0xbcbedde8ea16ef6724fa667f4dc63a74d8a42b09"
      ],
    ...
    }
  ]
}

This is an issue since my scripts rely on this broadcast information to retrieve addresses of recently deployed contracts.

Probable Cause

The problem in the previous issue was related to the new Arbitrum testnet not being included in these functions:
https://github.com/foundry-rs/foundry/blob/35b450054e59cb7c5026be433a98fbd5cbfda94c/crates/cli/src/utils/cmd.rs#L170C82-L170C96

return !matches!(chain, Chain::Arbitrum | Chain::ArbitrumTestnet | Chain::ArbitrumGoerli)

Arbitrum Sepolia likely needs to be added there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
2 participants