-
Notifications
You must be signed in to change notification settings - Fork 66
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
tree: allow batching new leaf nodes #363
base: master
Are you sure you want to change the base?
Conversation
7597228
to
9dbd43e
Compare
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.
@jsign ok so it was weird, but it wasn't really github action's fault: CI will merge your PR branch with main during the test, making sure that the merge can work. It's something that needs to happen.
The problem is that if you rebase your branch on top of master
, there are a few problems appearing. This is why it worked locally for both of us: we were not rebasing. I have fixed the first problem, but there is now one with a nil
commitment.
tree_test.go
Outdated
valIdx := 42 | ||
values[valIdx] = testValue | ||
ln := NewLeafNode(ffx32KeyTest[:StemSize], values) |
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.
We can't create "direct leaf node" now since all the internal data is lazily computed. This caused a crash later when doing ln.Hash()
called (*LeafNode).Commitment()
, which panicked since there wasn't any calculated commitment.
The solution is always to use the tree from a properly created tree, since before inspecting internals of things you should always call tree.Commit()
to do all the pending calculations.
Another solution is making (*LeafNode).Commitment()
not panicked if commitment == nil
, so compute it if that's the case. Technically speaking, that would be my preferred solution since we shouldn't have panicked but considering that case should never happen...
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.
thanks for fixing this, I rebased it and will merge it after we discuss your comment.
22e2491
to
1e7745d
Compare
Note to self when I revisit this: This PR is kept on hold for a little bit, as it needs to be rebased and it fill conflict with more upcoming PRs. It should not decrease performance, so it's safe to merge. |
Signed-off-by: Ignacio Hagopian <[email protected]> tree: simplify batching of new leaves creation Signed-off-by: Ignacio Hagopian <[email protected]> tree: fix insert new leaves test and benchmark Signed-off-by: Ignacio Hagopian <[email protected]> remove comment Signed-off-by: Ignacio Hagopian <[email protected]> remove conversion file Signed-off-by: Ignacio Hagopian <[email protected]> remove unused method Signed-off-by: Ignacio Hagopian <[email protected]> tree: add comment to explain different strategies on leaf node value updating Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
Update: rebased to |
Try again to run #349 with a different branch name...