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

Transaction confirmation poll rate as a constructor option #2621

Closed
angus-hamill opened this issue Mar 31, 2019 · 10 comments · Fixed by #4584
Closed

Transaction confirmation poll rate as a constructor option #2621

angus-hamill opened this issue Mar 31, 2019 · 10 comments · Fixed by #4584
Labels
1.x 1.0 related issues 2.x 2.0 related issues Enhancement Includes improvements or optimizations
Projects

Comments

@angus-hamill
Copy link

Description

In the TransactionObserver class, the polling rate is set to poll every 1000 ms. While this is fine for the mainnet and testnets, people using private networks or ganache have experienced a significant performance dip.
I personally have fixed this locally by changing the observer to poll every 100ms.
Perhaps this could be added as a configurable option (with a default of 1000), similar to the options added under this new transaction confirmation workflow.
Plus it's nice to remove hardcoded values in the codebase.

Expected behavior

Transaction confirmations are processed multiple times per second.

Actual behavior

Confirmations take up to 1000ms each, a hardcoded value.

Steps to reproduce the behavior

Configure web3 with any private network that has a high transaction throughput and try to run many transactions in a row.

Versions

  • web3.js: 1.0.0-beta.51
@nivida nivida added the Enhancement Includes improvements or optimizations label Apr 1, 2019
@silravend
Copy link

May I ask where to change it to 100ms, please?

@silravend
Copy link

silravend commented Apr 3, 2019

`let accounts;
let contract;

beforeEach(async () => {
accounts = await web3.eth.getAccounts();
contract = await new web3.eth.Contract(interface)
.deploy({ data: bytecode })
.send({ from: accounts[0], gas: '500000'})
});

describe('LimitLess', () => {
it('deploys a contract', async () => {
done();
});
});`

I tried to run this, and got :
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

@princesinha19
Copy link
Contributor

@nivida I think we can add an option in the constructor for transactionPollRate in AbstractWeb3Module class. What's your thinking here?

@princesinha19
Copy link
Contributor

@nivida add this too in 1.0 milestone.

@nivida nivida added this to Proposed To Do's in 1.0 Apr 16, 2019
@nivida nivida moved this from Proposed To Do's to Accepted To Do's in 1.0 Apr 30, 2019
@nivida nivida added the 2.x 2.0 related issues label Jun 20, 2019
@nivida nivida added the 1.x 1.0 related issues label Oct 13, 2019
@github-actions
Copy link

github-actions bot commented Jul 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions

@github-actions github-actions bot added the Stale Has not received enough activity label Jul 4, 2020
@forshtat
Copy link

forshtat commented Sep 2, 2020

Hey @nivida @princesinha19 !
May I ask what is the status of this issue? It looks here like it was accepted and then closed.
Is there currently no way to configure the polling rate? I understand there is a transactionPollingTimeout, but it only changes the number of 1000ms intervals until the exception is thrown, am I right?

@steelep
Copy link

steelep commented Jan 19, 2021

Bumping this, I have patched my own version, but would love to see this in the next release.

@GregTheGreek
Copy link
Contributor

@steelep can you share a code snippet?

@nazarhussain
Copy link
Contributor

As a community PR is created so reopening the issue.

@nazarhussain nazarhussain reopened this Dec 2, 2021
@nazarhussain nazarhussain linked a pull request Dec 2, 2021 that will close this issue
14 tasks
@github-actions github-actions bot removed the Stale Has not received enough activity label Dec 3, 2021
@nazarhussain
Copy link
Contributor

Closed by #4672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues 2.x 2.0 related issues Enhancement Includes improvements or optimizations
Projects
No open projects
1.0
  
To Do's
Development

Successfully merging a pull request may close this issue.

8 participants