foundry
foundry copied to clipboard
Getting `exceeds block gas limit` error on `forge script` deployment
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.
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.
+1 running into this as well
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 managed to get it to work more predictably by making the
-gvale 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 200seemed 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
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/
Btw @blackmarkt - you shouldn't be sharing those RPC links publicly (especially if they are being paid for).
@JasoonS we aren't paying for that first one, it was a public Goerli RPC node URL we found here
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