Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #130 +/- ##
==========================================
+ Coverage 95.64% 95.68% +0.04%
==========================================
Files 72 72
Lines 1217 1252 +35
Branches 155 162 +7
==========================================
+ Hits 1164 1198 +34
- Misses 53 54 +1
Continue to review full report at Codecov.
|
tiendq
reviewed
Dec 15, 2020
tiendq
reviewed
Dec 15, 2020
tiendq
reviewed
Dec 15, 2020
f136f49 to
5c80bc5
Compare
Member
|
Let's implement this feature without introduce breaking change in the protected async rollbackTo(blockNumber: number): Promise<void> {
this.log.debug('-- roll back to block number:', blockNumber);
// - [ ] TODO alter current index state
// - [ ] TODO revert all change from blockNumber to current blockNumber
// Aloxide Updater will create a snapshot of data when applying a last irreversible block
// doing so we can quickly roll back to the last irreversible block state
// This is only applied to Aloxide data
}
public async handleBlock(nextBlock: NextBlock, isReplay: boolean): Promise<number | null> {
try {
return super.handleBlock(nextBlock, isReplay);
} catch (e) {
if (e instanceof MismatchedBlockHashError) {
// roll back to the last irreversible blocks
// - [ ] TODO explain why it must be the last irreversible block
// - [ ] what hapen if the rollbackTo took too long to execute
await this.rollbackTo(this.lastIrreversibleBlockNumber);
return this.lastIrreversibleBlockNumber + 1;
}
throw e;
}
} |
b7c2de1 to
76508d8
Compare
Contributor
Author
|
@manh-vv please help me review again!. |
manh-vv
requested changes
Dec 29, 2020
Member
manh-vv
left a comment
There was a problem hiding this comment.
Please have a direct talk if you have any questions about my comments.
76508d8 to
1b0086f
Compare
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.
Require lecle/demux-js#2 to be merged first