feat: add CellsCommitments softfork#4090
Closed
quake wants to merge 9 commits intonervosnetwork:developfrom
Closed
feat: add CellsCommitments softfork#4090quake wants to merge 9 commits intonervosnetwork:developfrom
quake wants to merge 9 commits intonervosnetwork:developfrom
Conversation
842d5dc to
75d10f7
Compare
86d2da5 to
140d12f
Compare
doitian
reviewed
Sep 4, 2023
| .push(hash) | ||
| .map_err(|e| InternalErrorKind::MMR.other(e))?; | ||
| let cell_status = CellStatus::new(mmr_position, block_number); | ||
| txn.insert_cells_root_mmr_status(&out_point, &cell_status)?; |
Member
There was a problem hiding this comment.
Ensure to add test cases that cells created in the block are consumed in other transactions in the same block.
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR was closed because it has been stalled for 10 days with no activity. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What problem does this PR solve?
This PR adds a softfork implementation of CellsCommitments that can be used to prove transaction output (cell) existence and status (live / dead).
What is changed and how it works?
The implementation uses the merkle mountian range (MMR) as internal data structure, the hash of cell status is stored as MMR element. This PR is still in draft, and is created only for early code review. Please noted that no additional unit or integration tests have been added to this PR, as the relevant code logic has already been covered by the original tests, e.g. whether the MMR root was updated correctly when the chain was reorging.
There are 4 more TODOs.
Because the transactions in the block will affect the MMR root, the original way of adding transactions by blank block template without modifying the extension field is no longer suitable for the integration test, there are about 30+ integration tests that need to be modified, and some of them have been modified so far, and need to be handled in a unified way.
lack of 2 RPC to generate and verify MMR proof.
DB migration, there may be a need for an efficient way to update MMR for historical data.
the corresponding RFC is being prepared, and will be submitted together with the RFC when this PR is formally submitted. RFC: Cells Commitments [WIP - DO NOT MERGE] rfcs#424
Check List
Tests
Side effects
Release note