mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 02:01:02 +00:00
improved gossip topology (#3270)
* gossip-support: gossip topology * some fixes * handle view update for newly added gossip peers * fix neighbors calculation * fix test * resolve TODOs * typo * guide updates * spaces in the guide * sneaky spaces * hash randomness * address some review nits * use unbounded in bridge for subsystem msg
This commit is contained in:
@@ -15,9 +15,10 @@
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::time::Duration;
|
||||
use std::sync::Arc;
|
||||
use std::iter::FromIterator as _;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use super::*;
|
||||
use std::sync::Arc;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
use sp_application_crypto::{AppKey, sr25519::Pair, Pair as TraitPair};
|
||||
use polkadot_node_primitives::Statement;
|
||||
@@ -441,8 +442,10 @@ fn peer_view_update_sends_messages() {
|
||||
let peer = PeerId::random();
|
||||
|
||||
executor::block_on(async move {
|
||||
update_peer_view_and_send_unlocked(
|
||||
let gossip_peers = HashSet::from_iter(vec![peer.clone()].into_iter());
|
||||
update_peer_view_and_maybe_send_unlocked(
|
||||
peer.clone(),
|
||||
&gossip_peers,
|
||||
&mut peer_data,
|
||||
&mut ctx,
|
||||
&active_heads,
|
||||
@@ -562,7 +565,11 @@ fn circulated_statement_goes_to_all_peers_with_view() {
|
||||
statement: &statement,
|
||||
};
|
||||
|
||||
let gossip_peers = HashSet::from_iter(vec![
|
||||
peer_a.clone(), peer_b.clone(), peer_c.clone(),
|
||||
].into_iter());
|
||||
let needs_dependents = circulate_statement(
|
||||
&gossip_peers,
|
||||
&mut peer_data,
|
||||
&mut ctx,
|
||||
hash_b,
|
||||
|
||||
Reference in New Issue
Block a user