This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 857
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing problems in MPT found by light client (#1610)
### Description Witness generator fixes: - When branch is hashed, its children are stored as hashes. This causes problems when computing the neighbour node which is needed for the case when a node is deleted from a branch with two nodes (the branch dissappears, the remaining node moves one level up). - Placeholder storage leaf RLP - when the leaf value is set to zero, the RLP of the placeholder leaf RLP needs to be updated to reflect the shortened value. - `CreateObject` called when there is no storage trie for an account. - Setting code hash fixed. Circuit fix: When value is set to 0 (which deletes the key) and there are two nodes in the branch, then the node is deleted and the other node moves up one level (replaces the branch). The returned node is then this moved node which doesn't have the value 0 and the lookup into MPT tables fails. Now the circuit is fixed to ensure the new value in the table is 0. Besides that, some other problems are fixed which were found by @adria0 when integrating the light client and MPT (these were temporary hacks in MPT for testing purposes that were forgotten to be removed): - `SetState` calls removed in `prepare_witness.go` calls from - `oracle.PrefetchStorage` call uncommented in `prepare_witness.go` - `oracle.PrefetchStorage` call uncommented in `state/state_object.go updateTrie` - Account nodes were not appended to all nodes in `prepare_witness.go`. ### Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### How Has This Been Tested? No test until now covered this scenario, now `TestNeighbourNodeInHashedBranch` has been added.
- Loading branch information
1 parent
ba4da23
commit 2176191
Showing
102 changed files
with
514 additions
and
260 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
Oops, something went wrong.