3
3
#include "../../choreo/fd_choreo_base.h"
4
4
#include "../../discof/reasm/fd_reasm.h"
5
5
#include "../../discof/replay/fd_replay_notif.h"
6
+ #include "../../discof/gossip/fd_gossip_tile.h"
6
7
#include "../../disco/net/fd_net_tile.h"
7
8
#include "../../disco/quic/fd_tpu.h"
8
9
#include "../../disco/tiles.h"
12
13
#include "../../util/tile/fd_tile_private.h"
13
14
#include "../../discof/restore/utils/fd_ssmsg.h"
14
15
#include "../../flamenco/runtime/fd_runtime.h"
16
+ #include "../../flamenco/gossip/fd_gossip.h"
15
17
16
18
#include <sys/random.h>
17
19
#include <sys/types.h>
@@ -193,6 +195,7 @@ setup_snapshots( config_t * config,
193
195
void
194
196
fd_topo_initialize ( config_t * config ) {
195
197
resolve_gossip_entrypoints ( config );
198
+ config -> gossip .boot_timestamp_nanos = fd_log_wallclock ();
196
199
197
200
ulong net_tile_cnt = config -> layout .net_tile_count ;
198
201
ulong shred_tile_cnt = config -> layout .shred_tile_count ;
@@ -201,6 +204,7 @@ fd_topo_initialize( config_t * config ) {
201
204
ulong bank_tile_cnt = config -> layout .bank_tile_count ;
202
205
ulong exec_tile_cnt = config -> firedancer .layout .exec_tile_count ;
203
206
ulong writer_tile_cnt = config -> firedancer .layout .writer_tile_count ;
207
+ ulong gossvf_tile_cnt = config -> firedancer .layout .gossvf_tile_count ;
204
208
ulong resolv_tile_cnt = config -> layout .resolv_tile_count ;
205
209
ulong sign_tile_cnt = config -> firedancer .layout .sign_tile_count ;
206
210
@@ -212,7 +216,7 @@ fd_topo_initialize( config_t * config ) {
212
216
/* topo, name */
213
217
fd_topob_wksp ( topo , "metric_in" );
214
218
fd_topob_wksp ( topo , "net_shred" );
215
- fd_topob_wksp ( topo , "net_gossip " );
219
+ fd_topob_wksp ( topo , "gossip_net " );
216
220
fd_topob_wksp ( topo , "net_repair" );
217
221
fd_topob_wksp ( topo , "net_quic" );
218
222
fd_topob_wksp ( topo , "net_send" );
@@ -246,6 +250,9 @@ fd_topo_initialize( config_t * config ) {
246
250
fd_topob_wksp ( topo , "root_out" );
247
251
fd_topob_wksp ( topo , "ipecho_out" );
248
252
253
+ fd_topob_wksp ( topo , "gossvf_gossi" );
254
+ fd_topob_wksp ( topo , "gossip_gossv" );
255
+
249
256
fd_topob_wksp ( topo , "repair_sign" );
250
257
251
258
fd_topob_wksp ( topo , "repair_repla" );
@@ -263,6 +270,7 @@ fd_topo_initialize( config_t * config ) {
263
270
fd_topob_wksp ( topo , "sign" );
264
271
fd_topob_wksp ( topo , "repair" );
265
272
fd_topob_wksp ( topo , "ipecho" );
273
+ fd_topob_wksp ( topo , "gossvf" );
266
274
fd_topob_wksp ( topo , "gossip" );
267
275
fd_topob_wksp ( topo , "metric" );
268
276
fd_topob_wksp ( topo , "replay" );
@@ -330,16 +338,15 @@ fd_topo_initialize( config_t * config ) {
330
338
331
339
FOR (exec_tile_cnt ) fd_topob_link ( topo , "exec_writer ", " exec_writer ", 128UL, FD_EXEC_WRITER_MTU, 1UL );
332
340
333
- /**/ fd_topob_link( topo, " gossip_out ", " gossip_out ", 65536UL, 2048UL, 1UL );
341
+ /**/ fd_topob_link( topo, " gossip_out ", " gossip_out ", 65536UL*4UL , sizeof(fd_gossip_update_message_t), 1UL );
334
342
/**/ fd_topob_link( topo, " replay_out ", " replay_out ", 128UL, sizeof(fd_replay_out_t), 1UL );
335
343
/**/ fd_topob_link( topo, " root_out ", " root_out ", 128UL, sizeof(fd_block_id_t), 1UL );
336
344
/**/ fd_topob_link( topo, " ipecho_out ", " ipecho_out ", 4UL, 0UL, 1UL );
337
345
338
- /**/ fd_topob_link( topo, " crds_shred ", " crds_shred ", 128UL, 8UL + 40200UL * 38UL, 1UL );
339
- /**/ fd_topob_link( topo, " gossip_repai ", " gossip_repai ", 128UL, 40200UL * 38UL, 1UL );
340
- /**/ fd_topob_link( topo, " gossip_send ", " gossip_send ", 128UL, USHORT_MAX, 25UL );
346
+ FOR (gossvf_tile_cnt ) fd_topob_link ( topo , "gossvf_gossi" , "gossvf_gossi" , config -> net .ingress_buffer_size , sizeof (fd_gossip_view_t )+ FD_NET_MTU , 1UL );
347
+ /**/ fd_topob_link ( topo , "gossip_gossv" , "gossip_gossv" , 65536UL * 4UL , sizeof (fd_gossip_ping_update_t ), 1UL );
341
348
342
- /**/ fd_topob_link( topo, " gossip_net ", " net_gossip ", config->net.ingress_buffer_size, FD_NET_MTU, 1UL );
349
+ /**/ fd_topob_link ( topo , "gossip_net" , "gossip_net " , 65536 * 4UL , FD_NET_MTU , 1UL );
343
350
/**/ fd_topob_link ( topo , "send_net" , "net_send" , config -> net .ingress_buffer_size , FD_NET_MTU , 2UL );
344
351
345
352
/**/ fd_topob_link ( topo , "repair_net" , "net_repair" , config -> net .ingress_buffer_size , FD_NET_MTU , 1UL );
@@ -402,7 +409,7 @@ fd_topo_initialize( config_t * config ) {
402
409
403
410
fd_topos_net_tiles ( topo , net_tile_cnt , & config -> net , config -> tiles .netlink .max_routes , config -> tiles .netlink .max_peer_routes , config -> tiles .netlink .max_neighbors , tile_to_cpu );
404
411
405
- FOR (net_tile_cnt ) fd_topos_net_rx_link ( topo , "net_gossip ", i , config -> net .ingress_buffer_size );
412
+ FOR (net_tile_cnt ) fd_topos_net_rx_link ( topo , "net_gossvf ", i , config -> net .ingress_buffer_size );
406
413
FOR (net_tile_cnt ) fd_topos_net_rx_link ( topo , "net_repair ", i , config -> net .ingress_buffer_size );
407
414
FOR (net_tile_cnt ) fd_topos_net_rx_link ( topo , "net_quic ", i , config -> net .ingress_buffer_size );
408
415
FOR (net_tile_cnt ) fd_topos_net_rx_link ( topo , "net_shred ", i , config -> net .ingress_buffer_size );
@@ -418,6 +425,7 @@ fd_topo_initialize( config_t * config ) {
418
425
/**/ fd_topob_tile( topo, " metric ", " metric ", " metric_in ", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
419
426
fd_topo_tile_t * pack_tile = fd_topob_tile ( topo , "pack" , "pack" , "metric_in" , tile_to_cpu [ topo -> tile_cnt ], 0 , 0 );
420
427
/**/ fd_topob_tile ( topo , "poh" , "poh" , "metric_in" , tile_to_cpu [ topo -> tile_cnt ], 0 , 1 );
428
+ FOR (gossvf_tile_cnt ) fd_topob_tile ( topo , "gossvf ", " gossvf ", " metric_in ", tile_to_cpu[ topo->tile_cnt ], 0, 1 );
421
429
/**/ fd_topob_tile( topo, " gossip ", " gossip ", " metric_in ", tile_to_cpu[ topo->tile_cnt ], 0, 1 );
422
430
/**/ fd_topob_tile( topo, " ipecho ", " ipecho ", " metric_in ", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
423
431
fd_topo_tile_t * repair_tile = fd_topob_tile ( topo , "repair" , "repair" , "metric_in" , tile_to_cpu [ topo -> tile_cnt ], 0 , 0 );
@@ -614,12 +622,21 @@ fd_topo_initialize( config_t * config ) {
614
622
/**/ fd_topob_tile_out ( topo , "sign" , 0UL , "sign_shred" , i );
615
623
}
616
624
617
- FOR (net_tile_cnt ) fd_topob_tile_in ( topo , "gossip ", 0UL, " metric_in ", " net_gossip ", i, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
618
- /**/ fd_topob_tile_in ( topo, " gossip ", 0UL, " metric_in ", " stake_out ", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
619
- /**/ fd_topob_tile_out( topo, " gossip ", 0UL, " gossip_out ", 0UL );
625
+ FOR (gossvf_tile_cnt ) for ( ulong j = 0UL ; j < net_tile_cnt ; j ++ )
626
+ fd_topob_tile_in ( topo , "gossvf" , i , "metric_in" , "net_gossvf" , j , FD_TOPOB_UNRELIABLE , FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
627
+ FOR (gossvf_tile_cnt ) fd_topob_tile_out ( topo , "gossvf ", i, " gossvf_gossi ", i );
628
+ FOR (gossvf_tile_cnt ) fd_topob_tile_in ( topo , "gossvf" , i , "metric_in" , "gossip_out" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
629
+ FOR (gossvf_tile_cnt ) fd_topob_tile_in ( topo , "gossvf ", i, " metric_in ", " gossip_gossv ", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
630
+ FOR (gossvf_tile_cnt ) fd_topob_tile_in ( topo , "gossvf" , i , "metric_in" , "ipecho_out" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
631
+
632
+ /**/ fd_topob_tile_in ( topo , "gossip" , 0UL , "metric_in" , "stake_out" , 0UL , FD_TOPOB_UNRELIABLE , FD_TOPOB_POLLED );
633
+ /**/ fd_topob_tile_out ( topo , "gossip" , 0UL , "gossip_out" , 0UL );
620
634
/**/ fd_topob_tile_out ( topo , "gossip" , 0UL , "gossip_net" , 0UL );
621
635
/**/ fd_topob_tile_in ( topo , "sign" , 0UL , "metric_in" , "gossip_sign" , 0UL , FD_TOPOB_UNRELIABLE , FD_TOPOB_POLLED );
622
636
/**/ fd_topob_tile_out ( topo , "gossip" , 0UL , "gossip_sign" , 0UL );
637
+ /**/ fd_topob_tile_in ( topo , "gossip" , 0UL , "metric_in" , "ipecho_out" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
638
+ FOR (gossvf_tile_cnt ) fd_topob_tile_in ( topo , "gossip ", 0UL, " metric_in ", " gossvf_gossi ", i, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
639
+ /**/ fd_topob_tile_out( topo, " gossip ", 0UL, " gossip_gossv ", 0UL );
623
640
/**/ fd_topob_tile_in ( topo, " gossip ", 0UL, " metric_in ", " sign_gossip ", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_UNPOLLED );
624
641
/**/ fd_topob_tile_out( topo, " sign ", 0UL, " sign_gossip ", 0UL );
625
642
@@ -761,18 +778,15 @@ fd_topo_initialize( config_t * config ) {
761
778
762
779
/**/ fd_topob_link ( topo , "plugin_out" , "plugin_out" , 128UL , 8UL + 40200UL * (58UL + 12UL * 34UL ), 1UL );
763
780
/**/ fd_topob_link ( topo , "replay_plugi" , "plugin_in" , 128UL , 4098 * 8UL , 1UL );
764
- /**/ fd_topob_link ( topo , "gossip_plugi" , "plugin_in" , 128UL , 8UL + 40200UL * (58UL + 12UL * 34UL ), 1UL );
765
781
/**/ fd_topob_link ( topo , "votes_plugin" , "plugin_in" , 128UL , 8UL + 40200UL * (58UL + 12UL * 34UL ), 1UL );
766
782
767
783
/**/ fd_topob_tile ( topo , "plugin" , "plugin" , "metric_in" , tile_to_cpu [ topo -> tile_cnt ], 0 , 0 );
768
784
769
785
/**/ fd_topob_tile_out ( topo , "replay" , 0UL , "replay_plugi" , 0UL );
770
786
/**/ fd_topob_tile_out ( topo , "replay" , 0UL , "votes_plugin" , 0UL );
771
- /**/ fd_topob_tile_out ( topo , "gossip" , 0UL , "gossip_plugi" , 0UL );
772
787
/**/ fd_topob_tile_out ( topo , "plugin" , 0UL , "plugin_out" , 0UL );
773
788
774
789
/**/ fd_topob_tile_in ( topo , "plugin" , 0UL , "metric_in" , "replay_plugi" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
775
- /**/ fd_topob_tile_in ( topo , "plugin" , 0UL , "metric_in" , "gossip_plugi" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
776
790
/**/ fd_topob_tile_in ( topo , "plugin" , 0UL , "metric_in" , "stake_out" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
777
791
/**/ fd_topob_tile_in ( topo , "plugin" , 0UL , "metric_in" , "votes_plugin" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
778
792
}
@@ -875,8 +889,9 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
875
889
tile -> gossip .ip_addr = config -> net .ip_addr ;
876
890
}
877
891
strncpy ( tile -> gossip .identity_key_path , config -> paths .identity_key , sizeof (tile -> gossip .identity_key_path ) );
878
- tile -> gossip .shred_version = config -> consensus .expected_shred_version ;
879
- tile -> gossip .max_entries = config -> tiles .gossip .max_entries ;
892
+ tile -> gossip .shred_version = config -> consensus .expected_shred_version ;
893
+ tile -> gossip .max_entries = config -> tiles .gossip .max_entries ;
894
+ tile -> gossip .boot_timesamp_nanos = config -> gossip .boot_timestamp_nanos ;
880
895
881
896
tile -> gossip .ip_addr = config -> net .ip_addr ;
882
897
@@ -889,6 +904,16 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
889
904
tile -> gossip .entrypoints_cnt = config -> gossip .entrypoints_cnt ;
890
905
fd_memcpy ( tile -> gossip .entrypoints , config -> gossip .resolved_entrypoints , tile -> gossip .entrypoints_cnt * sizeof (fd_ip4_port_t ) );
891
906
907
+ } else if ( FD_UNLIKELY ( !strcmp ( tile -> name , "gossvf" ) ) ) {
908
+ strncpy ( tile -> gossvf .identity_key_path , config -> paths .identity_key , sizeof (tile -> gossvf .identity_key_path ) );
909
+ tile -> gossvf .tcache_depth = 1 <<22UL ; /* TODO: user defined option */
910
+ tile -> gossvf .shred_version = 0U ;
911
+ tile -> gossvf .allow_private_address = config -> development .gossip .allow_private_address ;
912
+ tile -> gossvf .boot_timesamp_nanos = config -> gossip .boot_timestamp_nanos ;
913
+
914
+ tile -> gossvf .entrypoints_cnt = config -> gossip .entrypoints_cnt ;
915
+ fd_memcpy ( tile -> gossvf .entrypoints , config -> gossip .resolved_entrypoints , tile -> gossvf .entrypoints_cnt * sizeof (fd_ip4_port_t ) );
916
+
892
917
} else if ( FD_UNLIKELY ( !strcmp ( tile -> name , "ipecho" ) ) ) {
893
918
tile -> ipecho .expected_shred_version = config -> consensus .expected_shred_version ;
894
919
tile -> ipecho .bind_address = config -> net .ip_addr ;
0 commit comments