Skip to content

Temp fix for flaky Sync Test #1378

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

Merged
merged 4 commits into from
Apr 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion x/sync/syncmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (m *StateSyncManager) findNextKey(
// for now, just fallback to using the start key, which is always correct.
// TODO: determine a more accurate nextKey in this scenario
if !startKeyPath.HasPrefix(localProofNodes[localIndex].KeyPath) || !startKeyPath.HasPrefix(receivedProofNodes[receivedIndex].KeyPath) {
return start, nil
return append(start, 0), nil
}

// walk up the node paths until a difference is found
Expand Down Expand Up @@ -430,6 +430,10 @@ func (m *StateSyncManager) findNextKey(
localIndex--
}

if startKeyPath.NibbleLength <= branchNode.KeyPath.NibbleLength {
return append(start, 0), nil
}

// the two nodes have different paths, so find where they branched
for nextKeyNibble := startKeyPath.NibbleVal(branchNode.KeyPath.NibbleLength) + 1; nextKeyNibble < 16; nextKeyNibble++ {
if _, ok := branchNode.Children[nextKeyNibble]; ok {
Expand Down