Repository navigation
mempool: fee flow meter decays each bucket once per admit - #1341
Merged
reardencode merged 2 commits intoNov 2, 2026
Merged
Conversation
note_admit decayed the bucket it updated, then applied the EMA's 1 - alpha to it again, so a steady stream settled near half its rate. Reads also moved the clock the next sample's gap was measured from. Keep a separate admit clock for the gap and add only the new sample after the decay. Part of reardencode#1274. The CPFP chunk rate is left for after the package admit rework in reardencode#1333.
Contributor
There was a problem hiding this comment.
APPROVE. The updated bucket was decayed twice, and the sample gap followed the decay clock, so a fee refresh shortened it. note_admit now decays once, then adds sample * alpha, and takes the gap from last_admit.
Float64 recurrence of the same update: two admits move from 91.151 (rounds to 91) to 91.571 (rounds to 92). A one-second stream of 10,000 WU settles at 5011.55 under the old double decay (rounds to 5,012) and at 9999.990 after 3,000 steps of this update (rounds to 10,000). The new steady-stream and snapshot tests both fail on the old formula. The added tests are a few thousand arithmetic steps with no sleeps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #1274: the first two points.
The flow meter behind
estimatesmartfee, Electrum and Esplora counted a steady stream at about half its rate, so near targets could quote low.note_admitdecayed tonow, which already applies1 - alphato every bucket, then applied1 - alphato the updated bucket again. 10,000 WU every second read 5,012 WU/s after 20 half-lives and now reads 10,000.The gap a sample is divided by was measured from the last decay, and
fullnessandadmit_rates_wu_sdecay, so a fee refresh between admits changed the next sample. The gap is now measured from the previous admit.two_admits_pin_the_bucket_emamoves from 91 to 92: 46.0 after the first admit decays to 45.58, plus 46.0 from the second.CPFP members at the chunk rate is not in this PR. #1333 reworks the package admit path that change goes in, so it follows once that lands.