-
Notifications
You must be signed in to change notification settings - Fork 79
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
chore: reduce default wait interval #550
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is for some specific chain request their used to be a file where we can adjust this interval for specific chains.
Whats the benefit of reducing default polling to 2 ms from 5? we removed the hard coded value but the constant variable can be changed by env var setting? |
Hey, So this number we're picking is just a default. Devs can go and set this themselves but we don't really document it widely so they'd have to search it out so in all likelihood they probably don't customise it all that often. This value we're discussing is, in effect, the 'max amount of unnecessary milliseconds after a tx has been mined that we make a user wait for the receipt'. We should set it to as small a number as possible (without causing 502 timeouts on the backend). It has a big impact on the effective latency that end users notice imo. I think getting this number right is pretty important, and it might be different from chain to chain based on backend load, block-mining-times per chain etc etc. |
The problem is: 'clients don't know when the backend has mined a tx'. The current solution is for the client to send requests every 'n' milliseconds to check if the backend is done (polling). This PR reduces 'n'. A better (definitely longer term) solution might be to switch the backend to a websocket (which has pub/sub bi-directional flow of information), so the backend can notify the client when txs have been mined, instead of the client having to ask on an interval (which unnecssarily adds to the wait time) |
Also Chirag in this PR I'm not added an env var here. I've just added the constant directly in the file - there's no change in that regard. |
421523a
to
cb217a8
Compare
PR-Codex overview
This PR focuses on updating the version of the package, adjusting the default polling interval, and refining error messages in the
Bundler
class for better clarity.Detailed summary
4.6.4
toCHANGELOG.md
and noted a patch change to shorten the defaultpollInterval
.version
inpackage.json
from4.6.3
to4.5.6
.POLL_INTERVAL
set to2000
insrc/bundler/Bundler.ts
.POLL_INTERVAL
.Bundler
class for clarity during receipt retrieval failures.