buidler-labs / hashgraph-venin-js

The, service over-arching, Hedera Stratospheric SDK for JS developers
https://venin.buidlerlabs.com
MIT License
19 stars 1 forks source link

Wall of text listed at INSUFFICIENT_GAS contract-create failure #81

Closed 3Nigma closed 2 years ago

3Nigma commented 2 years ago

It looks like if you're uploading a contract with insufficient gas, you get a wall-of-text printed on CLI:

StatusError: receipt for transaction 0.0.0@1651520751.171769484 contained error status INSUFFICIENT_GAS
/home/vic/projects/3vs/headstarter-contracts/node_modules/solc/soljson.js:1
null;var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_
...

RuntimeError: abort(StatusError: receipt for transaction 0.0.0@1651520751.171769484 contained error status INSUFFICIENT_GAS). Build with -s ASSERTIONS=1 for more info.
    at process.abort (/home/vic/projects/3vs/headstarter-contracts/node_modules/solc/soljson.js:1:13012)
    at process.emit (node:events:527:28)
    at emit (node:internal/process/promises:140:20)
    at processPromiseRejections (node:internal/process/promises:274:27)
    at processTicksAndRejections (node:internal/process/task_queues:97:32)

Node.js v17.8.0

It very much looks like the huge chunk of text is the solidity compiler itself.

We need to not let this happen and protect the developer's CLI from 25MB of non-sensical gibberish.

The problem might also be in the hedera SDK itself. We don't know that for sure.

3Nigma commented 2 years ago

We don't know for sure if this is the only scenario where this behavior is triggered.

3Nigma commented 2 years ago

Reported upstream in ethereum/solc-js#493 and ethereum/solidity#12228