Constant eth_blockNumber
invocation
#2416
Replies: 2 comments 1 reply
-
Just add to this, eth_chainId is also being called, but I switched to StaticJsonRpcProvider and it seems it has gone away, but eth_blockNumber is still being called a lot. |
Beta Was this translation helpful? Give feedback.
-
It’s every 4s by default, but it can be adjusted using That’s how events work. When you register an event listener, it needs to periodically poll the backend. The most efficient way to do this is to check if the block number has changed; since no other event can have happened in the meantime, and once it changes, all events are checked. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I noticed that as soon as I subscribe to an event using
contract.on()
with filter specified, ethers.js keeps calling eth_blockNumber (maybe every 2-3 seconds). I'm not sure why, and if this is an issue, but the problem I have with this is that my Alchemy usage is way over the top because of this. Is there any way I can disable this behavior?Beta Was this translation helpful? Give feedback.
All reactions