-
Notifications
You must be signed in to change notification settings - Fork 109
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
Fix PoS mempool dynamic fee market #1252
Fix PoS mempool dynamic fee market #1252
Conversation
txn, 0, MaxBasisPoints, MaxBasisPoints, MaxBasisPoints, MaxBasisPoints, maxBlockSizeBytes) | ||
txn, | ||
// TODO: Allow the caller to specify minFeeRateNanosPerKB | ||
0, |
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.
I can update this in a separate PR. It's a relatively minor change.
3710328
to
a14ce53
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @diamondhands0 and the rest of your teammates on |
343fa7f
to
6a5aca6
Compare
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.
LGTM. I moved the overrideFeeRateNanosPerKB
change to #1255. That way, we can merge this rest of this PR asap.
A bunch of things were broken in our mempool fee estimation logic. All fixed now. Summary:
if bucketMinFee <= globalMinFeeRate
check.1000 (= 10%)
while the latter would map to1.1 (= 10000 + 1000 / 10000)
. This caused fee-time ordering to be basically completely broken. All fixed now, and fixed tests.computeFeeTimeBucketRangeFromExponent
, there was a weird edge-case where we could have a fee bucket with start less than end. This can't happen in a real scenario, though, only when the bucket growth rate is like 1bp, which is ridiculously small. And I only found it because of the growth rate <> multiplier issue mentioned previously, which was causing a 10% growth rate to be threaded through as 1bp.For reference, in case it's useful, the way I found all this stuff was I slowed the block time down to 1 block every 10s and made the NumPastBlocks for the block estimator 5 blocks using the params in constants.go (so that txns would accumulate in the mempool) and added logging of the fees. Then I wrote a script that blasted the mempool with txns and noticed that the fees weren't adjusting properly, which led me down the rabbit-hole to find all of these issues. After fixing all the issues I took some time to optimize all the params, and then used my script to exercise everything and make sure it's fully 100% adapting correctly. Specifically, I saw that the fee goes up correctly once the mempool has a full block's worth of txns accumulated in it, stays high for a few blocks because of the block estimator, and then starts to go down as more blocks come through. It all works really well.