opentensor / subtensor

Bittensor Blockchain Layer
The Unlicense
160 stars 159 forks source link

Gas estimation issue on contract deployment #1005

Open gztensor opened 5 days ago

gztensor commented 5 days ago

Datura is reporting an issue with gas estimation when they are deploying ERC-20 contracts (just as an example). The only difference from our e2e tests is probably the bytecode size. First, we need another contract deployment test that deploys a standard ERC-20 to reproduce it locally.

They are saying that this fails:

const contract = await contractFactory.deploy();

but this succeeds:

const contract = await contractFactory.deploy(...parameters, {
        gasLimit: gasLimit 
    })

i.e. they have to explicitly specify gas limit.

open-junius commented 3 days ago

The deployment of erc20 contract is fine in both devnet-ready and devnet branch in subtensor. The https://github.com/opentensor/subtensor-js-tests/blob/main/src/evm/eth.erc20.deploy.test.js is added. Both deploy with gas_limit and without gas_limit are passed.