-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Forge script works when simulating but not when broadcasting #7639
Comments
Forgot to add, this was run in a CI as well, so it rules out caching issues. |
Was able to find in the logs the call that fails:
|
I ended up figuring out what happened. Deploying the contract standalone didn't work either
So the problem is that CreateContractSizeLimit was exceeded and anvil was just showing a revert with no info. |
Hi @mattsse, Anvil logs:
forge logs:
When I run the script without Any idea what could be wrong or how could I debug it? Environment: |
[UPDATE] |
Marking as resolved, added an entry for a followup to improve error message information in Anvil |
Component
Forge, Anvil
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (1281421 2024-04-05T00:21:15.963758000Z)
What command(s) is the bug in?
forge script
Operating System
macOS (Apple Silicon)
Describe the bug
I have a somewhat complex script that deploy proxies, contract implementation and initializes them. The goal is to create a devchain in anvil that matches a fresh deploy to use for testing.
The scrip works perfectly fine when simulating (without --broadcast flag), but when I turn on the broadcast, it tries to send 377 tx and fails in tx 1#69 with just:
It's also worth noting
cast
has a different opinion on how that tx went:I'm running Anvil with
$ anvil --port $ANVIL_PORT --gas-limit 50000000
And starting the script with:
$ forge script migrations_sol/Migration.s.sol --rpc-url http://127.0.0.1:$ANVIL_PORT -vvvvv --broadcast --slow --non-interactive -- $LIBRARIES --revert-strings --legacy
I was able to track down the line that fails and I'm sure it's a call to create2 as described in the docs, but that's done many times before in the script and it works. If you're curious here's where it fails and here's where the contract to be deployed is specified. Sorry for the debug traces.
As a side note, here's a couple of problems that compounded with this:
The text was updated successfully, but these errors were encountered: