Conversation
Codecov Report
@@ Coverage Diff @@
## abci++ #6480 +/- ##
=========================================
Coverage ? 60.81%
=========================================
Files ? 288
Lines ? 27144
Branches ? 0
=========================================
Hits ? 16508
Misses ? 8934
Partials ? 1702 |
| } | ||
|
|
||
| // NOTE: call is synchronous, use ctx to break early if needed | ||
| func (cli *grpcClient) processProposalAsync(ctx context.Context, params types.RequestProcessProposal) (*ReqRes, error) { |
There was a problem hiding this comment.
Why do we need this? Can't we just move it into ProcessProposalSync?
There was a problem hiding this comment.
Yeah we can remove this. I originally added it since I thought it was part of the required ABCI method scaffolding, but I don't think it is
| @@ -117,6 +118,12 @@ message RequestApplySnapshotChunk { | |||
| string sender = 3; | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
formatting seems off in this file?
| // TODO: Need to implement deserialization of evidence bytes | ||
| // for _, ev := range resp.Evidence { | ||
| // blockExec.evpool.AddEvidence() | ||
| // } |
There was a problem hiding this comment.
The godoc states we process evidence by adding it to the evidence pool. Do we actually do that?
There was a problem hiding this comment.
The evidence pool interface only takes in things of type types.Evidence
Lines 42 to 47 in e334555
There was a problem hiding this comment.
Don't we want abci.ResponseProcessProposal to return []types.Evidence instead of [][]byte
There was a problem hiding this comment.
More broadly, how is Tendermint expected to process application evidence? When it receives it from the application here does it just trust that it is valid. When it receives application evidence from another node does it run something like CheckEvidence() to make the application validate it.
| return | ||
| } | ||
|
|
||
| if mustVoteNil { |
There was a problem hiding this comment.
can you explain when this happens and why?
There was a problem hiding this comment.
At the moment, all the validation for determining whether or not we should vote nil happens in the doprevote method. However we want to process the proposal/header earlier on, and not duplicate that. So I added this as a parameter called mustVoteNil. (If process proposal says the block is invalid, vote nil)
There was a problem hiding this comment.
Just realized, an alternate approach would be to add a check for if cs.ValidBlock == nil, and then make this gate the block being deemed valid.
There was a problem hiding this comment.
☝️ This would also make sense to me
There was a problem hiding this comment.
ah no wait ValidBlock depends on 2/3+ prevotes which wouldn't work.
I would instead add the check:
stateMachineValidBlock, err := cs.blockExec.ProcessProposal(cs.ProposalBlock)
if err != nil {
cs.Logger.Error("state machine returned an error when trying to process proposal block", "err", err)
}
here as opposed to in addProposalBlockPart(). I also think we should be validating the block before getting the application to process it
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
|
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. |
|
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. |
|
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. |
| @@ -1939,7 +1953,8 @@ func (cs *State) addProposalBlockPart(msg *BlockPartMessage, peerID p2p.NodeID) | |||
|
|
|||
There was a problem hiding this comment.
Should we rename cs.ValidBlock to cs.TwoThirdPrevoteBlock, to indicate that its just about whether there are two/thirds prevotes, and not about Tendermint / App-determined validity of the block.
There was a problem hiding this comment.
I think this is a great idea. The naming should at least communicate if this is a block pre-finalization or after.
|
I've been digging around consensus for a bit and I want to try get some of the nomenclature clarified: There are two places where we set
This indicates that a
tendermint/internal/consensus/state.go Line 1444 in 581dd01 This is when we've received 2f + 1 votes for the ProposalBlock and just before the node precommits. So these two things are subtly different. I do think that calling it Option 1: Introduce
|
|
Another thought I had: Would we ever need to call |
|
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. |
|
Apologies for the delay in response here. I prefer option 2, always ensuring the proposal block is valid |
|
Okay, that sounds good. Let's add the logic then to |
|
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. |
|
I see the |
|
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. |
|
I'm finally with more access to coding time this week, will get this done by Thursday. |
|
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. |
|
Joon's taking this over in a separate PR |
This PR adds an implementation of synchronous ProcessProposal into the ABCI++ branch. The main part to review is the consensus/state.go and state/execution.go, and then the rest should be checking if I implemented the ABCI++ scaffolding correctly. (Please do check this, its not really clear to me!)
I'm currently working on tests for state.go, and adding app-returned evidence to the local evidence pool. Currently there is only one added test for block execution.
ref #6066