Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixed a bug in the console wallet's debouncer where the tokio delay did not perform as expected. This was replaced with a tokio interval with missed tick behaviour set to
MissedTickBehavior::Delay
.Note: I know this is totally different from the approach in #3375, but it fixes a bug to present a working alternative.
Motivation and Context
The debouncing cooldown period was not honoured by the tokio delay in the select loop. Compounded to this the event fired consecutively if the system got busy.
Sampled time measurements of the change this PR brought measuring events
_ = interval.tick() => {
below with a user-configured debouncing cooldown period of 60s. The lags represent balance update requests that were ignored from the beginning of the time interval with the balance update only occurring at the end of the interval. The wallet in question started receiving 250 transactions during this period, therefore the high balance update request rate.The balance refresh query time from before the 250 transactions was sent till after is shown below:
How Has This Been Tested?
System-level testing