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

Bug: backend: failed while inspecting: Transaction(CreateInitcodeSizeLimit)) #5088

Closed
2 tasks done
pcaversaccio opened this issue May 31, 2023 · 11 comments
Closed
2 tasks done
Labels
T-bug Type: bug

Comments

@pcaversaccio
Copy link
Contributor

pcaversaccio commented May 31, 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 (a5c2741 2023-05-31T00:03:46.340876004Z)

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

For repro, use my repo here with the vyper-039 branch and simply run forge test.

I upgraded my test setup using solc 0.8.20 and evm_version='shanghai'. However, I get multiple errors like the following if I run forge test (see here a CI run example: https://github.com/pcaversaccio/snekmate/actions/runs/5132149269/jobs/9233075709#step:11:44)

2023-05-31T11:14:59.396656Z ERROR forge::multi_runner: error=Unrecoverable error: Err(Eyre(
backend: failed while inspecting: Transaction(CreateInitcodeSizeLimit)))

I'm fully aware of the init code size limit introduced by shanghai but I'm not sure about this error and its impact. It seems that the tests are running successfully but instead of lasting now (around 25-30mins; see e.g. https://github.com/pcaversaccio/snekmate/actions/runs/5126407871/jobs/9220852266#step:11:1), they are completed within 7-10 mins (see e.g. https://github.com/pcaversaccio/snekmate/actions/runs/5132149269/jobs/9233075709#step:11:1)

image
image

I can't explain the performance boost tbh. This smells like something is wrong (except ofc if Foundry, ethers-rs or any other major dependency was significantly refactored).

@pcaversaccio pcaversaccio added the T-bug Type: bug label May 31, 2023
@gakonst gakonst added this to Foundry May 31, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry May 31, 2023
@pcaversaccio pcaversaccio changed the title backend: failed while inspecting: Transaction(CreateInitcodeSizeLimit)) Bug: backend: failed while inspecting: Transaction(CreateInitcodeSizeLimit)) May 31, 2023
@DaniPopes
Copy link
Member

DaniPopes commented May 31, 2023

The error here is that forge is failing to deploy the test contract itself (or a required library) because it's too big after the Shanghai changes, and it will get skipped.

Error is here:

e => eyre::bail!("Unrecoverable error: {:?}", e),

cc @mattsse @Evalir

@pcaversaccio
Copy link
Contributor Author

hmm interesting, that shanghai upgrade creates a lot of issues lol. Not sure what I should do now since I need to test my Vyper contracts with the latest 0.3.9 release and Vyper defaults to shanghai. Also, any idea about the performance boost? Is it because deployments are skipped as you mentioned?

@DaniPopes
Copy link
Member

Is it because deployments are skipped as you mentioned?

Yes. I'm not sure why only execution errors fail the tests, while anything else just gets logged and ignored..

@pcaversaccio
Copy link
Contributor Author

Yes. I'm not sure why only execution errors fail the tests, while anything else just gets logged and ignored..

100%. This can lead to false conclusions if people don't look into the logs...

@mattsse
Copy link
Member

mattsse commented May 31, 2023

... sigh, this is bad -.-

however bluealloy/revm#491 should fix that, but we don't have it in foundry yet

I believe #5089 should do it, mind trying this?

separately @Evalir we should treat this as test failures

@pcaversaccio
Copy link
Contributor Author

Can confirm that with https://github.com/foundry-rs/foundry/releases/tag/nightly-b0c95d0151efa536931d0fc9d3950adb081ea866 it fails now. When is bluealloy/revm#491 added? My PR here pcaversaccio/snekmate#122 needs the shanghai version and can't revert back (since need to test Vyper's default behaviour which is shanghai since version 0.3.8).

@mattsse
Copy link
Member

mattsse commented May 31, 2023

should be included,
what's the error now?

for testing, the contract code size limit should be disabled

@pcaversaccio
Copy link
Contributor Author

pcaversaccio commented May 31, 2023

Sorry I didn't use the latest forge version for testing. Seems to work (the CI is still running here: https://github.com/pcaversaccio/snekmate/actions/runs/5135950150/jobs/9242037892#step:11:18).

I mean I still get the warnings since some of my contracts are even bigger than 2x the init code limit. Maybe you can disable the warnings for the test compilations?

Warning (3860): Contract initcode size is 90430 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
  --> test/extensions/ERC4626.t.sol:13:1:
   |
13 | contract ERC4626VaultTest is ERC4626Test {
   | ^ (Relevant source part starts here and spans across multiple lines).
Warning (3860): Contract initcode size is 140508 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
  --> test/tokens/ERC1155.t.sol:17:1:
   |
17 | contract ERC1155Test is Test {
   | ^ (Relevant source part starts here and spans across multiple lines).
Warning (3860): Contract initcode size is 77723 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
 --> test/tokens/ERC[20](https://github.com/pcaversaccio/snekmate/actions/runs/5135950150/jobs/9242037892#step:11:21).t.sol:9:1:
  |
9 | contract ERC20Test is Test {
  | ^ (Relevant source part starts here and spans across multiple lines).
Warning (3860): Contract initcode size is 102289 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
  --> test/tokens/ERC721.t.sol:20:1:
   |
20 | contract ERC7[21](https://github.com/pcaversaccio/snekmate/actions/runs/5135950150/jobs/9242037892#step:11:22)Test is Test {
   | ^ (Relevant source part starts here and spans across multiple lines).

@mattsse
Copy link
Member

mattsse commented May 31, 2023

cool, looks like we need to suppress the error now.

on it!

@pcaversaccio
Copy link
Contributor Author

Completed via #5094.

@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Jun 1, 2023
@mattsse
Copy link
Member

mattsse commented Jun 1, 2023

nice, thanks for flagging

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
Development

No branches or pull requests

3 participants