Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify mempool interface with the ledger
Arising from the discussion on the mempool tests, it followed that the mempool could probably become less aware of the LedgerDB, the Changelog and the BackingStore, and indeed the mempool can just ask the LedgerDB for UTxO values. This PR implements that and some side changes. In particular this is a comprehensive list of the changes: - Some general cleanup on comments - Remove the `Proxy` from `ledgerTipPoint` - Remove the `idx` type parameter from the `Mempool` and `MempoolSnapshot` - Superflous indirection datatypes in `Mempool.Impl.Pure` are gone (`SyncWithLedger`, `RemoveTxs`,...) - Pure functions that revalidate got the revalidation factored out into `revalidateTxsFor` and the arguments re-sorted - Mempool now asks the ledgerdb to forward values. In particular - `LedgerInterface.getCurrentLedgerAndChangelog` is renamed to `LedgerInterface.getCurrentLedger` - `MempoolChangelog` is gone - new function `LedgerInterface.getLedgerTablesAtFor` which calls `LgrDB.getLedgerTablesAtFor` - `LedgerInterface.getBackingStore` is gone - Depending on the value returned from `getLedgerTablesAtFor` (of type `TablesForKeys`), new actions are performed. In particular if the anchor moved we read again, and if the ledger state is not found we recurse the whole action - The read lock is gone on the mempool side. - `Mempool.API.getSnapshotFor` now might fail. Acquiring the lock prevents it from failing. - `isTip` is now a `Point` which still contains the `ChainHash` it held before, but now it can be used to query for a point on the ledger database when forwarding
- Loading branch information
Showing
23 changed files
with
478 additions
and
575 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
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
Oops, something went wrong.