0

I am using Truffle suit to develop, test and deploy my smart contracts. It works pretty well on test networks but on live one it slow like a snail.

For instance this transaction - it is just migration contract (from truffle infrastructure) deployment, estimated time of confirmation with price 40 GWei is about 2 hours. Overall deployment has about 18 transactions (truffle, after each successfully confirmed transaction stores it in its own migration contract to avoid redeployment of already deployed stuff).

40 Gwei is more then maximum gas price across the network and I am wondering is it possible to speedup deployment somehow? 2 hours per transaction is unacceptably slow.

1

Infura is unlikely to be the bottleneck - they are pretty optimised for scale and throughput of transactions.

Assuming your transaction is being broadcast (which should mean it shows as Pending in etherscan.io) then this comes down largely to gas prices.

Gas prices have been very high in the last 24 hours and there have been lots of backed up transactions - all you can do here is pay more gas, which for contract deployment is painful due to the amount of gas it consumes.

You could try tuning the gas limit to be a little lower (closer to what is actually being used) as miners may be more inclined to include transactions which are smaller and fit into blocks more flexibly.

-1

Are you deploying through Infura or local node?

I am using etherlime for this. You can check this out:

Here is an example of one of my deploy.js files

const etherlime = require('etherlime');
const ProductionFactory = require('./testContracts/ProductionFactory');
const ProductionFactoryProxy = require('./testContracts/ProductionFactoryProxy');
const IProductionFactory = require('./testContracts/IProductionFactory');

const defaultConfigs = {
    gasPrice: 20000000000, // Choose your configs wisely
    gasLimit: 4700000
}

const deployer = new etherlime.InfuraPrivateKeyDeployer('Your Private Key Here', 'ropsten', 'Your Infura Key', defaultConfigs);

const deploy = async () => {
    const productionFactoryWrapper = await deployer.deploy(ProductionFactory);
    const proxyWrapper = await deployer.deploy(ProductionFactoryProxy, productionFactoryWrapper.contractAddress);
    const upgradeableFactoryWrapper = deployer.wrapDeployedContract(IProductionFactory, proxyWrapper.contractAddress);

    const initTransaction = await upgradeableFactoryWrapper.contract.init(randomAddress, defaultConfigs);
    const result = await upgradeableFactoryWrapper.verboseWaitForTransaction(initTransaction.hash, 'Init Factory');

}

You can switch from InfuraPrivateKeyDeployer to JSONRPCDeployer easily

  • Using infura. Could it be bottleneck? – Alex G.P. Jul 2 '18 at 11:21
  • As I see etherlime tries to be just an additional layer between developer and other deployment stuff. It doesn't helps here because in your example it uses the same truffle infrastructure. How much gas your contracts consumes to deploy and how much time it takes to deploy to Frontier? – Alex G.P. Jul 2 '18 at 12:53
  • How come does it use the same truffle infrastructure? It uses ethers and infura. Truffle is concerned with compilation of the smart contracts. I am pretty sure it might be infura that is giving you trouble but simetimes it is the truffle migrations. – George Spasov Jul 2 '18 at 19:03
  • Also to the downvoters? Please suggest better instead hating on me trying. – George Spasov Jul 2 '18 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.