Only let active Serai validators connect over P2P

This commit is contained in:
Luke Parker
2025-01-04 22:21:23 -05:00
parent a64e2004ab
commit 3daeea09e6
6 changed files with 157 additions and 50 deletions

View File

@@ -59,12 +59,11 @@ pub(crate) fn new_behavior() -> Behavior {
})
.build();
// TODO: Don't use IdentityTransform here. Authenticate using validator keys
let mut gossipsub = Behavior::new(MessageAuthenticity::Anonymous, config.unwrap()).unwrap();
let mut gossip = Behavior::new(MessageAuthenticity::Anonymous, config.unwrap()).unwrap();
// Subscribe to the base topic
let topic = IdentTopic::new(BASE_TOPIC);
let _ = gossipsub.subscribe(&topic);
let _ = gossip.subscribe(&topic);
gossipsub
gossip
}