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

Nested arrays not yet implemented. error crashing compilation against solc 0.6.x #215

Closed
lukaszh2o opened this issue Nov 8, 2022 · 3 comments · Fixed by #217
Closed

Comments

@lukaszh2o
Copy link

Changes introduced in PR #184 - commit 17656a2 , seems to be causing issues with compilation using Solc 0.6x (tested with 0.6.2, 0.6.7, 0.6.9, 0.6.10).

Each one of them fails to compile, either by UnimplementedFeatureError: Nested arrays not yet implemented. error. Including pragma experimental ABIEncoderV2; in compiled file results instead in YulException: Stack too deep when compiling inline assembly: Variable dataEnd is 1 slot(s) too deep inside the stack.

Preceding commit works just fine (2a2ce36)

@mds1
Copy link
Collaborator

mds1 commented Nov 8, 2022

Hmm this is interesting:

  • CI passes, which builds with 0.6.2, 0.7.0, 0.7.6, and 0.8.0. You can see the successful builds from this run I just did (the failing tests are unrelated)
  • But running those commands on my machine locally against the forge-std repo (macOS, not M1), all forge build --skip test --use solc:0.X.Y commands fail for any of those four versions. Specifically, 0.6.2 and 0.7.0 give UnimplementedFeatureError: Nested arrays not yet implemented. and the others give stack too deep
  • No errors if I locally run forge build --skip test which compiles with 0.8.17

pinging @leonardoalt in case anything comes to mind about why this might happen? It doesn't seem related to #207, though the difference in CI vs. local results does make me wonder if it's related to the different solc binaries being used?

cc'ing @nventuro for awareness since I know you had the same issue

@leonardoalt
Copy link

From the top of my head, my first guess would be that the new foundry lib code causes stack too deep in old compiler versions that didn't have the current optimizers, that is, the error messages are legit for older Solc versions. But if CI passes for 0.6.2 this might be wrong, so need to take a better look.

@mds1
Copy link
Collaborator

mds1 commented Nov 10, 2022

Ok, confirmed this is a forge-std issue. The reason CI passed it because it never compiled a contract that inherited from Test with older solc versions (since Test is abstract it wasn't compiled in CI, and we don't compile tests with lower versions).

I noticed/confirmed this when working on #217. The (string[2][] memory rpcs) = vm.rpcUrls(); line is the culprit. If anyone needs to reproduce to confirm that's the culprit, pull the forge-std version in #217, comment out everything in _constructor() except for that line, then run forge build --skip test --use solc:0.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants