-
Notifications
You must be signed in to change notification settings - Fork 82
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: nodes keep out of sync when missing gossiped block (issue #284) #540
Merged
omritoptix
merged 15 commits into
dymensionxyz:main
from
srene:284-not_recovering_out_of_sync
Dec 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
28e0b95
replace for go-libp2p-pubsub repo pointing to dymension repo instead …
srene 5c0d60d
updating versions of required go-libp2p-pubsub dependencies
srene 712e50f
removing reference to libp2p old libraries (go-libp2p-core)
srene f741746
removing references to deprecated peer id Pretty function
srene 08f36ec
caching blocks to apply them later when received out-of-order
srene 9b42765
increasing gossipsub cache size
srene cab1d26
downgrading libp2p to be compatible with go 1.19
srene 88666b1
checking error after applying block
srene 1895c79
wrong checks after syncing from da
srene 849431e
setting gossipsub cache size from config parameters
srene 735a31e
refactoring caching blocks with new function checkPrevCachedBlocks
srene 5773d82
removing commented code
srene a951998
adding missing error check
srene b0029b5
applying cached blocks in all cases + minor edits
srene 4b4a6e0
caching blocks only when higher than store height
srene File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,19 +50,22 @@ func (m *Manager) syncUntilTarget(ctx context.Context, syncTarget uint64) error | |
return err | ||
} | ||
|
||
if settlementBatch.StartHeight != currentHeight+1 { | ||
//code commented out because it may be the case the start height from the da batch is not exactly the next block from the last received | ||
/*if settlementBatch.StartHeight != currentHeight+1 { | ||
return fmt.Errorf("settlement batch start height (%d) on index (%d) is not the expected", settlementBatch.StartHeight, currStateIdx) | ||
} | ||
}*/ | ||
|
||
err = m.processNextDABatch(ctx, settlementBatch.MetaData.DA.Height) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
currentHeight = m.store.Height() | ||
if currentHeight != settlementBatch.EndHeight { | ||
|
||
//code commented out because it may be the case the current height is higher than da height after applying pending blocks, in case of missing blocks | ||
/*if currentHeight != settlementBatch.EndHeight { | ||
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. you can simply delete the entire lines. no need for leaving it with comments. 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. done |
||
return fmt.Errorf("after applying state index (%d), the height (%d) is not as expected (%d)", currStateIdx, currentHeight, settlementBatch.EndHeight) | ||
} | ||
}*/ | ||
|
||
err = m.updateStateIndex(settlementBatch.StateIndex) | ||
if err != nil { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
you can simply delete the entire lines. no need for leaving it with comments.
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