client/beefy: request justifs from peers further in consensus (#13343)
For on-demand justifications, peer selection is based on witnessed
gossip votes. This commit changes the condition for selecting a peer
to request justification for `block` from
"last voted on >= `block`" to "peer last voted on strict > `block`".
When allowing `>=` we see nodes continuously spamming unsuccessful
on-demand requests to nodes which are still voting on a block without
having a justification available.
One way to fix the spam would be to add some rate-limiting or backoff
period when requesting justifications.
The other solution (present in this commit) is to simply request
justifications from peers that are voting on future blocks so we know
they're _guaranteed_ to have the wanted mandatory justification
available to send back.
Signed-off-by:
acatangiu <adrian@parity.io>
Showing
- substrate/client/beefy/src/communication/peers.rs 16 additions, 16 deletionssubstrate/client/beefy/src/communication/peers.rs
- substrate/client/beefy/src/communication/request_response/outgoing_requests_engine.rs 1 addition, 2 deletions...ommunication/request_response/outgoing_requests_engine.rs
- substrate/client/beefy/src/tests.rs 6 additions, 6 deletionssubstrate/client/beefy/src/tests.rs
- substrate/client/beefy/src/worker.rs 1 addition, 1 deletionsubstrate/client/beefy/src/worker.rs
Please register or sign in to comment