mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 05:47:58 +00:00
client/authority-discovery: Publish and query on exponential interval (#7545)
* client/authority-discovery: Publish and query on exponential interval When a node starts up publishing and querying might fail due to various reasons, for example due to being not yet fully bootstrapped on the DHT. Thus one should retry rather sooner than later. On the other hand, a long running node is likely well connected and thus timely retries are not needed. For this reasoning use an exponentially increasing interval for `publish_interval`, `query_interval` and `priority_group_set_interval` instead of a constant interval. * client/authority-discovery/src/interval.rs: Add license header * .maintain/gitlab: Ensure adder collator tests are run on CI
This commit is contained in:
@@ -693,7 +693,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
|
||||
DiscoveryOut::ValueNotFound(e.into_key(), stats.duration().unwrap_or_else(Default::default))
|
||||
}
|
||||
Err(e) => {
|
||||
warn!(target: "sub-libp2p",
|
||||
debug!(target: "sub-libp2p",
|
||||
"Libp2p => Failed to get record: {:?}", e);
|
||||
DiscoveryOut::ValueNotFound(e.into_key(), stats.duration().unwrap_or_else(Default::default))
|
||||
}
|
||||
@@ -704,7 +704,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
|
||||
let ev = match res {
|
||||
Ok(ok) => DiscoveryOut::ValuePut(ok.key, stats.duration().unwrap_or_else(Default::default)),
|
||||
Err(e) => {
|
||||
warn!(target: "sub-libp2p",
|
||||
debug!(target: "sub-libp2p",
|
||||
"Libp2p => Failed to put record: {:?}", e);
|
||||
DiscoveryOut::ValuePutFailed(e.into_key(), stats.duration().unwrap_or_else(Default::default))
|
||||
}
|
||||
@@ -716,7 +716,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
|
||||
Ok(ok) => debug!(target: "sub-libp2p",
|
||||
"Libp2p => Record republished: {:?}",
|
||||
ok.key),
|
||||
Err(e) => warn!(target: "sub-libp2p",
|
||||
Err(e) => debug!(target: "sub-libp2p",
|
||||
"Libp2p => Republishing of record {:?} failed with: {:?}",
|
||||
e.key(), e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user