forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin#27622: Fee estimation: avoid serving stale fee estimate
d2b39e0 test: ensure old fee_estimate.dat not read on restart and flushed (ismaelsadeeq) cf219f2 tx fees, policy: read stale fee estimates with a regtest-only option (ismaelsadeeq) 3eb241a tx fees, policy: do not read estimates of old fee_estimates.dat (ismaelsadeeq) 5b886f2 tx fees, policy: periodically flush fee estimates to fee_estimates.dat (ismaelsadeeq) Pull request description: Fixes bitcoin#27555 The issue arises when an old `fee_estimates.dat` file is sometimes read during initialization. Or after an unclean shutdown, the latest fee estimates are not flushed to `fee_estimates.dat`. If the fee estimates in the old file are old, they can cause transactions to become stuck in the mempool. This PR ensures that nodes do not use stale estimates from the old file during initialization. If `fee_estimates.dat` has not been updated for 60 hours or more, it is considered stale and will not be read during initialization. To avoid having old estimates, the `fee_estimates.dat` file will be flushed periodically every hour. As mentioned bitcoin#27555 > "The immediate improvement would be to store fee estimates to disk once an hour or so to reduce the chance of having an old file. From there, this case could probably be detected, and refuse to serve estimates until we sync." In addition, I will follow-up PR to persist the `mempoolminfee` across restarts. ACKs for top commit: willcl-ark: ACK d2b39e0 instagibbs: reACK bitcoin@d2b39e0 glozow: ACK d2b39e0. One nit if you follow up. Tree-SHA512: 4f6e0c296995d0eea5cf80c6aefdd79b7295a6a0ba446f2166f32afc105fe4f831cfda1ad3abd13c5c752b4fbea982cf4b97eaeda2af1fd7184670d41edcfeec
- Loading branch information
Showing
7 changed files
with
168 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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