Skip to content
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

EN-6710 antiflood blocks consensus fix #1895

Merged
merged 7 commits into from
Jun 9, 2020
11 changes: 10 additions & 1 deletion consensus/spos/bls/blsWorker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ import (
"github.com/ElrondNetwork/elrond-go/consensus/spos"
)

const peerMaxMessagesPerSec = uint32(2)
// peerMaxMessagesPerSec defines how many messages can be propagated by a pid in a round. The value was chosen by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// following the next premises:
// 1. a leader can propagate as maximum as 3 messages per round: proposed header block + proposed body + final info;
// 2. due to the fact that a delayed signature of the proposer (from previous round) can be received in the current round
// adds an extra 1 to the total value, reaching value 4;
// 3. Because the leader might be selected in the next round and might have an empty data pool, it can send the newly
// empty proposed block at the very beginning of the next round. One extra message here, yielding to a total of 5.
// Validators only send one signature message in a round, treating the edge case of a delayed message, will need at most
// 2 messages per round (which is ok as it is below the set value of 5)
const peerMaxMessagesPerSec = uint32(5)

// worker defines the data needed by spos to communicate between nodes which are in the validators group
type worker struct {
Expand Down