-
Notifications
You must be signed in to change notification settings - Fork 266
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
feat: refactor the node key as version + path
#650
Conversation
@cool-develope can you give a short summary of all the changes in the pr in the description |
import_test.go
Outdated
@@ -160,7 +161,7 @@ func TestImporter_Close(t *testing.T) { | |||
importer, err := tree.Import(1) | |||
require.NoError(t, err) | |||
|
|||
err = importer.Add(&ExportNode{Key: []byte("key"), Value: []byte("value"), Version: 1, Height: 0}) | |||
err = importer.Add(&ExportNode{Key: []byte("key"), Value: []byte("value"), NodeKey: &NodeKey{version: 1, path: big.NewInt(1)}, Height: 0}) |
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.
how does this work for existing exports?or is the migration path planned to be different ?
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.
I believe it would look different, please refer #662
mutable_tree.go
Outdated
|
||
if tree.allRootLoaded { | ||
return tree.versions[version] | ||
firstVersion, err := tree.ndb.getFirstVersion() |
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.
is there not a need to lock here anymore?
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.
yeah, we don't use the map of versions,since we are keeping the range of versions (fristVersion, latestVersion)
946c32d
to
6ecc833
Compare
This PR has two problems, the |
in the storage working group we decided to move forward with local nonce + version, closing this pr |
ref: #571, #608
Context
As discussed in #608, it suggests the node key format as
version + path
instead ofhash
. It introduces a new way to get new nodes and orphans and remove the root and orphans from storage.What does this PR do?
version + path