-
Notifications
You must be signed in to change notification settings - Fork 7
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
Attempt to verify Contract using Hardhat Fails with 500 Error. #210
Comments
Hi @bugbytesinc thanks for reporting this. Are you able to provide this Hardhat project so I can reproduce the error? Thanks. |
Hi @bugbytesinc, after further investigation I suspect the error is raised while compiling the contract. In particular, the output of the Here's a minimal snippet to reproduce this kind of error (essentially what the verification service is doing to invoke #!/usr/bin/env node
const { exec } = require('child_process');
if (process.argv.length < 3) {
exec(`${process.argv[1]} 1`, { maxBuffer: 10 },
(error, _stdout, _stderr) => {
if (error) console.log(`Error exception while running child process:`, error);
}
);
} else {
console.log('123456789ab');
} (for this to work the file for the script must be executable) If you can a share an example where this happens I could see if that actually the problem and if there is a workaround. |
Trying to see if we can get a clean room example, it will take some doing. |
Apologies, for not getting you an example contract yet, the project is a bit complex and factoring out a working example is proving difficult. However, I was able to try another approach and have discovered pretty strong evidence that indeed the configuration of the I downloaded the hedera-sourcify project and started a local server pointed it at testnet. After making the following change:
our project validated without error. |
So in summary, it looks to me that we have a situation where the Hedera network will accept contracts of a certain size that the default configuration of the |
Hey @bugbytesinc, thank you for confirming this.
Are you able to tell how big the project is? How many files, contracts, interfaces, libraries are involved in the compilation, roughly. This is to ensure that we are on the right track. The current On top of that, are you able to provide the output of the |
Just to avoid any future confusion, these two thing are unrelated. The error here is about the size of the |
Looks like upstream Sourcify already ran into this issue. It was solved here ethereum/sourcify@585b241. |
In our project, running this against
|
Running against a version modified with the above patch yields:
(please note, I didn't change the browserURL configuration so the reference to repository-verify.hashscan.io will not be valid) |
The log file is too large to upload, github will not load it. |
hedera-sourcify-solc-output - Abriged.log |
Roughly 141 Solidity files to compile |
Please see above, it is too large to upload to github, is there another means we can get it to you if you wish to look at it? |
What I have seen is that changing that value to 40MB results in successful validation of our contracts. |
When I pull the latest hedera sourcify, I get code that has even a smaller value than what is cited in a the upstream project cited above:
hedera-sourcify/sourcify/services/server/src/server/services/compiler/local/solidityCompiler.ts Line 331 |
The Hedera Sourcify source code is pegged to an older version: https://github.com/ethereum/sourcify/commits/9c0dd54913422ddb1a941af5494be01faa065c7b/ (May 14) This update is from May 29 Perhaps updating the upstream versions utilized by hedera sourcify might solve our issue. |
Indeed, this is the case. We usually wait until upstream Sourcify makes a new release and is stable enough for us to update.
That should be the case. Upstream Sourcify released a new version last week. They made several changes, in particular to use a DB as a storage repository instead of a filesystem. If the new version if compatible then we can update on our side to fix this issue. Otherwise, we will take a bit longer to accommodate for the changes in the new version. |
Description
There is a particular contract that fails with a 500 error, see error log below.
Steps to reproduce
Compile contracts using hardhat
Attempt to verify
Additional context
Hedera network
testnet
Version
Latest
Operating system
Linux
The text was updated successfully, but these errors were encountered: