-
Notifications
You must be signed in to change notification settings - Fork 197
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
Revert tx that migrates data bugfix #5611
Changes from 1 commit
f313365
6e6cc98
5ee9821
c6bb936
73bd258
a3cfd08
54431ce
8cad9ce
eea3a5c
6161c06
89e77e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -639,6 +639,8 @@ func (bn *branchNode) setNewChild(childPos byte, newNode node) error { | |
bn.setVersionForChild(0, childPos) | ||
bn.EncodedChildren[childPos] = nil | ||
|
||
bn.revertChildrenVersionSlice() | ||
|
||
return nil | ||
} | ||
|
||
|
@@ -647,10 +649,23 @@ func (bn *branchNode) setNewChild(childPos byte, newNode node) error { | |
return err | ||
} | ||
bn.setVersionForChild(childVersion, childPos) | ||
if childVersion == core.NotSpecified { | ||
bn.revertChildrenVersionSlice() | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (bn *branchNode) revertChildrenVersionSlice() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ca you add unit tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. |
||
for i := range bn.ChildrenVersion { | ||
if bn.ChildrenVersion[i] == 1 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hardcoded version? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
return | ||
} | ||
} | ||
|
||
bn.ChildrenVersion = []byte(nil) | ||
} | ||
|
||
func (bn *branchNode) reduceNode(pos int) (node, bool, error) { | ||
newEn, err := newExtensionNode([]byte{byte(pos)}, bn, bn.marsh, bn.hasher) | ||
if err != 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.
we only have len(newKey) == 0 here in case of deletes right?
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.
Yes.