Ensure successful block submission even when sequencer crashes#442
Merged
Ensure successful block submission even when sequencer crashes#442
Conversation
Codecov Report
@@ Coverage Diff @@
## main #442 +/- ##
==========================================
+ Coverage 55.19% 55.25% +0.06%
==========================================
Files 48 48
Lines 8751 8788 +37
==========================================
+ Hits 4830 4856 +26
- Misses 3177 3184 +7
- Partials 744 748 +4
Continue to review full report at Codecov.
|
58ae3ea to
14fa63d
Compare
tzdybal
reviewed
Jun 22, 2022
Contributor
Author
|
Proposal to punt on fixing Ethermint rpc tests until #450 |
liamsi
approved these changes
Jun 24, 2022
Contributor
liamsi
left a comment
There was a problem hiding this comment.
Looks good. Left one question and an optional suggestion.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Significant changes in this PR
ApplyBlockmethod in state/executor.go splitting it into 2 methods.ApplyBlockwhich now onlyvalidatesandexecutesthe block/stateCommitwhichcommitsthe blockpublishBlockin block/manager.goif/elsestatement that checks if there is apendingBlockin themanager.storeat the next block height. This ensures that if the sequencer crashes duringpublishBlock(generally during a slowsubmitBlockToDAcall) it will use the already generatedpendingBlockas opposed to creating a new block.ApplyBlock/Commitmethods toApplyBlockprior tosubmitBlockToDAbut onlyCommitsthe block after successful DA submission. BecauseApplyBlockdoesn't write to disk a crash is gracefully handled by reapplying the storedpendingBlockwith the changes in(2.i)submitBlockToDAfails after reaching the maximum number of retries. Now returns an error.SaveBlockinstore/store.goso that it doesn't increment the store's height. AddsSetHeighttostore/store.goand calls it immediately aftersubmitBlockToDAwithinpublishBlockinblock/manager.goResolves: #437
Resolves: #447
Resolves: #450
P.S. My commit messages are obviously terrible but this PR will be squashed and we'll use the detailed PR description.