-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mempool: Use median time for tx finality checks.
This modifies the mempool transaction finality checks to use the past median time instead of the adjusted network time. This ensures the standardness rules match the upcoming consensus rules which reject transactions that are not after the median time of the last several blocks. Without this change, it is possible for transactions which can never make it into a block to be admitted to the mempool thereby wasting memory. The following is an overview of the changes: - Introduce a new callback to the mempool config named PastMedianTime for obtaining the median time for the current best chain so it can remain decoupled from the chain - Update the tx finality standardness check to use the callback - Remove the now unused TimeSource mempool config parameter - Update the mempool test harness and mock chain to use a mock median time - Update server to provide a closure for the mempool config that uses the cached median time for the current best chain to negate any additional performance impact the new calculations would otherwise cause from recalculating the median time for every new candidate tx validation
- Loading branch information
Showing
5 changed files
with
36 additions
and
12 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