foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Getting `exceeds block gas limit` error on `forge script` deployment

Open JasoonS opened this issue 3 years ago • 4 comments

Component

Forge

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

  • [X] Foundry
  • [X] Foundryup

What version of Foundry are you on?

forge 0.2.0 (6974541 2022-09-20T00:08:48.480626755Z)

What command(s) is the bug in?

forge script

Operating System

Linux

Describe the bug

I repeatedly and sporadically get (code: -32000, message: exceeds block gas limit, data: None) during deployments using forge script.

Sometimes my deployments work, sometimes they don't. I honestly don't have anything else, or know any way to replicate this.

JasoonS avatar Sep 20 '22 18:09 JasoonS

Having the same issue (code: -32000, message: exceeds block gas limit, data: None) with forge script and forge create deploying to the Goerli testnet

Version: forge 0.2.0 (63c71b4 2022-09-12T00:09:05.6296Z)

OS: macOS Big Sur v11.6.8

Even tried increasing the gas price & gas limits:

forge script script/deploy/ImpactVaultGoerli.s.sol --rpc-url https://rpc.goerli.mudit.blog/ --private-key $GOERLI_PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_API_KEY --gas-price 100000000000 --gas-limit 3000000000 -vvvv

Any insight or assistance would be greatly appreciated.

blackmarkt avatar Sep 21 '22 05:09 blackmarkt

+1 running into this as well

douglasqian avatar Sep 21 '22 06:09 douglasqian

I managed to get it to work more predictably by making the -g vale a bit smaller (I think it is supposed to scale the gas estimations by a percent).

I was running it with -g 300, making it -g 200 seemed to work (exact numbers will probably depend on your code-base - and you can't really go below 100 for that value).

JasoonS avatar Sep 21 '22 07:09 JasoonS

I managed to get it to work more predictably by making the -g vale a bit smaller (I think it is supposed to scale the gas estimations by a percent).

I was running it with -g 300, making it -g 200 seemed to work (exact numbers will probably depend on your code-base - and you can't really go below 100 for that value).

I'm still getting the same error setting the -g flag

blackmarkt avatar Sep 21 '22 14:09 blackmarkt

UPDATE: @douglasqian helped me by having us use another RPC node.

The one that worked was https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161

The one that was giving the error was https://rpc.goerli.mudit.blog/

blackmarkt avatar Sep 21 '22 19:09 blackmarkt

Btw @blackmarkt - you shouldn't be sharing those RPC links publicly (especially if they are being paid for).

JasoonS avatar Nov 17 '22 19:11 JasoonS

@JasoonS we aren't paying for that first one, it was a public Goerli RPC node URL we found here

douglasqian avatar Nov 18 '22 20:11 douglasqian

Closing as wontfix / stale as this appears to be related to the RPC being used (https://github.com/foundry-rs/foundry/issues/3294#issuecomment-1254125192), not a bug in the implementation

zerosnacks avatar Jun 26 '24 12:06 zerosnacks