@@ -18,7 +18,6 @@ pub mod p2p;
1818
1919mod driver;
2020pub use driver:: * ;
21- use p2p:: signaling:: P2pSignaling ;
2221
2322pub use crate :: cluster:: runner:: * ;
2423
@@ -29,13 +28,31 @@ use crate::scenario::{Scenario, ScenarioId, ScenarioStep};
2928
3029use self :: multi_node:: basic_connectivity_initial_joining:: MultiNodeBasicConnectivityInitialJoining ;
3130use self :: multi_node:: basic_connectivity_peer_discovery:: MultiNodeBasicConnectivityPeerDiscovery ;
31+ use self :: multi_node:: connection_discovery:: RustNodeAsSeed as P2pConnectionDiscoveryRustNodeAsSeed ;
32+ use self :: multi_node:: connection_discovery:: {
33+ OCamlToRust , OCamlToRustViaSeed , RustToOCaml , RustToOCamlViaSeed ,
34+ } ;
3235use self :: multi_node:: pubsub_advanced:: MultiNodePubsubPropagateBlock ;
3336use self :: multi_node:: sync_4_block_producers:: MultiNodeSync4BlockProducers ;
3437use self :: multi_node:: vrf_correct_ledgers:: MultiNodeVrfGetCorrectLedgers ;
3538use self :: multi_node:: vrf_correct_slots:: MultiNodeVrfGetCorrectSlots ;
3639use self :: multi_node:: vrf_epoch_bounds_correct_ledgers:: MultiNodeVrfEpochBoundsCorrectLedger ;
3740use self :: multi_node:: vrf_epoch_bounds_evaluation:: MultiNodeVrfEpochBoundsEvaluation ;
41+ use self :: p2p:: basic_connection_handling:: {
42+ AllNodesConnectionsAreSymmetric , MaxNumberOfPeersIncoming , MaxNumberOfPeersIs1 ,
43+ SeedConnectionsAreSymmetric , SimultaneousConnections ,
44+ } ;
45+ use self :: p2p:: basic_incoming_connections:: {
46+ AcceptIncomingConnection , AcceptMultipleIncomingConnections ,
47+ } ;
48+ use self :: p2p:: basic_outgoing_connections:: {
49+ ConnectToInitialPeers , ConnectToInitialPeersBecomeReady , ConnectToUnavailableInitialPeers ,
50+ DontConnectToInitialPeerWithSameId , DontConnectToNodeWithSameId , DontConnectToSelfInitialPeer ,
51+ MakeMultipleOutgoingConnections , MakeOutgoingConnection ,
52+ } ;
53+ use self :: p2p:: kademlia:: KademliaBootstrap ;
3854use self :: p2p:: pubsub:: P2pReceiveBlock ;
55+ use self :: p2p:: signaling:: P2pSignaling ;
3956use self :: record_replay:: block_production:: RecordReplayBlockProduction ;
4057use self :: record_replay:: bootstrap:: RecordReplayBootstrap ;
4158use self :: simulation:: small:: SimulationSmall ;
@@ -68,9 +85,31 @@ pub enum Scenarios {
6885 SimulationSmallForeverRealTime ( SimulationSmallForeverRealTime ) ,
6986 P2pReceiveBlock ( P2pReceiveBlock ) ,
7087 P2pSignaling ( P2pSignaling ) ,
88+ P2pConnectionDiscoveryRustNodeAsSeed ( P2pConnectionDiscoveryRustNodeAsSeed ) ,
7189 MultiNodePubsubPropagateBlock ( MultiNodePubsubPropagateBlock ) ,
7290 RecordReplayBootstrap ( RecordReplayBootstrap ) ,
7391 RecordReplayBlockProduction ( RecordReplayBlockProduction ) ,
92+
93+ RustToOCaml ( RustToOCaml ) ,
94+ OCamlToRust ( OCamlToRust ) ,
95+ OCamlToRustViaSeed ( OCamlToRustViaSeed ) ,
96+ RustToOCamlViaSeed ( RustToOCamlViaSeed ) ,
97+ KademliaBootstrap ( KademliaBootstrap ) ,
98+ AcceptIncomingConnection ( AcceptIncomingConnection ) ,
99+ MakeOutgoingConnection ( MakeOutgoingConnection ) ,
100+ AcceptMultipleIncomingConnections ( AcceptMultipleIncomingConnections ) ,
101+ MakeMultipleOutgoingConnections ( MakeMultipleOutgoingConnections ) ,
102+ DontConnectToNodeWithSameId ( DontConnectToNodeWithSameId ) ,
103+ DontConnectToInitialPeerWithSameId ( DontConnectToInitialPeerWithSameId ) ,
104+ DontConnectToSelfInitialPeer ( DontConnectToSelfInitialPeer ) ,
105+ SimultaneousConnections ( SimultaneousConnections ) ,
106+ ConnectToInitialPeers ( ConnectToInitialPeers ) ,
107+ ConnectToUnavailableInitialPeers ( ConnectToUnavailableInitialPeers ) ,
108+ AllNodesConnectionsAreSymmetric ( AllNodesConnectionsAreSymmetric ) ,
109+ ConnectToInitialPeersBecomeReady ( ConnectToInitialPeersBecomeReady ) ,
110+ SeedConnectionsAreSymmetric ( SeedConnectionsAreSymmetric ) ,
111+ MaxNumberOfPeersIncoming ( MaxNumberOfPeersIncoming ) ,
112+ MaxNumberOfPeersIs1 ( MaxNumberOfPeersIs1 ) ,
74113}
75114
76115impl Scenarios {
@@ -152,9 +191,43 @@ impl Scenarios {
152191 Self :: SimulationSmallForeverRealTime ( _) => SimulationSmallForeverRealTime :: DOCS ,
153192 Self :: P2pReceiveBlock ( _) => P2pReceiveBlock :: DOCS ,
154193 Self :: P2pSignaling ( _) => P2pSignaling :: DOCS ,
194+ Self :: P2pConnectionDiscoveryRustNodeAsSeed ( _) => {
195+ P2pConnectionDiscoveryRustNodeAsSeed :: DOCS
196+ }
155197 Self :: MultiNodePubsubPropagateBlock ( _) => MultiNodePubsubPropagateBlock :: DOCS ,
156198 Self :: RecordReplayBootstrap ( _) => RecordReplayBootstrap :: DOCS ,
157199 Self :: RecordReplayBlockProduction ( _) => RecordReplayBlockProduction :: DOCS ,
200+
201+ Self :: RustToOCaml ( _) => RustToOCaml :: DOCS ,
202+ Self :: OCamlToRust ( _) => OCamlToRust :: DOCS ,
203+ Self :: OCamlToRustViaSeed ( _) => OCamlToRustViaSeed :: DOCS ,
204+ Self :: RustToOCamlViaSeed ( _) => RustToOCamlViaSeed :: DOCS ,
205+ Self :: KademliaBootstrap ( _) => KademliaBootstrap :: DOCS ,
206+ Self :: AcceptIncomingConnection ( _) => AcceptIncomingConnection :: DOCS ,
207+ Self :: MakeOutgoingConnection ( _) => MakeOutgoingConnection :: DOCS ,
208+ Self :: AcceptMultipleIncomingConnections ( _) => AcceptMultipleIncomingConnections :: DOCS ,
209+ Self :: MakeMultipleOutgoingConnections ( _) => MakeMultipleOutgoingConnections :: DOCS ,
210+ Self :: DontConnectToNodeWithSameId ( _) => DontConnectToNodeWithSameId :: DOCS ,
211+ Self :: DontConnectToInitialPeerWithSameId ( _) => DontConnectToInitialPeerWithSameId :: DOCS ,
212+ Self :: DontConnectToSelfInitialPeer ( _) => DontConnectToSelfInitialPeer :: DOCS ,
213+ Self :: SimultaneousConnections ( _) => SimultaneousConnections :: DOCS ,
214+ Self :: ConnectToInitialPeers ( _) => ConnectToInitialPeers :: DOCS ,
215+ Self :: ConnectToUnavailableInitialPeers ( _) => ConnectToUnavailableInitialPeers :: DOCS ,
216+ Self :: AllNodesConnectionsAreSymmetric ( _) => AllNodesConnectionsAreSymmetric :: DOCS ,
217+ Self :: ConnectToInitialPeersBecomeReady ( _) => ConnectToInitialPeersBecomeReady :: DOCS ,
218+ Self :: SeedConnectionsAreSymmetric ( _) => SeedConnectionsAreSymmetric :: DOCS ,
219+ Self :: MaxNumberOfPeersIncoming ( _) => MaxNumberOfPeersIncoming :: DOCS ,
220+ Self :: MaxNumberOfPeersIs1 ( _) => MaxNumberOfPeersIs1 :: DOCS ,
221+ }
222+ }
223+
224+ pub fn default_cluster_config ( self ) -> Result < ClusterConfig , anyhow:: Error > {
225+ let config = ClusterConfig :: new ( None )
226+ . map_err ( |err| anyhow:: anyhow!( "failed to create cluster configuration: {err}" ) ) ?;
227+
228+ match self {
229+ Self :: P2pSignaling ( v) => v. default_cluster_config ( config) ,
230+ _ => Ok ( config) ,
158231 }
159232 }
160233
@@ -189,9 +262,31 @@ impl Scenarios {
189262 Self :: SimulationSmallForeverRealTime ( v) => v. run ( runner) . await ,
190263 Self :: P2pReceiveBlock ( v) => v. run ( runner) . await ,
191264 Self :: P2pSignaling ( v) => v. run ( runner) . await ,
265+ Self :: P2pConnectionDiscoveryRustNodeAsSeed ( v) => v. run ( runner) . await ,
192266 Self :: MultiNodePubsubPropagateBlock ( v) => v. run ( runner) . await ,
193267 Self :: RecordReplayBootstrap ( v) => v. run ( runner) . await ,
194268 Self :: RecordReplayBlockProduction ( v) => v. run ( runner) . await ,
269+
270+ Self :: RustToOCaml ( v) => v. run ( runner) . await ,
271+ Self :: OCamlToRust ( v) => v. run ( runner) . await ,
272+ Self :: OCamlToRustViaSeed ( v) => v. run ( runner) . await ,
273+ Self :: RustToOCamlViaSeed ( v) => v. run ( runner) . await ,
274+ Self :: KademliaBootstrap ( v) => v. run ( runner) . await ,
275+ Self :: AcceptIncomingConnection ( v) => v. run ( runner) . await ,
276+ Self :: MakeOutgoingConnection ( v) => v. run ( runner) . await ,
277+ Self :: AcceptMultipleIncomingConnections ( v) => v. run ( runner) . await ,
278+ Self :: MakeMultipleOutgoingConnections ( v) => v. run ( runner) . await ,
279+ Self :: DontConnectToNodeWithSameId ( v) => v. run ( runner) . await ,
280+ Self :: DontConnectToInitialPeerWithSameId ( v) => v. run ( runner) . await ,
281+ Self :: DontConnectToSelfInitialPeer ( v) => v. run ( runner) . await ,
282+ Self :: SimultaneousConnections ( v) => v. run ( runner) . await ,
283+ Self :: ConnectToInitialPeers ( v) => v. run ( runner) . await ,
284+ Self :: ConnectToUnavailableInitialPeers ( v) => v. run ( runner) . await ,
285+ Self :: AllNodesConnectionsAreSymmetric ( v) => v. run ( runner) . await ,
286+ Self :: ConnectToInitialPeersBecomeReady ( v) => v. run ( runner) . await ,
287+ Self :: SeedConnectionsAreSymmetric ( v) => v. run ( runner) . await ,
288+ Self :: MaxNumberOfPeersIncoming ( v) => v. run ( runner) . await ,
289+ Self :: MaxNumberOfPeersIs1 ( v) => v. run ( runner) . await ,
195290 }
196291 }
197292
0 commit comments