Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add neededTxInsForBlock function for UTxO on-disk #2449

Merged
merged 1 commit into from
Sep 9, 2021

Conversation

JaredCorduan
Copy link
Contributor

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 the LEDGER 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).

Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few suggestions otherwise LGTM

@JaredCorduan
Copy link
Contributor Author

@lehins thanks for the review! I made all of the changes you suggested.

@JaredCorduan JaredCorduan merged commit fe0ce6e into master Sep 9, 2021
@iohk-bors iohk-bors bot deleted the jc/relevant-utxo-function branch September 9, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants