Skip to content

Commit

Permalink
Skip known authorities
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsa committed Nov 15, 2024
1 parent b583472 commit bcccc94
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/authority_discovery/query/query_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,18 @@ namespace kagome::authority_discovery {
auto authority = queue_.back();
queue_.pop_back();

static size_t skipped = 0;
if (auth_to_peer_cache_.contains(authority)) {
++skipped;
if (skipped % 10 == 0) {
SL_DEBUG(log_, "skipped {} records", skipped);
} else {
--active_;
continue;
}
}
skipped = 0;

scheduler_->schedule([wp{weak_from_this()},
hash = common::Buffer{crypto::sha256(authority)},
authority] {
Expand Down

0 comments on commit bcccc94

Please sign in to comment.