0

I had posted on the GitHub Discussion as well. I have this massive smart contract and my goal is to study the scalability of the contract. The values work for smaller sizes. However, it fails at larger input sizes. And the error is just "revert" without any further error message. The only thing that I suspect could be the reason is that the gas consumed is high, beyond the default of the ~6,700,000. This is the error message I am getting and as you can see my gas consumption is nearly the default value.

     Error: Transaction has been reverted by the EVM:
{
  "transactionHash": "0xeb03e9e26a8650bd01978796904b8a838a484147f8fa614ae4e5fe8dd412aced",
  "transactionIndex": 0,
  "blockNumber": 30,
  "blockHash": "0x62145d296e26969427427aeafacc6e73d3dba9e3b50d856f55937b27e21f8d8b",
  "from": "0xdb253d9a39643489ba5c908909d85b1e58c4f74c",
  "to": "0xcd36d07737e1dc20853d0d7e04f11491a4370a8b",
  "cumulativeGasUsed": 6527886,
  "gasUsed": 6527886,
  "contractAddress": null,
  "logs": [],
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "status": false,
  "effectiveGasPrice": "0x0",
  "type": "0x0"
}
      at Object.TransactionError (/Users/harishk/.nvm/versions/node/v12.22.12/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/src/errors.js:93:1)
      at Object.TransactionRevertedWithoutReasonError (/Users/harishk/.nvm/versions/node/v12.22.12/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/src/errors.js:105:1)
      at /Users/harishk/.nvm/versions/node/v12.22.12/lib/node_modules/truffle/build/webpack:/node_modules/web3-eth/node_modules/web3-core-method/src/index.js:482:1

However, my truffle config does increase the gas limit.

module.exports = {
    networks: {
        development: {
            host: "127.0.0.1",
            port: 8545, // ganache
            gasPrice: 0,
            network_id: "*", // Match any network id
            websockets: true,
            baseFeePerGas: 0,
            gas:500000000000,
            maxPriorityFeePerGas: 20000000000000,
            maxFeePerGas:0
        }
    },
    plugins: ["truffle-contract-size"],
    compilers: {
        solc: {
            version: "0.7.0",
             settings: { // See the solidity docs for advice about optimization and evmVersion
                optimizer: {
                    enabled: true,
                    runs: 200
                }
             }
        }
    }
};

Similarly, my ganache executed with:

ganache --gasPrice 0 --chain.hardfork berlin -l 500000000000 --miner.callGasLimit=500000000000 --miner.defaultTransactionGasLimit=500000000000 -a 16 --chain.allowUnlimitedContractSize

Any help in resolving this issue is much appreciated. I have provided additional context below. My versions:

Truffle v5.2.0 (core: 5.2.0)
Solidity - 0.7.0 (solc-js)
Node v12.22.12
Web3.js v1.2.9
ganache v7.4.4 (@ganache/cli: 0.5.4, @ganache/core: 0.5.4)

Additional Context: A key part of the contract is two sets of multi-exponentiation each of size 256 vector. I have implemented it naively which means I have two loops, each with 256 iterations. The failure happens at these two lines - essentially first for loop completes and failure is in the second for loop. Further, the second for loop completes if I only iterate for ~100 iterations.

1 Answers1

0

I fixed the error. It appears that I had updated the gas limit in every file, except for the Client javascript file where I was sending the transaction. I fixed it and it works perfectly.