-
Notifications
You must be signed in to change notification settings - Fork 53
Conversation
Codecov Report
@@ Coverage Diff @@
## master #54 +/- ##
==========================================
- Coverage 86.05% 84.61% -1.44%
==========================================
Files 6 6
Lines 466 494 +28
==========================================
+ Hits 401 418 +17
- Misses 37 43 +6
- Partials 28 33 +5
Continue to review full report at Codecov.
|
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 to me why this is actually needed. Where in cosmos/cosmos-sdk#9680 specifically is it required to get the leaf node?
|
||
if bytes.Equal(currentHash, smt.th.placeholder()) { | ||
// We've hit a placeholder value; this is the end. | ||
return nil, nil |
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.
Ditto
The linked PR is just to change the SMT stored value from the We also want to use |
I 100% guarantee you it's cheaper to perform single hashes than to execute this function (which will perform Lines 103 to 148 in 56045a8
|
Good point. Even a single disk read might be slower, so optimizing it may also be pointless. I'll confer with Ian and cosmos and see what the actual access pattern will look like.
|
Can you point me to how you use IPLD? I assume you also store the inner nodes in IPFS, too? |
This will allow access to the contents of a leaf node, including the node path and hashed value.
This will support an update to Cosmos SDK ADR-040 by allowing access to the hashed value and path without any redundant hashing.
Note: should we optimize this to allow fetching the leaf node directly rather than descending the tree, as has been done for value lookup?