Add neededTxInsForBlock function for UTxO on-disk #2449
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The validity of any individual block depends only on a subset of the UTxO stored in the ledger state. We introduce a new function
neededTxInsForBlock
that take a block and returns the transaction inputs corresponding to the required UTxO for the given Block.This function will be used by the consensus layer to enable storing the UTxO on disk. In particular, given a block, the consensus layer will use 'neededTxInsForBlock' to retrived the needed UTxO from disk and present only those to the ledger.
A property test is included, which tests that: if you partition the UTxO into those that are needed and those that are irrelevant, then running the
LEDGER
rule on the the full UTxO results in the same mapping as running theLEDGER
rule on the the restricted UTxO and then combining the results with the irrelevant UTxO (we also check that the irrelevant UTxO are disjoint from the updated restricted UTxO).