do not send whole round state via eventHub
Fixes ``` WARNING: DATA RACE Write at 0x00c4200715b8 by goroutine 24: github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrevote.func1() /go/src/github.com/tendermint/tendermint/consensus/state.go:359 +0x3f github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrevote() /go/src/github.com/tendermint/tendermint/consensus/state.go:897 +0x8de github.com/tendermint/tendermint/consensus.(*ConsensusState).addProposalBlockPart() /go/src/github.com/tendermint/tendermint/consensus/state.go:1303 +0x701 github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg() /go/src/github.com/tendermint/tendermint/consensus/state.go:560 +0x88c github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine() /go/src/github.com/tendermint/tendermint/consensus/state.go:525 +0x6d2 Previous read at 0x00c4200715b8 by goroutine 19: github.com/tendermint/tendermint/consensus.makeRoundStepMessages() /go/src/github.com/tendermint/tendermint/consensus/reactor.go:415 +0x192 github.com/tendermint/tendermint/consensus.(*ConsensusReactor).broadcastNewRoundStep() /go/src/github.com/tendermint/tendermint/consensus/reactor.go:377 +0x3c github.com/tendermint/tendermint/consensus.(*ConsensusReactor).broadcastNewRoundStepsAndVotes.func1() /go/src/github.com/tendermint/tendermint/consensus/reactor.go:350 +0x275 ```
This commit is contained in:
parent
1c1c68df8d
commit
6d18e2f447
|
@ -77,10 +77,20 @@ type RoundState struct {
|
|||
// RoundStateEvent returns the H/R/S of the RoundState as an event.
|
||||
func (rs *RoundState) RoundStateEvent() types.EventDataRoundState {
|
||||
edrs := types.EventDataRoundState{
|
||||
Height: rs.Height,
|
||||
Round: rs.Round,
|
||||
Step: rs.Step.String(),
|
||||
RoundState: rs,
|
||||
Height: rs.Height,
|
||||
Round: rs.Round,
|
||||
Step: rs.Step.String(),
|
||||
// send only fields needed by makeRoundStepMessages
|
||||
RoundState: &RoundState{
|
||||
Height: rs.Height,
|
||||
Round: rs.Round,
|
||||
Step: rs.Step,
|
||||
StartTime: rs.StartTime,
|
||||
LastCommit: rs.LastCommit,
|
||||
LockedBlock: rs.LockedBlock, // consensus/state_test.go#L398
|
||||
ProposalBlock: rs.ProposalBlock, // consensus/state_test.go#L253
|
||||
ProposalBlockParts: rs.ProposalBlockParts,
|
||||
},
|
||||
}
|
||||
return edrs
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue