-
Notifications
You must be signed in to change notification settings - Fork 1
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
[consensus] Add check block in consensus #46
Conversation
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.
ABCIx will compare the hash of the returned Tags with LastResultHash in header (LastResultHash will be renamed to ResultHash in TendermintX). If the comparison fails, TendermintX will treat the block as invalid.
invalid check block response includes following scenarios
|
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.
unit tests please
we also need to figure out the timeout mechanism for prevote - since |
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
==========================================
+ Coverage 60.82% 61.32% +0.50%
==========================================
Files 269 271 +2
Lines 28290 28508 +218
==========================================
+ Hits 17206 17483 +277
+ Misses 9576 9516 -60
- Partials 1508 1509 +1
|
state/validation.go
Outdated
@@ -62,12 +62,6 @@ func validateBlock(evidencePool EvidencePool, stateDB dbm.DB, state State, block | |||
block.ConsensusHash, | |||
) | |||
} | |||
if !bytes.Equal(block.LastResultsHash, state.LastResultsHash) { |
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.
thinking about this change, I suggest we do another dedicate PR to remove those checks and make this PR only about CheckBlock
abcix/example/kvstore/kvstore.go
Outdated
}, | ||
}, | ||
} | ||
events := []types.Event{} | ||
return types.ResponseCreateBlock{Txs: txs, InvalidTxs: invalidTxs, Hash: appHash, Events: events} |
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.
just assign events
to nil
?
abcix/example/kvstore/kvstore.go
Outdated
txResp := types.ResponseDeliverTx{GasUsed: gasUsed} | ||
ret.DeliverTxs = append(ret.DeliverTxs, &txResp) | ||
} | ||
ret.AppHash = lastState.AppHash |
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.
should add a nil check. if no txs, lastState
will be nil pointer
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
CheckBlock is called after a proposed block is received and before prevote.
part 2/3 for #26