mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 16:51:02 +00:00
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>
This commit is contained in:
@@ -555,7 +555,6 @@ where
|
||||
let block_number = vote.commitment.block_number;
|
||||
match rounds.add_vote(vote) {
|
||||
VoteImportResult::RoundConcluded(signed_commitment) => {
|
||||
self.gossip_validator.conclude_round(block_number);
|
||||
metric_set!(self, beefy_round_concluded, block_number);
|
||||
|
||||
let finality_proof = VersionedFinalityProof::V1(signed_commitment);
|
||||
@@ -602,6 +601,7 @@ where
|
||||
|
||||
// Finalize inner round and update voting_oracle state.
|
||||
self.persisted_state.voting_oracle.finalize(block_num)?;
|
||||
self.gossip_validator.conclude_round(block_num);
|
||||
|
||||
if block_num > self.best_beefy_block() {
|
||||
// Set new best BEEFY block number.
|
||||
|
||||
Reference in New Issue
Block a user