-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix trie serialize #1388
Fix trie serialize #1388
Conversation
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1388 +/- ##
==========================================
- Coverage 24.87% 24.84% -0.03%
==========================================
Files 629 629
Lines 23808 23794 -14
Branches 12328 12314 -14
==========================================
- Hits 5922 5912 -10
- Misses 12598 12609 +11
+ Partials 5288 5273 -15
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@@ -118,7 +88,13 @@ namespace kagome::storage::trie { | |||
if (db_key.empty() or db_key == getEmptyRootHash()) { | |||
return nullptr; | |||
} | |||
OUTCOME_TRY(enc, backend_->load(db_key)); | |||
Buffer enc; | |||
if (codec_->isMerkleHash(db_key)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it's better to comment that a db key is actually the merkle value of the node, or better wrap Buffer in some MerkleValue type to ensure this contract on type level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear from this comment why it is this way. I think it's better clarify it, or it may become a source of confusion.
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Referenced issues
Description of the Change
merkleValue
which are not hashed.Benefits
TopperTrieBatchImpl::clearPrefix
Possible Drawbacks