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: nodes keep out of sync when missing gossiped block (issue #284) #540

Merged
merged 15 commits into from
Dec 28, 2023
Merged
Changes from 1 commit
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
11 changes: 7 additions & 4 deletions block/retriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

/*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 {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 {
Expand Down
Loading