Skip to content
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: consider the referenced nodes in traverseNodes #724

Closed
wants to merge 3 commits into from

Conversation

cool-develope
Copy link
Collaborator

Closes: #718

@cool-develope cool-develope requested a review from a team as a code owner April 3, 2023 18:14
@cool-develope cool-develope marked this pull request as draft April 3, 2023 18:15
@cool-develope cool-develope marked this pull request as ready for review April 3, 2023 18:20
@cool-develope
Copy link
Collaborator Author

@catShaark
I cleaned the code based on your PR, thanks for contributing again

@catShaark
Copy link
Contributor

I agree its definitely better to use prefixIterate.

@cool-develope cool-develope marked this pull request as draft April 3, 2023 19:32
@tac0turtle
Copy link
Member

which pr do we keep open? this or catsharks?

@cool-develope
Copy link
Collaborator Author

cool-develope commented Apr 13, 2023

this PR introduces some extra cleaning-ups, let's move with @catShaark first

@@ -511,6 +511,15 @@ func (ndb *nodeDB) HasVersion(version int64) (bool, error) {
return ndb.db.Has(nodeKeyFormat.Key(version, []byte{1}))
}

func isReferenceToRoot(bz []byte) bool {
if bz[0] == nodeKeyFormat.Prefix()[0] {
if len(bz) == 13 {
Copy link
Collaborator

@yihuang yihuang Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the condition for a referenced node is hacky, I think we should add a prefix to normal node values as well, so we can distinguish with prefix alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants