Browse Source

modify Reactor priorities (#5826)

blockchain/vX reactor priority was decreased because during the normal operation
(i.e. when the node is not fast syncing) blockchain priority can't be
the same as consensus reactor priority. Otherwise, it's theoretically possible to
slow down consensus by constantly requesting blocks from the node.

NOTE: ideally blockchain/vX reactor priority would be dynamic. e.g. when
the node is fast syncing, the priority is 10 (max), but when it's done
fast syncing - the priority gets decreased to 5 (only to serve blocks
for other nodes). But it's not possible now, therefore I decided to
focus on the normal operation (priority = 5).

evidence and consensus critical messages are more important than
the mempool ones, hence priorities are bumped by 1 (from 5 to 6).

statesync reactor priority was changed from 1 to 5 to be the same as
blockchain/vX priority.

Refs https://github.com/tendermint/tendermint/issues/5816
pull/5833/head
Anton Kaliaev 4 years ago
committed by GitHub
parent
commit
aef1ac7ba5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions
  1. +1
    -1
      blockchain/v0/reactor.go
  2. +1
    -1
      blockchain/v2/reactor.go
  3. +2
    -2
      consensus/reactor.go
  4. +1
    -1
      evidence/reactor.go
  5. +1
    -1
      statesync/reactor.go
  6. +2
    -2
      test/maverick/consensus/reactor.go

+ 1
- 1
blockchain/v0/reactor.go View File

@ -143,7 +143,7 @@ func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor {
return []*p2p.ChannelDescriptor{ return []*p2p.ChannelDescriptor{
{ {
ID: BlockchainChannel, ID: BlockchainChannel,
Priority: 10,
Priority: 5,
SendQueueCapacity: 1000, SendQueueCapacity: 1000,
RecvBufferCapacity: 50 * 4096, RecvBufferCapacity: 50 * 4096,
RecvMessageCapacity: bc.MaxMsgSize, RecvMessageCapacity: bc.MaxMsgSize,


+ 1
- 1
blockchain/v2/reactor.go View File

@ -570,7 +570,7 @@ func (r *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor {
return []*p2p.ChannelDescriptor{ return []*p2p.ChannelDescriptor{
{ {
ID: BlockchainChannel, ID: BlockchainChannel,
Priority: 10,
Priority: 5,
SendQueueCapacity: 2000, SendQueueCapacity: 2000,
RecvBufferCapacity: 50 * 4096, RecvBufferCapacity: 50 * 4096,
RecvMessageCapacity: bc.MaxMsgSize, RecvMessageCapacity: bc.MaxMsgSize,


+ 2
- 2
consensus/reactor.go View File

@ -142,7 +142,7 @@ func (conR *Reactor) GetChannels() []*p2p.ChannelDescriptor {
return []*p2p.ChannelDescriptor{ return []*p2p.ChannelDescriptor{
{ {
ID: StateChannel, ID: StateChannel,
Priority: 5,
Priority: 6,
SendQueueCapacity: 100, SendQueueCapacity: 100,
RecvMessageCapacity: maxMsgSize, RecvMessageCapacity: maxMsgSize,
}, },
@ -156,7 +156,7 @@ func (conR *Reactor) GetChannels() []*p2p.ChannelDescriptor {
}, },
{ {
ID: VoteChannel, ID: VoteChannel,
Priority: 5,
Priority: 7,
SendQueueCapacity: 100, SendQueueCapacity: 100,
RecvBufferCapacity: 100 * 100, RecvBufferCapacity: 100 * 100,
RecvMessageCapacity: maxMsgSize, RecvMessageCapacity: maxMsgSize,


+ 1
- 1
evidence/reactor.go View File

@ -53,7 +53,7 @@ func (evR *Reactor) GetChannels() []*p2p.ChannelDescriptor {
return []*p2p.ChannelDescriptor{ return []*p2p.ChannelDescriptor{
{ {
ID: EvidenceChannel, ID: EvidenceChannel,
Priority: 5,
Priority: 6,
RecvMessageCapacity: maxMsgSize, RecvMessageCapacity: maxMsgSize,
}, },
} }


+ 1
- 1
statesync/reactor.go View File

@ -34,7 +34,7 @@ var (
MsgType: new(ssproto.Message), MsgType: new(ssproto.Message),
Descriptor: &p2p.ChannelDescriptor{ Descriptor: &p2p.ChannelDescriptor{
ID: byte(SnapshotChannel), ID: byte(SnapshotChannel),
Priority: 3,
Priority: 5,
SendQueueCapacity: 10, SendQueueCapacity: 10,
RecvMessageCapacity: snapshotMsgSize, RecvMessageCapacity: snapshotMsgSize,
}, },


+ 2
- 2
test/maverick/consensus/reactor.go View File

@ -144,7 +144,7 @@ func (conR *Reactor) GetChannels() []*p2p.ChannelDescriptor {
return []*p2p.ChannelDescriptor{ return []*p2p.ChannelDescriptor{
{ {
ID: StateChannel, ID: StateChannel,
Priority: 5,
Priority: 6,
SendQueueCapacity: 100, SendQueueCapacity: 100,
RecvMessageCapacity: maxMsgSize, RecvMessageCapacity: maxMsgSize,
}, },
@ -158,7 +158,7 @@ func (conR *Reactor) GetChannels() []*p2p.ChannelDescriptor {
}, },
{ {
ID: VoteChannel, ID: VoteChannel,
Priority: 5,
Priority: 7,
SendQueueCapacity: 100, SendQueueCapacity: 100,
RecvBufferCapacity: 100 * 100, RecvBufferCapacity: 100 * 100,
RecvMessageCapacity: maxMsgSize, RecvMessageCapacity: maxMsgSize,


Loading…
Cancel
Save