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

Maximum call stack size exceeded when loading solc-json compilers <0.6.2 in VerificationService.init() #1473

Open
kuzdogan opened this issue Jul 15, 2024 · 0 comments

Comments

@kuzdogan
Copy link
Member

Discovered on #1465 in the test The downloadFunction for the solc-js compilers getSolcJs fails at the import stage for compilers earlier than 0.6.2. Weirdly this does not happen when the server is started and the compiler is downloaded and loaded for a contract but only on the init stage.

To reproduce:

  • Make sure to run on a non-native platform (ie. no linux-amd64, macos-amd64, windows-amd/64) or override the platform
  • Check out c710f93b4e452e88086db2b41f58f0d382431ffe
  • Run the test with cd services/server && npx mocha test/unit/VerificationService.spec.ts

The test will fail with Maximum call stack size exceeded.

  • Now remove version 0.1.1 on line 36 and the tests should pass.

To compare initializing to downloading on the fly when the server runs:

  • Instead of 0.1.1 in the mock object add: "0.4.18": "soljson-v0.4.18+commit.9cf6e910.js",
  • Run the tests and it will fail.
  • Delete the downloaded 0.4.18 compiler and run the server.
  • Verify a contract with 0.4.18 e.g. the USDT contract on Eth Mainnet (1) with Etherscan: 0xdac17f958d2ee523a2206206994597c13d831ec7
  • This time the compiler will download, load successfully and compile the contract.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant