deso-protocol / core

DeSo core node
https://docs.deso.org
MIT License
325 stars 107 forks source link

Fix PoS mempool dynamic fee market #1252

Closed diamondhands0 closed 5 months ago

diamondhands0 commented 5 months ago

A bunch of things were broken in our mempool fee estimation logic. All fixed now. Summary:

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.

tholonious commented 5 months ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @diamondhands0 and the rest of your teammates on Graphite Graphite