eth_getBlockByNumber request call are so high

Hi, @vanijatko.social,

What do you use instead of HDWalletProvider ?

I cant get truffle to complete migration ever… getBlockByNumber uses up all limits I have…

Thanks!

Hi everyone,
I was experiencing the same problem when using Truffle HD Wallet provider. After some troubleshooting, I realised that the object returned from the wallet provider has a property called _pollingInterval which determines the interval to poll the state of the blockchain (this is what uses up so many requests).

This value can be manually adjusted to something like 1800000 (30 minutes) with the following code before passing the provider object into web3:
provider.engine._blockTracker._pollingInterval = 1800000;
Where provider is the object returned by Truffle HD Wallet provider when creating an instance of it. This seems to have no negative impact on interacting with the blockchain and dramatically reduces the requests to Infura. Hope this helps.

3 Likes

very useful info and resolved my issue. thank you

2 Likes

Hello TheAndrei
i have the same issue but when i added it to the truffle-config i still get 1000s of requests Screenshot - 9fd8a36f5ac27cc685a2422aae29f90e - Gyazo
how/where am i adding
provider.engine._blockTracker._pollingInterval = 1800000; ??