Skip to content

Instantly share code, notes, and snippets.

@alexpyattaev
Created October 20, 2025 16:18
Show Gist options
  • Select an option

  • Save alexpyattaev/745d6d6b56e8bc61cf84deebe04cbf92 to your computer and use it in GitHub Desktop.

Select an option

Save alexpyattaev/745d6d6b56e8bc61cf84deebe04cbf92 to your computer and use it in GitHub Desktop.
Fake turbine peers for tests of agave retransmit
--- a/turbine/src/cluster_nodes.rs
+++ b/turbine/src/cluster_nodes.rs
@@ -444,6 +444,24 @@ fn get_nodes(
Node { node, stake }
}),
)
+ // Add a bunch of fake, unstaked nodes for testing.
+ .chain((0..5000).map(|i: u16| {
+ let addr_byte1 = (i / 256).min(255) as u8;
+
+ let addr_byte2 = (i % 256).min(255) as u8;
+
+ let contact_info = ContactInfo {
+ pubkey: Pubkey::new_unique(),
+ wallclock: timestamp(),
+ tvu_quic: None,
+ tvu_udp: Some(SocketAddr::new(
+ std::net::IpAddr::V4(std::net::Ipv4Addr::new(150, 150, addr_byte1, addr_byte2)),
+ 8080,
+ )),
+ };
+ let node = NodeId::from(contact_info);
+ Node { node, stake: 0 }
+ }))
// All staked nodes.
.chain(
stakes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment