Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Customize timeout time (1.2) #3081

Closed
dmihal opened this issue Sep 26, 2019 · 3 comments
Closed

Customize timeout time (1.2) #3081

dmihal opened this issue Sep 26, 2019 · 3 comments

Comments

@dmihal
Copy link

dmihal commented Sep 26, 2019

Transactions that are not mined within a period of time will fail with the following message:

Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!

However, given the current network congestion, it's not uncommon for transactions to take long periods of time to be mined.

The amount of time and number of blocks to wait before timing out are currently hardcoded as constants in web3-core-method.

It should be possible for applications to customize these options so they can avoid transactions failing when the network is congested.

@haflinger
Copy link

Maybe fixed in 2.x :
https://github.com/ethereum/web3.js/blob/38895c1bd34d51a307f6d6777e58d9f4b32e5895/packages/web3-core-method/lib/factories/AbstractMethodFactory.js#L131

See documentation here : https://github.com/ethereum/web3.js/blob/2.x/docs/include_package-core.rst

const options = {
    defaultAccount: '0x0',
    defaultBlock: 'latest',
    defaultGas: 1,
    defaultGasPrice: 0,
    transactionBlockTimeout: 50,
    transactionConfirmationBlocks: 24,
    transactionPollingTimeout: 480,
    transactionSigner: new CustomTransactionSigner()
}

@dmihal
Copy link
Author

dmihal commented Sep 28, 2019

Cool, thanks @haflinger

I imagine this feature won't reach 1.x, so i'll close this

@dmihal dmihal closed this as completed Sep 28, 2019
@cgewecke
Copy link
Collaborator

@dmihal Hi. Just leaving a cross-ref here...

This addition to the 1.x branch is still alive & under consideration at #3070 - tracked via an earlier discussion in #1581.

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

No branches or pull requests

3 participants