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

Obscure error messaging when running script with --verify #3242

Closed
2 tasks done
0xPhaze opened this issue Sep 16, 2022 · 10 comments
Closed
2 tasks done

Obscure error messaging when running script with --verify #3242

0xPhaze opened this issue Sep 16, 2022 · 10 comments
Labels
C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-bug Type: bug

Comments

@0xPhaze
Copy link

0xPhaze commented Sep 16, 2022

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 (359dd77 2022-09-15T00:04:51.833948Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

I was getting this weird error message.
image

It took me a while to pin it down to using forge script --verify while broadcasting, but not generating any transactions. Removing the --verify allowed me to see the message: "no transactions generated"

@0xPhaze 0xPhaze added the T-bug Type: bug label Sep 16, 2022
@gakonst gakonst added this to Foundry Sep 16, 2022
@gakonst gakonst moved this to Todo in Foundry Sep 16, 2022
@mattsse
Copy link
Member

mattsse commented Sep 16, 2022

looks like the linking step is the root cause for this, are you using only libraries that are in the project or something at a specific address?

@0xPhaze
Copy link
Author

0xPhaze commented Sep 16, 2022

I'm not using any libraries with public functions. I'm working with already deployed contracts in my script, forking from mumbai. The --verify might have been misleading, because now, after running it again it gets stuck with or without.

@mattsse
Copy link
Member

mattsse commented Sep 16, 2022

do you have the libraries = [] key set in your config

https://book.getfoundry.sh/reference/config/solidity-compiler#libraries

@0xPhaze
Copy link
Author

0xPhaze commented Sep 16, 2022

That did the trick for me, thank you very much. It was previously just not present in the config.

@mattsse
Copy link
Member

mattsse commented Sep 16, 2022

I'll keep this open to improve the error message(s)

@0xPhaze
Copy link
Author

0xPhaze commented Sep 16, 2022

Interestingly it appeared again. I played around a bit again and removed the --verify and it then worked (but without verifying the contracts of course).

@mattsse
Copy link
Member

mattsse commented Sep 16, 2022

hmm, will try to reproduce this,

is this public by any chance?

@0xPhaze
Copy link
Author

0xPhaze commented Sep 16, 2022

Yes, here: https://github.com/0xPhaze/gang-war/tree/198462993ade7cd4f578904da363454edb2a8e33
It seems to be reproducible on anvil

forge script deploy --rpc-url "http://127.0.0.1:8545" --private-key 0x83631fd2da5250fa4f9dd8c1057f6e53126de6dd9274b9aefbcc3eae3ada6a5f -vvv --ffi --broadcast

Though because of the setup scripts, it will think it has successfully deployed and you'll have to run rm -rf deployments/31337 to delete the stored deployments and "reset" it.

Edit: can just prepend US_RESET=true forge script... to not have to delete it every time. If I take out the --rpc-url then I get the same message "Code should have been linked before."

@rkrasiuk rkrasiuk added C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check labels Sep 17, 2022
@0xPhaze
Copy link
Author

0xPhaze commented Sep 22, 2022

Following up here. This seems to occur when I add more functions (or any code). If I delete some code, I can deploy without an error (and I'm pretty sure it does not have anything to do with "linking", unless I misunderstand that word). Could this then simply be when the max code size is reached? Did the error messages get messed up?

Edit: Perhaps ignore what I just wrote there (noticed that I was on an older version that didn't display the message). Just want to mention that this is still very much a real issue and currently is entirely hindering me from deploying in a specific repository. Got a friend to reproduce and he is able to run the scripts without any issues. For me the problem persists, even after re-installing foundry, cleaning, changing the config...

@0xPhaze
Copy link
Author

0xPhaze commented Sep 28, 2022

Fixed in gakonst/ethers-rs#1743

@0xPhaze 0xPhaze closed this as completed Sep 28, 2022
Repository owner moved this from Todo to Done in Foundry Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

3 participants