-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CAD-4157: Stash AVVM to allow on-disk UTxO.
This commit provides ledger support for the transition of UTxO to on-disk storage. In particular, the translation between Shelley and Allegra is currently problematic, owing to the need to remove AVVM addresses (dormant since Byron) from the UTxO. This requires a linear scan of the UTxO, which is now stored on disk and hence cannot/should not be accessed in such a way. The solution to this is a bit of a hack; since the Byron UTxO are not stored on disk, and since AVVM addresses remain untouched during the Shelley era, we instead perform the scan at the Byron/Shelley boundary, store the set of UTxO in the ledger state, only to yield them to the consensus layer at the Shelley/Allegra boundary. Thus provided with the set of addresses, consensus passes them back as the UTxO, allowing the translation function to delete them. This change is written such that, with no on-disk UTxO, the ledger functionality remains identical, other than a slight bump in memory usage during the Shelley era. As far as possible, this commit minimises ledger changes. Thus, a pattern is introduced replicating the existing `NewEpochState` constructor. Unfortunately, there are two knock-on effects related to weaknesses in pattern synonyms: - A couple of patterns matching on `NewEpochState` now seem to be failable. Since they cannot fail, we instead make them irrefutable. - Record fields associated with pattern synonyms do not play nicely with `NamedFieldPuns`. As such, we replace a couple of puns with explicit bindings. A single additional function `shelleyToAllegraAVVMsToDelete` is exported for the use of the consensus layer. Otherwise no API changes are made. This does entail a change in the ledger state serialisation format.
- Loading branch information
Showing
6 changed files
with
107 additions
and
44 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