diff --git a/blockchain/v0/reactor.go b/blockchain/v0/reactor.go index 50f2e164e..dd3878669 100644 --- a/blockchain/v0/reactor.go +++ b/blockchain/v0/reactor.go @@ -204,6 +204,8 @@ func (bcR *BlockchainReactor) respondToPeer(msg *bcproto.BlockRequest, } // Receive implements Reactor by handling 4 types of messages (look below). +// XXX: do not call any methods that can block or incur heavy processing. +// https://github.com/tendermint/tendermint/issues/2888 func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { msg, err := bc.DecodeMsg(msgBytes) if err != nil { diff --git a/blockchain/v1/reactor.go b/blockchain/v1/reactor.go index c16139153..78ce71e18 100644 --- a/blockchain/v1/reactor.go +++ b/blockchain/v1/reactor.go @@ -250,6 +250,8 @@ func (bcR *BlockchainReactor) RemovePeer(peer p2p.Peer, reason interface{}) { } // Receive implements Reactor by handling 4 types of messages (look below). +// XXX: do not call any methods that can block or incur heavy processing. +// https://github.com/tendermint/tendermint/issues/2888 func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { msg, err := bc.DecodeMsg(msgBytes) if err != nil { diff --git a/blockchain/v2/reactor.go b/blockchain/v2/reactor.go index 0c43db179..5da117c94 100644 --- a/blockchain/v2/reactor.go +++ b/blockchain/v2/reactor.go @@ -455,6 +455,8 @@ func (r *BlockchainReactor) Stop() error { } // Receive implements Reactor by handling different message types. +// XXX: do not call any methods that can block or incur heavy processing. +// https://github.com/tendermint/tendermint/issues/2888 func (r *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { msg, err := bc.DecodeMsg(msgBytes) if err != nil { diff --git a/consensus/reactor.go b/consensus/reactor.go index c4a2ef9fd..9fb41c37c 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -220,6 +220,8 @@ func (conR *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) { // Peer state updates can happen in parallel, but processing of // proposals, block parts, and votes are ordered by the receiveRoutine // NOTE: blocks on consensus state for proposals, block parts, and votes +// XXX: do not call any methods that can block or incur heavy processing. +// https://github.com/tendermint/tendermint/issues/2888 func (conR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { if !conR.IsRunning() { conR.Logger.Debug("Receive", "src", src, "chId", chID, "bytes", msgBytes) diff --git a/evidence/reactor.go b/evidence/reactor.go index 421e4bc18..951d64d71 100644 --- a/evidence/reactor.go +++ b/evidence/reactor.go @@ -66,6 +66,8 @@ func (evR *Reactor) AddPeer(peer p2p.Peer) { // Receive implements Reactor. // It adds any received evidence to the evpool. +// XXX: do not call any methods that can block or incur heavy processing. +// https://github.com/tendermint/tendermint/issues/2888 func (evR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { evis, err := decodeMsg(msgBytes) if err != nil { diff --git a/mempool/reactor.go b/mempool/reactor.go index b4f76b9e8..6bf0ce7d7 100644 --- a/mempool/reactor.go +++ b/mempool/reactor.go @@ -160,6 +160,8 @@ func (memR *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) { // Receive implements Reactor. // It adds any received transactions to the mempool. +// XXX: do not call any methods that can block or incur heavy processing. +// https://github.com/tendermint/tendermint/issues/2888 func (memR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { msg, err := memR.decodeMsg(msgBytes) if err != nil { diff --git a/p2p/base_reactor.go b/p2p/base_reactor.go index 86b0d980a..59faf4c3f 100644 --- a/p2p/base_reactor.go +++ b/p2p/base_reactor.go @@ -44,6 +44,9 @@ type Reactor interface { // copying. // // CONTRACT: msgBytes are not nil. + // + // XXX: do not call any methods that can block or incur heavy processing. + // https://github.com/tendermint/tendermint/issues/2888 Receive(chID byte, peer Peer, msgBytes []byte) } diff --git a/p2p/pex/pex_reactor.go b/p2p/pex/pex_reactor.go index 71b71b054..fc701bfdd 100644 --- a/p2p/pex/pex_reactor.go +++ b/p2p/pex/pex_reactor.go @@ -236,6 +236,8 @@ func (r *Reactor) logErrAddrBook(err error) { } // Receive implements Reactor by handling incoming PEX messages. +// XXX: do not call any methods that can block or incur heavy processing. +// https://github.com/tendermint/tendermint/issues/2888 func (r *Reactor) Receive(chID byte, src Peer, msgBytes []byte) { msg, err := decodeMsg(msgBytes) if err != nil { diff --git a/statesync/reactor.go b/statesync/reactor.go index 4f4310f84..0abd91cf1 100644 --- a/statesync/reactor.go +++ b/statesync/reactor.go @@ -90,6 +90,8 @@ func (r *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) { } // Receive implements p2p.Reactor. +// XXX: do not call any methods that can block or incur heavy processing. +// https://github.com/tendermint/tendermint/issues/2888 func (r *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { if !r.IsRunning() { return