-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(consensus)!: implements state merkle root (#924)
Description --- Implements Merkle root committing to substate state within a shard Motivation and Context --- This PR adds a correct Merkle root within block proposals and implements validation against the state to be committed in the proposed block. The state Merkle has is also validated when syncing. The tree is an implementation of [Jellyfish Merkle tree](https://diem-developers-components.netlify.app/papers/jellyfish-merkle-tree/2021-01-14.pdf) adapted from Scrypto. The tree is not currently pruned although each node is marked to be removed. A state tree diff is produced for each uncommitted block and applied and removed once the block is committed (3-chain). How Has This Been Tested? --- New unit tests, existing cucumbers, existing consensus tests, manually (swap bench, stress test, sync fresh node, sync after offline) When running the swap bench, clearing and re-syncing a node, there was an MR mismatch for one very large transaction (creating hundreds of accounts in 1 tx). I have not been able to track down the cause, but I believe that this is a pre-existing determinism issue with sync/substate store. Other than that, this appears to be working as expected. What process can a PR reviewer use to test or verify this change? --- Nodes should function as before Breaking Changes --- - [ ] None - [x] Requires data directory to be deleted - [ ] Other - Please specify
- Loading branch information
Showing
66 changed files
with
4,086 additions
and
726 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.