Skip to content
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

Contract deploy promise never returns in beta.52 #2681

Closed
spalladino opened this issue Apr 14, 2019 · 7 comments
Closed

Contract deploy promise never returns in beta.52 #2681

spalladino opened this issue Apr 14, 2019 · 7 comments

Comments

@spalladino
Copy link
Contributor

Description

Awaiting on a transaction to deploy a web3 contract in beta.52 never returns, even though the transaction does go through and the contract is deployed. Tested in ganache with both instant seal and 1s block time. The same snippet worked fine in beta.37.

Expected behavior

Awaiting on Contract.deploy().send() should return after the transaction is mined.

Actual behavior

Awaiting on Contract.deploy().send() never returns.

Steps to reproduce the behavior

  1. Create a new web3 contract instance
  2. Await on Contract.deploy().send()

Error Logs

None, but ganache reports the transaction as successful:

  Transaction: 0xd74bac6e76aa75e9c9a8998cc0e1835acf38ddf92cd07d47e694709b12b7f58c
  Contract created: 0x5b1869d9a4c187f2eaa108f3062412ecf0526b24
  Gas usage: 412242
  Block Number: 44
  Block Time: Sun Apr 14 2019 17:27:16 GMT-0300 (Argentina Standard Time)

Gists

const Web3 = require('web3');

async function main() {
  const web3 = new Web3('http://localhost:8545');
  const [from] = await web3.eth.getAccounts();
  const artifact = require('./Greeter.json');
  const data = artifact.compilerOutput.evm.bytecode.object;
  const abi = artifact.compilerOutput.abi;
  const Greeter = new web3.eth.Contract(abi, null, { data, gas: 1e6 });
  const greeter = await Greeter.deploy({ arguments: ["Hello"] }).send({ from });
  console.log(`Deployed at ${greeter.options.address}`);
}

main();

Versions

  • web3.js: 1.0.0-beta.52
  • nodejs: v10.13.0
  • ethereum node: Ganache CLI v6.4.0 (ganache-core: 2.5.1)
@nivida
Copy link
Contributor

nivida commented Apr 14, 2019

Thanks for opening this issue!
Did you configure the transactionConfirmationBlocks as described here?

@spalladino
Copy link
Contributor Author

Adding that configuration fixed the issue, thanks! That said, I would expect the option to have a reasonable default value if it is not set.

@ejwessel
Copy link

I too was able to fix this with transactionConfirmationBlocks, but if I'm developing locally with ganache and deploying I need to manually mine a block in order to get a response.

Is there a reasonable way to get around having to do this manual step?

@szerintedmi
Copy link

i think I have the same issue, see #2661

@nivida
Copy link
Contributor

nivida commented Apr 14, 2019

@ejwessel We have an issue with the transaction confirmation workflow over an HTTP connection as mentioned from @szerintedmi. Because of this will I close this issue.

@levino
Copy link
Contributor

levino commented Apr 16, 2019

As long as the issue is not fixed, it should be left open.

@nivida
Copy link
Contributor

nivida commented Apr 16, 2019

It's a duplication of #2661 @levino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants