-
Notifications
You must be signed in to change notification settings - Fork 37
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 condition check for tx key dissemination #149
Changes from 1 commit
50cd631
20131a0
d21c037
593e688
872b608
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1049,7 +1049,7 @@ func (cs *State) handleMsg(ctx context.Context, mi msgInfo, fsyncUponCompletion | |
// once proposal is set, we can receive block parts | ||
err = cs.setProposal(msg.Proposal, mi.ReceiveTime) | ||
// See if we can try creating the proposal block if keys exist | ||
if err != nil && cs.config.GossipTransactionKeyOnly && cs.privValidatorPubKey != nil { | ||
if err == nil && cs.config.GossipTransactionKeyOnly && cs.privValidatorPubKey != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. error == nil means there is a valid proposal already So this change means we will try build the blocks and complete for the proposal only if the we have a valid proposal, which make sense to me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exactly - error == nil means we have a valid proposal, so we should try to build the block from mempool. otherwise we fall back to old behavior where we wait for blockparts to be gossiped |
||
isProposer := cs.isProposer(cs.privValidatorPubKey.Address()) | ||
if !isProposer && cs.roundState.ProposalBlock() == nil { | ||
created := cs.tryCreateProposalBlock(spanCtx, msg.Proposal.Height, msg.Proposal.Round, msg.Proposal.Header, msg.Proposal.LastCommit, msg.Proposal.Evidence, msg.Proposal.ProposerAddress) | ||
|
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.
Oh, interesting...
Could we add a unit test for this to assert if Tx key Dissemination was used? Could even just refactor out this snippet to be a helper if that makes it easier
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.
Yeah +1 to maybe find a way to test if gossip is on or not under given condition