Skip to content

refactor: use setinterval instead of while loop in tx broadcaster #39

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

Closed

Conversation

hugocaillard
Copy link

Context

It was discovered that the tx pace slows down in time.
This PR attempts to make sure that the timing is more linear and closer to the desired interval.
With this setInterval, we boradcast tx every N seconds, and it's not impacted by networks.

With the while (true), we would wait for the previous tx to be broadcasted + N seconds to broadcast the next tx.

We'll have to keep an eye on the logs, but this could ensure stable tx pace

@hugocaillard hugocaillard requested a review from hstove August 6, 2024 14:00
@hstove
Copy link
Contributor

hstove commented Aug 6, 2024

I'm running this locally to make sure it works (I'm sure it will), but I also think this won't help if the issue is due to an increase in RPC latency when fetching account nonces or even when broadcasting the tx. I'm still ok with merging it, but we should monitor and see if this fixes the issue in a long-running environment.

@hugocaillard
Copy link
Author

@hstove

this won't help if the issue is due to an increase in RPC latency

With this PR we avoid the cascading slow downs, where previous calls would delay next ones.
This ensure that we at least try to broadcast the txs at a steady pace

@CharlieC3 CharlieC3 deleted the branch feat/signer September 4, 2024 14:27
@CharlieC3 CharlieC3 closed this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants