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
Conversation
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.
👍
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## rc/v1.6.0 #5611 +/- ##
=============================================
- Coverage 80.16% 80.12% -0.04%
=============================================
Files 708 708
Lines 93860 93875 +15
=============================================
- Hits 75241 75221 -20
- Misses 13282 13316 +34
- Partials 5337 5338 +1
☔ View full report in Codecov by Sentry. |
trie/branchNode.go
Outdated
|
||
return nil | ||
} | ||
|
||
func (bn *branchNode) revertChildrenVersionSlice() { | ||
for i := range bn.ChildrenVersion { | ||
if bn.ChildrenVersion[i] == 1 { |
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.
hardcoded version?
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.
Fixed.
trie/branchNode.go
Outdated
|
||
return nil | ||
} | ||
|
||
func (bn *branchNode) revertChildrenVersionSlice() { |
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.
ca you add unit tests?
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.
Added.
if err != nil { | ||
return nil, err | ||
} | ||
|
||
index++ | ||
|
||
isFirstMigration := oldVal.Version == core.NotSpecified && dataEntry.newVersion == core.AutoBalanceEnabled | ||
if isFirstMigration && len(newKey) != 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.
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.
54431ce
trie/branchNode_test.go
Outdated
@@ -1436,7 +1436,7 @@ func TestBranchNode_VerifyChildrenVersionIsSetCorrectlyAfterInsertAndDelete(t *t | |||
} | |||
newBn, _, err := bn.insert(data, &testscommon.MemDbMock{}) | |||
assert.Nil(t, err) | |||
assert.Equal(t, 0, len(newBn.(*branchNode).ChildrenVersion)) | |||
assert.Equal(t, []byte(nil), newBn.(*branchNode).ChildrenVersion) |
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.
assert.Nil here and on L1452 & L1492
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.
Done.
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.
Normal allin test: v1.5.13-dev-config-8c685c8e00 -> reverted-migration-tx-fix-a3cfd08194
--- Specific errors ---
block hash does not match 7771
wrong nonce in block 2861
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0
/------/
--- Statistics ---
Nr. of all ERRORS: 1
Nr. of all WARNS: 216
Nr. of new ERRORS: 1
Nr. of new WARNS: 3
Nr. of PANICS: 0
/------/
Reasoning behind the pull request
ChildrenVersion
slice instead of a nil byte slice. This will result in a different root hash.Proposed changes
oldHashes
andnewHashes
, thus the removal will be canceled.Testing procedure
autoBalanceDataTriesFlag
is enabled, send some txs (which will change the existing data trie leaves) that will fail.Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?