Skip to content

feat: refactor the node key as version + path#650

Closed
cool-develope wants to merge 41 commits intomasterfrom
592/refactor-path
Closed

feat: refactor the node key as version + path#650
cool-develope wants to merge 41 commits intomasterfrom
592/refactor-path

Conversation

@cool-develope
Copy link
Contributor

@cool-develope cool-develope commented Dec 20, 2022

ref: #571, #608

Context

As discussed in #608, it suggests the node key format as version + path instead of hash. It introduces a new way to get new nodes and orphans and remove the root and orphans from storage.

What does this PR do?

@cool-develope cool-develope requested a review from a team December 20, 2022 17:46
@cool-develope cool-develope marked this pull request as draft December 20, 2022 17:49
@cool-develope cool-develope marked this pull request as ready for review December 20, 2022 18:52
@tac0turtle
Copy link
Contributor

@cool-develope can you give a short summary of all the changes in the pr in the description

import_test.go Outdated
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})
Copy link
Contributor

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 ?

Copy link
Contributor Author

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


if tree.allRootLoaded {
return tree.versions[version]
firstVersion, err := tree.ndb.getFirstVersion()
Copy link
Contributor

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?

Copy link
Contributor Author

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)

This was referenced Jan 2, 2023
@cool-develope cool-develope changed the base branch from master to 592/remove_orphans January 3, 2023 13:49
@kocubinski kocubinski self-assigned this Jan 10, 2023
Base automatically changed from 592/remove_orphans to master January 23, 2023 17:24
@cool-develope
Copy link
Contributor Author

This PR has two problems, the export/import is not working with the original version.
It violates #660.

@tac0turtle
Copy link
Contributor

in the storage working group we decided to move forward with local nonce + version, closing this pr

@tac0turtle tac0turtle closed this Feb 16, 2023
@julienrbrt julienrbrt deleted the 592/refactor-path branch February 3, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants