Line data Source code
1 : #include "../shared/fd_config.h"
2 :
3 : #include "../../disco/net/fd_net_tile.h"
4 : #include "../../disco/quic/fd_tpu.h"
5 : #include "../../disco/tiles.h"
6 : #include "../../disco/topo/fd_topob.h"
7 : #include "../../disco/topo/fd_cpu_topo.h"
8 : #include "../../disco/bundle/fd_bundle_tile.h"
9 : #include "../../util/pod/fd_pod_format.h"
10 : #include "../../util/net/fd_ip4.h"
11 :
12 : extern fd_topo_obj_callbacks_t * CALLBACKS[];
13 :
14 : static void
15 0 : parse_ip_port( const char * name, const char * ip_port, fd_topo_ip_port_t *parsed_ip_port) {
16 0 : char buf[ sizeof( "255.255.255.255:65536" ) ];
17 0 : memcpy( buf, ip_port, sizeof( buf ) );
18 0 : char *ip_end = strchr( buf, ':' );
19 0 : if( FD_UNLIKELY( !ip_end ) )
20 0 : FD_LOG_ERR(( "[%s] must in the form ip:port", name ));
21 0 : *ip_end = '\0';
22 :
23 0 : if( FD_UNLIKELY( !fd_cstr_to_ip4_addr( buf, &( parsed_ip_port->ip ) ) ) ) {
24 0 : FD_LOG_ERR(( "could not parse IP %s in [%s]", buf, name ));
25 0 : }
26 :
27 0 : parsed_ip_port->port = fd_cstr_to_ushort( ip_end+1 );
28 0 : if( FD_UNLIKELY( !parsed_ip_port->port ) )
29 0 : FD_LOG_ERR(( "could not parse port %s in [%s]", ip_end+1, name ));
30 0 : }
31 :
32 : void
33 : fd_topo_configure_tile( fd_topo_tile_t * tile,
34 : fd_config_t * config );
35 :
36 : void
37 0 : fd_topo_initialize( config_t * config ) {
38 0 : ulong net_tile_cnt = config->layout.net_tile_count;
39 0 : ulong quic_tile_cnt = config->layout.quic_tile_count;
40 0 : ulong verify_tile_cnt = config->layout.verify_tile_count;
41 0 : ulong resolh_tile_cnt = config->frankendancer.layout.resolh_tile_count;
42 0 : ulong bank_tile_cnt = config->frankendancer.layout.bank_tile_count;
43 0 : ulong shred_tile_cnt = config->layout.shred_tile_count;
44 :
45 0 : fd_topo_t * topo = { fd_topob_new( &config->topo, config->name ) };
46 0 : topo->max_page_size = fd_cstr_to_shmem_page_sz( config->hugetlbfs.max_page_size );
47 0 : topo->gigantic_page_threshold = config->hugetlbfs.gigantic_page_threshold_mib << 20;
48 :
49 : /* topo, name */
50 0 : fd_topob_wksp( topo, "metric_in" );
51 0 : fd_topob_wksp( topo, "net_quic" );
52 0 : fd_topob_wksp( topo, "net_shred" );
53 0 : fd_topob_wksp( topo, "quic_verify" );
54 0 : fd_topob_wksp( topo, "verify_dedup" );
55 0 : fd_topob_wksp( topo, "dedup_resolh" );
56 0 : fd_topob_wksp( topo, "resolh_pack" );
57 0 : fd_topob_wksp( topo, "pack_bank" );
58 0 : fd_topob_wksp( topo, "pack_pohh" );
59 0 : fd_topob_wksp( topo, "bank_pack" );
60 0 : fd_topob_wksp( topo, "bank_pohh" );
61 0 : fd_topob_wksp( topo, "bank_busy" );
62 0 : fd_topob_wksp( topo, "pohh_shred" );
63 0 : fd_topob_wksp( topo, "gossip_dedup" );
64 0 : fd_topob_wksp( topo, "shred_store" );
65 0 : fd_topob_wksp( topo, "stake_out" );
66 0 : fd_topob_wksp( topo, "executed_txn" );
67 :
68 0 : fd_topob_wksp( topo, "shred_sign" );
69 0 : fd_topob_wksp( topo, "sign_shred" );
70 :
71 0 : fd_topob_wksp( topo, "quic" );
72 0 : fd_topob_wksp( topo, "verify" );
73 0 : fd_topob_wksp( topo, "dedup" );
74 0 : fd_topob_wksp( topo, "resolh" );
75 0 : fd_topob_wksp( topo, "pack" );
76 0 : fd_topob_wksp( topo, "bank" );
77 0 : fd_topob_wksp( topo, "pohh" );
78 0 : fd_topob_wksp( topo, "shred" );
79 0 : fd_topob_wksp( topo, "store" );
80 0 : fd_topob_wksp( topo, "sign" )->core_dump_level = FD_TOPO_CORE_DUMP_LEVEL_NEVER;
81 0 : fd_topob_wksp( topo, "metric" );
82 0 : fd_topob_wksp( topo, "diag" );
83 :
84 0 : #define FOR(cnt) for( ulong i=0UL; i<cnt; i++ )
85 :
86 : /* topo, link_name, wksp_name, depth, mtu, burst */
87 0 : FOR(quic_tile_cnt) fd_topob_link( topo, "quic_net", "net_quic", config->net.ingress_buffer_size, FD_NET_MTU, 1UL );
88 0 : FOR(shred_tile_cnt) fd_topob_link( topo, "shred_net", "net_shred", 32768UL, FD_NET_MTU, 1UL );
89 0 : FOR(quic_tile_cnt) fd_topob_link( topo, "quic_verify", "quic_verify", config->tiles.verify.receive_buffer_size, sizeof(fd_tpu_msg_t), config->tiles.quic.txn_reassembly_count );
90 0 : FOR(verify_tile_cnt) fd_topob_link( topo, "verify_dedup", "verify_dedup", config->tiles.verify.receive_buffer_size, FD_TPU_PARSED_MTU, 1UL );
91 0 : /**/ fd_topob_link( topo, "gossip_dedup", "gossip_dedup", 2048UL, FD_TPU_RAW_MTU, 1UL );
92 : /* dedup_resolh is large currently because pack can encounter stalls when running at very high throughput rates that would
93 : otherwise cause drops. */
94 0 : /**/ fd_topob_link( topo, "dedup_resolh", "dedup_resolh", 65536UL, FD_TPU_PARSED_MTU, 1UL );
95 0 : FOR(resolh_tile_cnt) fd_topob_link( topo, "resolh_pack", "resolh_pack", 65536UL, FD_TPU_RESOLVED_MTU, 1UL );
96 0 : /**/ fd_topob_link( topo, "stake_out", "stake_out", 128UL, FD_STAKE_OUT_MTU, 1UL );
97 : /* pack_bank is shared across all banks, so if one bank stalls due to complex transactions, the buffer needs to be large so that
98 : other banks can keep proceeding. */
99 0 : /**/ fd_topob_link( topo, "pack_bank", "pack_bank", 65536UL, USHORT_MAX, 1UL );
100 0 : /**/ fd_topob_link( topo, "pack_pohh", "pack_pohh", 65536UL, sizeof(fd_done_packing_t), 1UL );
101 0 : FOR(bank_tile_cnt) fd_topob_link( topo, "bank_pohh", "bank_pohh", 16384UL, USHORT_MAX, 1UL );
102 0 : FOR(bank_tile_cnt) fd_topob_link( topo, "bank_pack", "bank_pack", 16384UL, USHORT_MAX, 3UL );
103 0 : /**/ fd_topob_link( topo, "pohh_pack", "bank_pohh", 128UL, sizeof(fd_became_leader_t), 1UL );
104 0 : /**/ fd_topob_link( topo, "pohh_shred", "pohh_shred", 16384UL, USHORT_MAX, 2UL );
105 0 : /**/ fd_topob_link( topo, "crds_shred", "pohh_shred", 128UL, 8UL + 108000UL * 46UL, 1UL );
106 0 : /**/ fd_topob_link( topo, "replay_resol", "bank_pohh", 128UL, sizeof(fd_completed_bank_t), 1UL );
107 0 : /**/ fd_topob_link( topo, "executed_txn", "executed_txn", 16384UL, 64UL, 1UL );
108 : /* See long comment in fd_shred.c for an explanation about the size of this dcache. */
109 0 : FOR(shred_tile_cnt) fd_topob_link( topo, "shred_store", "shred_store", 65536UL, 4UL*FD_SHRED_STORE_MTU, 4UL+config->tiles.shred.max_pending_shred_sets );
110 :
111 0 : FOR(shred_tile_cnt) fd_topob_link( topo, "shred_sign", "shred_sign", 128UL, 32UL, 1UL );
112 0 : FOR(shred_tile_cnt) fd_topob_link( topo, "sign_shred", "sign_shred", 128UL, 64UL, 1UL );
113 :
114 0 : ushort parsed_tile_to_cpu[ FD_TILE_MAX ];
115 : /* Unassigned tiles will be floating, unless auto topology is enabled. */
116 0 : for( ulong i=0UL; i<FD_TILE_MAX; i++ ) parsed_tile_to_cpu[ i ] = USHORT_MAX;
117 :
118 0 : int is_auto_affinity = !strcmp( config->layout.affinity, "auto" );
119 0 : int is_agave_auto_affinity = !strcmp( config->frankendancer.layout.agave_affinity, "auto" );
120 :
121 0 : if( FD_UNLIKELY( is_auto_affinity != is_agave_auto_affinity ) ) {
122 0 : FD_LOG_ERR(( "The CPU affinity string in the configuration file under [layout.affinity] and [layout.agave_affinity] must both be set to 'auto' or both be set to a specific CPU affinity string." ));
123 0 : }
124 :
125 0 : fd_topo_cpus_t cpus[1];
126 0 : fd_topo_cpus_init( cpus );
127 :
128 0 : ulong affinity_tile_cnt = 0UL;
129 0 : if( FD_LIKELY( !is_auto_affinity ) ) affinity_tile_cnt = fd_topob_parse_affinity_cstr( config->layout.affinity, parsed_tile_to_cpu, 0 );
130 :
131 0 : ulong tile_to_cpu[ FD_TILE_MAX ] = {0};
132 0 : for( ulong i=0UL; i<affinity_tile_cnt; i++ ) {
133 0 : if( FD_UNLIKELY( parsed_tile_to_cpu[ i ]!=USHORT_MAX && parsed_tile_to_cpu[ i ]>=cpus->cpu_cnt ) )
134 0 : FD_LOG_ERR(( "The CPU affinity string in the configuration file under [layout.affinity] specifies a CPU index of %hu, but the system "
135 0 : "only has %lu CPUs. You should either change the CPU allocations in the affinity string, or increase the number of CPUs "
136 0 : "in the system.",
137 0 : parsed_tile_to_cpu[ i ], cpus->cpu_cnt ));
138 0 : tile_to_cpu[ i ] = fd_ulong_if( parsed_tile_to_cpu[ i ]==USHORT_MAX, ULONG_MAX, (ulong)parsed_tile_to_cpu[ i ] );
139 0 : }
140 :
141 0 : int xsk_core_dump = config->development.core_dump_level >= FD_TOPO_CORE_DUMP_LEVEL_REGULAR ? 1 : 0;
142 0 : fd_topos_net_tiles( topo, config->layout.net_tile_count, &config->net, config->tiles.netlink.max_routes, config->tiles.netlink.max_peer_routes, config->tiles.netlink.max_neighbors, xsk_core_dump, tile_to_cpu );
143 :
144 0 : FOR(net_tile_cnt) fd_topos_net_rx_link( topo, "net_quic", i, config->net.ingress_buffer_size );
145 0 : FOR(net_tile_cnt) fd_topos_net_rx_link( topo, "net_shred", i, config->net.ingress_buffer_size );
146 :
147 : /* topo, tile_name, tile_wksp, metrics_wksp, cpu_idx, is_agave, uses_id_keyswitch, uses_av_keyswitch */
148 0 : FOR(quic_tile_cnt) fd_topob_tile( topo, "quic", "quic", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0, 0 );
149 0 : FOR(verify_tile_cnt) fd_topob_tile( topo, "verify", "verify", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0, 0 );
150 0 : /**/ fd_topob_tile( topo, "dedup", "dedup", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0, 0 );
151 0 : FOR(resolh_tile_cnt) fd_topob_tile( topo, "resolh", "resolh", "metric_in", tile_to_cpu[ topo->tile_cnt ], 1, 0, 0 );
152 0 : /**/ fd_topob_tile( topo, "pack", "pack", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, config->tiles.bundle.enabled, 0 );
153 0 : FOR(bank_tile_cnt) fd_topob_tile( topo, "bank", "bank", "metric_in", tile_to_cpu[ topo->tile_cnt ], 1, 0, 0 );
154 0 : /**/ fd_topob_tile( topo, "pohh", "pohh", "metric_in", tile_to_cpu[ topo->tile_cnt ], 1, 1, 0 );
155 0 : FOR(shred_tile_cnt) fd_topob_tile( topo, "shred", "shred", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1, 0 );
156 0 : /**/ fd_topob_tile( topo, "store", "store", "metric_in", tile_to_cpu[ topo->tile_cnt ], 1, 0, 0 );
157 0 : /**/ fd_topob_tile( topo, "sign", "sign", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1, 0 );
158 0 : /**/ fd_topob_tile( topo, "metric", "metric", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0, 0 );
159 0 : /**/ fd_topob_tile( topo, "diag", "diag", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0, 0 );
160 :
161 : /* topo, tile_name, tile_kind_id, fseq_wksp, link_name, link_kind_id, reliable, polled */
162 0 : for( ulong j=0UL; j<quic_tile_cnt; j++ )
163 0 : fd_topos_tile_in_net( topo, "metric_in", "quic_net", j, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
164 0 : for( ulong j=0UL; j<shred_tile_cnt; j++ )
165 0 : fd_topos_tile_in_net( topo, "metric_in", "shred_net", j, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
166 :
167 0 : FOR(quic_tile_cnt) for( ulong j=0UL; j<net_tile_cnt; j++ )
168 0 : fd_topob_tile_in( topo, "quic", i, "metric_in", "net_quic", j, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
169 0 : FOR(quic_tile_cnt) fd_topob_tile_out( topo, "quic", i, "quic_verify", i );
170 0 : FOR(quic_tile_cnt) fd_topob_tile_out( topo, "quic", i, "quic_net", i );
171 : /* All verify tiles read from all QUIC tiles, packets are round robin. */
172 0 : FOR(verify_tile_cnt) for( ulong j=0UL; j<quic_tile_cnt; j++ )
173 0 : fd_topob_tile_in( topo, "verify", i, "metric_in", "quic_verify", j, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers, verify tiles may be overrun */
174 0 : FOR(verify_tile_cnt) fd_topob_tile_out( topo, "verify", i, "verify_dedup", i );
175 : /* Declare the single gossip link before the variable length verify-dedup links so we could have a compile-time index to the gossip link. */
176 0 : /**/ fd_topob_tile_in( topo, "dedup", 0UL, "metric_in", "gossip_dedup", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
177 0 : FOR(verify_tile_cnt) fd_topob_tile_in( topo, "dedup", 0UL, "metric_in", "verify_dedup", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
178 0 : /**/ fd_topob_tile_in( topo, "dedup", 0UL, "metric_in", "executed_txn", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
179 0 : /**/ fd_topob_tile_out( topo, "dedup", 0UL, "dedup_resolh", 0UL );
180 0 : FOR(resolh_tile_cnt) fd_topob_tile_in( topo, "resolh", i, "metric_in", "dedup_resolh", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
181 0 : FOR(resolh_tile_cnt) fd_topob_tile_in( topo, "resolh", i, "metric_in", "replay_resol", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
182 0 : FOR(resolh_tile_cnt) fd_topob_tile_out( topo, "resolh", i, "resolh_pack", i );
183 0 : FOR(resolh_tile_cnt) fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "resolh_pack", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
184 : /* The PoH to pack link is reliable, and must be. The fragments going
185 : across here are "you became leader" which pack must respond to
186 : by publishing microblocks, otherwise the leader TPU will hang
187 : forever.
188 :
189 : It's marked as unreliable since otherwise we have a reliable credit
190 : loop which will also starve the pack tile. This is OK because we
191 : will never send more than one leader message until the pack tile
192 : must acknowledge it with a packing done frag, so there will be at
193 : most one in flight at any time. */
194 0 : /**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "pohh_pack", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
195 0 : /**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "executed_txn", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
196 0 : fd_topob_tile_out( topo, "pack", 0UL, "pack_bank", 0UL );
197 0 : fd_topob_tile_out( topo, "pack", 0UL, "pack_pohh", 0UL );
198 0 : FOR(bank_tile_cnt) fd_topob_tile_in( topo, "bank", i, "metric_in", "pack_bank", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
199 0 : FOR(bank_tile_cnt) fd_topob_tile_out( topo, "bank", i, "bank_pohh", i );
200 0 : FOR(bank_tile_cnt) fd_topob_tile_out( topo, "bank", i, "bank_pack", i );
201 0 : FOR(bank_tile_cnt) fd_topob_tile_in( topo, "pohh", 0UL, "metric_in", "bank_pohh", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
202 0 : if( FD_LIKELY( config->tiles.pack.use_consumed_cus ) )
203 0 : FOR(bank_tile_cnt) fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "bank_pack", i, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
204 0 : /**/ fd_topob_tile_in( topo, "pohh", 0UL, "metric_in", "stake_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
205 0 : /**/ fd_topob_tile_in( topo, "pohh", 0UL, "metric_in", "pack_pohh", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
206 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "pohh_shred", 0UL );
207 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "pohh_pack", 0UL );
208 0 : FOR(shred_tile_cnt) for( ulong j=0UL; j<net_tile_cnt; j++ )
209 0 : fd_topob_tile_in( topo, "shred", i, "metric_in", "net_shred", j, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
210 0 : FOR(shred_tile_cnt) fd_topob_tile_in( topo, "shred", i, "metric_in", "pohh_shred", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
211 0 : FOR(shred_tile_cnt) fd_topob_tile_in( topo, "shred", i, "metric_in", "stake_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
212 0 : FOR(shred_tile_cnt) fd_topob_tile_in( topo, "shred", i, "metric_in", "crds_shred", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
213 0 : FOR(shred_tile_cnt) fd_topob_tile_in( topo, "shred", i, "metric_in", "replay_resol", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
214 0 : FOR(shred_tile_cnt) fd_topob_tile_out( topo, "shred", i, "shred_store", i );
215 0 : FOR(shred_tile_cnt) fd_topob_tile_out( topo, "shred", i, "shred_net", i );
216 0 : FOR(shred_tile_cnt) fd_topob_tile_in( topo, "store", 0UL, "metric_in", "shred_store", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
217 :
218 : /* Sign links don't need to be reliable because they are synchronous,
219 : so there's at most one fragment in flight at a time anyway. The
220 : sign links are also not polled by fd_stem, instead the tiles will
221 : read the sign responses out of band in a dedicated spin loop. */
222 :
223 0 : for( ulong i=0UL; i<shred_tile_cnt; i++ ) {
224 0 : /**/ fd_topob_tile_in( topo, "sign", 0UL, "metric_in", "shred_sign", i, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
225 0 : /**/ fd_topob_tile_out( topo, "shred", i, "shred_sign", i );
226 0 : /**/ fd_topob_tile_in( topo, "shred", i, "metric_in", "sign_shred", i, FD_TOPOB_UNRELIABLE, FD_TOPOB_UNPOLLED );
227 0 : /**/ fd_topob_tile_out( topo, "sign", 0UL, "sign_shred", i );
228 0 : }
229 :
230 : /* PoH tile represents the Agave address space, so it's
231 : responsible for publishing Agave provided data to
232 : these links. */
233 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "gossip_dedup", 0UL );
234 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "stake_out", 0UL );
235 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "crds_shred", 0UL );
236 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "replay_resol", 0UL );
237 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "executed_txn", 0UL );
238 :
239 : /* For now the only plugin consumer is the GUI */
240 0 : int plugins_enabled = config->tiles.gui.enabled;
241 0 : if( FD_LIKELY( plugins_enabled ) ) {
242 0 : fd_topob_wksp( topo, "plugin_in" );
243 0 : fd_topob_wksp( topo, "plugin_out" );
244 0 : fd_topob_wksp( topo, "plugin" );
245 :
246 : /* The size of plugin_out is the max of the message size from
247 : gossip_plugi and stake_out. */
248 0 : ulong plugin_out_mtu = fd_ulong_max( FD_STAKE_OUT_MTU, 8UL+108000UL*(60UL+12UL*6UL) );
249 0 : /**/ fd_topob_link( topo, "plugin_out", "plugin_out", 128UL, plugin_out_mtu, 1UL );
250 0 : /**/ fd_topob_link( topo, "replay_plugi", "plugin_in", 128UL, 4098*8UL, 1UL );
251 0 : /**/ fd_topob_link( topo, "gossip_plugi", "plugin_in", 128UL, 8UL+108000UL*(60UL+12UL*6UL), 1UL );
252 0 : /**/ fd_topob_link( topo, "pohh_plugin", "plugin_in", 128UL, 16UL, 1UL );
253 0 : /**/ fd_topob_link( topo, "startp_plugi", "plugin_in", 128UL, 56UL, 1UL );
254 0 : /**/ fd_topob_link( topo, "votel_plugin", "plugin_in", 128UL, 8UL, 1UL );
255 0 : /**/ fd_topob_link( topo, "valcfg_plugi", "plugin_in", 128UL, 608UL, 1UL );
256 :
257 : /**/ fd_topob_tile( topo, "plugin", "plugin", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0, 0 );
258 :
259 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "replay_plugi", 0UL );
260 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "gossip_plugi", 0UL );
261 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "pohh_plugin", 0UL );
262 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "startp_plugi", 0UL );
263 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "votel_plugin", 0UL );
264 0 : /**/ fd_topob_tile_out( topo, "plugin", 0UL, "plugin_out", 0UL );
265 0 : /**/ fd_topob_tile_out( topo, "pohh", 0UL, "valcfg_plugi", 0UL );
266 :
267 0 : /**/ fd_topob_tile_in( topo, "plugin", 0UL, "metric_in", "replay_plugi", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
268 0 : /**/ fd_topob_tile_in( topo, "plugin", 0UL, "metric_in", "gossip_plugi", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
269 0 : /**/ fd_topob_tile_in( topo, "plugin", 0UL, "metric_in", "stake_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
270 0 : /**/ fd_topob_tile_in( topo, "plugin", 0UL, "metric_in", "pohh_plugin", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
271 0 : /**/ fd_topob_tile_in( topo, "plugin", 0UL, "metric_in", "startp_plugi", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
272 0 : /**/ fd_topob_tile_in( topo, "plugin", 0UL, "metric_in", "votel_plugin", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
273 0 : /**/ fd_topob_tile_in( topo, "plugin", 0UL, "metric_in", "valcfg_plugi", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
274 0 : }
275 :
276 0 : if( FD_LIKELY( config->tiles.gui.enabled ) ) {
277 0 : fd_topob_wksp( topo, "guih" );
278 0 : /**/ fd_topob_tile( topo, "guih", "guih", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1, 0 );
279 0 : /**/ fd_topob_tile_in( topo, "guih", 0UL, "metric_in", "plugin_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
280 0 : /**/ fd_topob_tile_in( topo, "guih", 0UL, "metric_in", "pohh_pack", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
281 0 : /**/ fd_topob_tile_in( topo, "guih", 0UL, "metric_in", "pack_bank", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
282 0 : /**/ fd_topob_tile_in( topo, "guih", 0UL, "metric_in", "pack_pohh", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
283 0 : FOR(bank_tile_cnt) fd_topob_tile_in( topo, "guih", 0UL, "metric_in", "bank_pohh", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
284 0 : }
285 :
286 0 : if( FD_UNLIKELY( config->tiles.bundle.enabled ) ) {
287 0 : fd_topob_wksp( topo, "bundle_verif" );
288 0 : fd_topob_wksp( topo, "bundle_sign" );
289 0 : fd_topob_wksp( topo, "sign_bundle" );
290 0 : fd_topob_wksp( topo, "pack_sign" );
291 0 : fd_topob_wksp( topo, "sign_pack" );
292 0 : fd_topob_wksp( topo, "bundle" );
293 :
294 0 : /**/ fd_topob_link( topo, "bundle_verif", "bundle_verif", config->tiles.verify.receive_buffer_size, FD_TPU_PARSED_MTU, 1UL );
295 0 : /**/ fd_topob_link( topo, "bundle_sign", "bundle_sign", 65536UL, 9UL, 1UL );
296 0 : /**/ fd_topob_link( topo, "sign_bundle", "sign_bundle", 128UL, 64UL, 1UL );
297 0 : /**/ fd_topob_link( topo, "pack_sign", "pack_sign", 65536UL, 1232UL, 1UL );
298 0 : /**/ fd_topob_link( topo, "sign_pack", "sign_pack", 128UL, 64UL, 1UL );
299 :
300 : /**/ fd_topob_tile( topo, "bundle", "bundle", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1, 0 );
301 :
302 : /**/ fd_topob_tile_out( topo, "bundle", 0UL, "bundle_verif", 0UL );
303 0 : FOR(verify_tile_cnt) fd_topob_tile_in( topo, "verify", i, "metric_in", "bundle_verif", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
304 :
305 0 : /**/ fd_topob_tile_in( topo, "sign", 0UL, "metric_in", "bundle_sign", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
306 0 : /**/ fd_topob_tile_out( topo, "bundle", 0UL, "bundle_sign", 0UL );
307 0 : /**/ fd_topob_tile_in( topo, "bundle", 0UL, "metric_in", "sign_bundle", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_UNPOLLED );
308 0 : /**/ fd_topob_tile_out( topo, "sign", 0UL, "sign_bundle", 0UL );
309 :
310 0 : /**/ fd_topob_tile_in( topo, "sign", 0UL, "metric_in", "pack_sign", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
311 0 : /**/ fd_topob_tile_out( topo, "pack", 0UL, "pack_sign", 0UL );
312 0 : /**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "sign_pack", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_UNPOLLED );
313 0 : /**/ fd_topob_tile_out( topo, "sign", 0UL, "sign_pack", 0UL );
314 :
315 0 : if( config->tiles.gui.enabled ) { /* GUI is the only consumer of bundle_status */
316 0 : fd_topob_wksp( topo, "bundle_status" );
317 : /* bundle_status must be kind of deep, to prevent exhausting
318 : shared flow control credits when publishing many packets at
319 : once. */
320 0 : fd_topob_link( topo, "bundle_status", "bundle_status", 65536UL, sizeof(fd_bundle_block_engine_update_t), 1UL );
321 0 : fd_topob_tile_in( topo, "guih", 0UL, "metric_in", "bundle_status", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
322 0 : fd_topob_tile_out( topo, "bundle", 0UL, "bundle_status", 0UL );
323 0 : }
324 0 : }
325 :
326 0 : if( FD_LIKELY( !is_auto_affinity ) ) {
327 0 : if( FD_UNLIKELY( affinity_tile_cnt<topo->tile_cnt ) )
328 0 : FD_LOG_ERR(( "The topology you are using has %lu tiles, but the CPU affinity specified in the config tile as [layout.affinity] only provides for %lu cores. "
329 0 : "You should either increase the number of cores dedicated to Firedancer in the affinity string, or decrease the number of cores needed by reducing "
330 0 : "the total tile count. You can reduce the tile count by decreasing individual tile counts in the [layout] section of the configuration file.",
331 0 : topo->tile_cnt, affinity_tile_cnt ));
332 0 : if( FD_UNLIKELY( affinity_tile_cnt>topo->tile_cnt ) )
333 0 : FD_LOG_WARNING(( "The topology you are using has %lu tiles, but the CPU affinity specified in the config tile as [layout.affinity] provides for %lu cores. "
334 0 : "Not all cores in the affinity will be used by Firedancer. You may wish to increase the number of tiles in the system by increasing "
335 0 : "individual tile counts in the [layout] section of the configuration file.",
336 0 : topo->tile_cnt, affinity_tile_cnt ));
337 :
338 0 : if( FD_LIKELY( strcmp( "", config->frankendancer.layout.agave_affinity ) ) ) {
339 0 : ushort agave_cpu[ FD_TILE_MAX ];
340 0 : ulong agave_cpu_cnt = fd_topob_parse_affinity_cstr( config->frankendancer.layout.agave_affinity, agave_cpu, 0 );
341 :
342 0 : for( ulong i=0UL; i<agave_cpu_cnt; i++ ) {
343 0 : if( FD_UNLIKELY( agave_cpu[ i ]>=cpus->cpu_cnt ) )
344 0 : FD_LOG_ERR(( "The CPU affinity string in the configuration file under [layout.agave_affinity] specifies a CPU index of %hu, but the system "
345 0 : "only has %lu CPUs. You should either change the CPU allocations in the affinity string, or increase the number of CPUs "
346 0 : "in the system.",
347 0 : agave_cpu[ i ], cpus->cpu_cnt ));
348 :
349 0 : for( ulong j=0UL; j<topo->tile_cnt; j++ ) {
350 0 : fd_topo_tile_t * tile = &topo->tiles[ j ];
351 0 : if( tile->cpu_idx==agave_cpu[ i ] ) FD_LOG_WARNING(( "Tile `%s:%lu` is already assigned to CPU %hu, but the CPU is also assigned to Agave. "
352 0 : "This may cause contention between the two tiles.", tile->name, tile->kind_id, agave_cpu[ i ] ));
353 0 : }
354 :
355 0 : if( FD_UNLIKELY( topo->agave_affinity_cnt>FD_TILE_MAX ) ) {
356 0 : FD_LOG_ERR(( "The CPU affinity string in the configuration file under [layout.agave_affinity] specifies more CPUs than Firedancer can use. "
357 0 : "You should reduce the number of CPUs in the affinity string." ));
358 0 : }
359 0 : topo->agave_affinity_cpu_idx[ topo->agave_affinity_cnt++ ] = agave_cpu[ i ];
360 0 : }
361 0 : }
362 0 : } else {
363 0 : ushort blocklist_cores[ FD_TILE_MAX ];
364 0 : topo->blocklist_cores_cnt = fd_topob_parse_affinity_cstr( config->layout.blocklist_cores, blocklist_cores, 0 );
365 0 : if( FD_UNLIKELY( topo->blocklist_cores_cnt>FD_TILE_MAX ) ) {
366 0 : FD_LOG_ERR(( "The CPU string in the configuration file under [layout.blocklist_cores] specifies more CPUs than Firedancer can use. "
367 0 : "You should reduce the number of CPUs in the excluded cores string." ));
368 0 : }
369 :
370 0 : for( ulong i=0UL; i<topo->blocklist_cores_cnt; i++ ) {
371 : /* Since we use fd_topob_parse_affinity_cstr() like for affinity, the user
372 : may input a string containing `f`. That's parsed correctly, but it's
373 : meaningless for blocklisted cores, so we reject it here. */
374 0 : if( FD_UNLIKELY( blocklist_cores[ i ]==USHORT_MAX ) ) {
375 0 : FD_LOG_ERR(( "The CPU string in the configuration file under [layout.blocklist_cores] contains invalid values: `f`. "
376 0 : "You should fix the excluded cores string." ));
377 0 : }
378 0 : topo->blocklist_cores_cpu_idx[ i ] = blocklist_cores[ i ];
379 0 : }
380 0 : }
381 :
382 : /* There is a special fseq that sits between the pack, bank, and poh
383 : tiles to indicate when the bank/poh tiles are done processing a
384 : microblock. Pack uses this to determine when to "unlock" accounts
385 : that it marked as locked because they were being used. */
386 :
387 0 : for( ulong i=0UL; i<bank_tile_cnt; i++ ) {
388 0 : fd_topo_obj_t * busy_obj = fd_topob_obj( topo, "fseq", "bank_busy" );
389 :
390 0 : fd_topo_tile_t * pohh_tile = &topo->tiles[ fd_topo_find_tile( topo, "pohh", 0UL ) ];
391 0 : fd_topo_tile_t * pack_tile = &topo->tiles[ fd_topo_find_tile( topo, "pack", 0UL ) ];
392 0 : fd_topob_tile_uses( topo, pohh_tile, busy_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
393 0 : fd_topob_tile_uses( topo, pack_tile, busy_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
394 0 : FD_TEST( fd_pod_insertf_ulong( topo->props, busy_obj->id, "execle_busy.%lu", i ) );
395 0 : }
396 :
397 : /* There's another special fseq that's used to communicate the shred
398 : version from the Agave boot path to the shred tile. */
399 0 : fd_topo_obj_t * pohh_shred_obj = fd_topob_obj( topo, "fseq", "pohh_shred" );
400 0 : fd_topo_tile_t * pohh_tile = &topo->tiles[ fd_topo_find_tile( topo, "pohh", 0UL ) ];
401 0 : fd_topob_tile_uses( topo, pohh_tile, pohh_shred_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
402 0 : for( ulong i=0UL; i<shred_tile_cnt; i++ ) {
403 0 : fd_topo_tile_t * shred_tile = &topo->tiles[ fd_topo_find_tile( topo, "shred", i ) ];
404 0 : fd_topob_tile_uses( topo, shred_tile, pohh_shred_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
405 0 : }
406 0 : FD_TEST( fd_pod_insertf_ulong( topo->props, pohh_shred_obj->id, "pohh_shred" ) );
407 :
408 0 : FOR(net_tile_cnt) fd_topos_net_tile_finish( topo, i );
409 :
410 0 : for( ulong i=0UL; i<topo->tile_cnt; i++ ) {
411 0 : fd_topo_tile_t * tile = &topo->tiles[ i ];
412 0 : fd_topo_configure_tile( tile, config );
413 0 : if( FD_UNLIKELY( !strcmp( tile->name, "guih" ) ) ) tile->gui.tile_cnt = topo->tile_cnt;
414 0 : }
415 :
416 0 : if( FD_UNLIKELY( is_auto_affinity ) ) fd_topob_auto_layout( topo, 1 );
417 :
418 0 : fd_topob_finish( topo, CALLBACKS );
419 0 : config->topo = *topo;
420 0 : }
421 :
422 : void
423 : fd_topo_configure_tile( fd_topo_tile_t * tile,
424 0 : fd_config_t * config ) {
425 0 : int plugins_enabled = config->tiles.gui.enabled;
426 :
427 0 : if( FD_UNLIKELY( !strcmp( tile->name, "net" ) || !strcmp( tile->name, "sock" ) ) ) {
428 :
429 0 : tile->net.shred_listen_port = config->tiles.shred.shred_listen_port;
430 0 : tile->net.quic_transaction_listen_port = config->tiles.quic.quic_transaction_listen_port;
431 0 : tile->net.legacy_transaction_listen_port = config->tiles.quic.regular_transaction_listen_port;
432 :
433 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "netlnk" ) ) ) {
434 :
435 : /* already configured */
436 :
437 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "quic" ) ) ) {
438 :
439 0 : tile->quic.reasm_cnt = config->tiles.quic.txn_reassembly_count;
440 0 : tile->quic.out_depth = config->tiles.verify.receive_buffer_size;
441 0 : tile->quic.max_concurrent_connections = config->tiles.quic.max_concurrent_connections;
442 0 : tile->quic.max_concurrent_handshakes = config->tiles.quic.max_concurrent_handshakes;
443 0 : tile->quic.quic_transaction_listen_port = config->tiles.quic.quic_transaction_listen_port;
444 0 : tile->quic.idle_timeout_millis = config->tiles.quic.idle_timeout_millis;
445 0 : tile->quic.ack_delay_millis = config->tiles.quic.ack_delay_millis;
446 0 : tile->quic.retry = config->tiles.quic.retry;
447 0 : fd_cstr_fini( fd_cstr_append_cstr_safe( fd_cstr_init( tile->quic.key_log_path ), config->tiles.quic.ssl_key_log_file, sizeof(tile->quic.key_log_path) ) );
448 :
449 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "bundle" ) ) ) {
450 0 : fd_cstr_ncpy( tile->bundle.url, config->tiles.bundle.url, sizeof(tile->bundle.url) );
451 0 : tile->bundle.url_len = strnlen( tile->bundle.url, sizeof(tile->bundle.url)-1UL );
452 0 : fd_cstr_ncpy( tile->bundle.sni, config->tiles.bundle.tls_domain_name, sizeof(tile->bundle.sni) );
453 0 : tile->bundle.sni_len = strnlen( tile->bundle.sni, sizeof(tile->bundle.sni)-1UL );
454 0 : fd_cstr_ncpy( tile->bundle.identity_key_path, config->paths.identity_key, sizeof(tile->bundle.identity_key_path) );
455 0 : fd_cstr_ncpy( tile->bundle.key_log_path, config->development.bundle.ssl_key_log_file, sizeof(tile->bundle.key_log_path) );
456 0 : tile->bundle.buf_sz = config->development.bundle.buffer_size_kib<<10;
457 0 : tile->bundle.out_depth = config->tiles.verify.receive_buffer_size;
458 0 : tile->bundle.ssl_heap_sz = config->development.bundle.ssl_heap_size_mib<<20;
459 0 : tile->bundle.keepalive_interval_nanos = config->tiles.bundle.keepalive_interval_millis * (ulong)1e6;
460 0 : tile->bundle.tls_cert_verify = !!config->tiles.bundle.tls_cert_verify;
461 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "verify" ) ) ) {
462 0 : tile->verify.tcache_depth = config->tiles.verify.signature_cache_size;
463 :
464 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "dedup" ) ) ) {
465 0 : tile->dedup.tcache_depth = config->tiles.dedup.signature_cache_size;
466 :
467 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "resolh" ) ) ) {
468 :
469 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "pack" ) ) ) {
470 0 : tile->pack.max_pending_transactions = config->tiles.pack.max_pending_transactions;
471 0 : tile->pack.execle_tile_count = config->frankendancer.layout.bank_tile_count;
472 0 : tile->pack.larger_max_cost_per_block = config->development.bench.larger_max_cost_per_block;
473 0 : tile->pack.larger_shred_limits_per_block = config->development.bench.larger_shred_limits_per_block;
474 0 : tile->pack.use_consumed_cus = config->tiles.pack.use_consumed_cus;
475 0 : tile->pack.schedule_strategy = config->tiles.pack.schedule_strategy_enum;
476 0 : tile->pack.acct_blocklist_cnt = config->tiles.pack.account_blocklist_cnt;
477 :
478 0 : for( ulong i=0UL; i<tile->pack.acct_blocklist_cnt; i++ ) {
479 0 : if( FD_UNLIKELY( NULL==fd_base58_decode_32( config->tiles.pack.account_blocklist[i], tile->pack.acct_blocklist[i].uc ) ) ) {
480 0 : FD_LOG_ERR(( "could not parse account %s at index %lu in [tiles.pack.account_blocklist]", config->tiles.pack.account_blocklist[i], i ));
481 0 : }
482 0 : }
483 :
484 0 : if( FD_UNLIKELY( config->tiles.bundle.enabled ) ) {
485 0 : #define PARSE_PUBKEY( _tile, f ) \
486 0 : if( FD_UNLIKELY( !fd_base58_decode_32( config->tiles.bundle.f, tile->_tile.bundle.f ) ) ) \
487 0 : FD_LOG_ERR(( "[tiles.bundle.enabled] set to true, but failed to parse [tiles.bundle."#f"] %s", config->tiles.bundle.f ));
488 0 : tile->pack.bundle.enabled = 1;
489 0 : PARSE_PUBKEY( pack, tip_distribution_program_addr );
490 0 : PARSE_PUBKEY( pack, tip_payment_program_addr );
491 0 : PARSE_PUBKEY( pack, tip_distribution_authority );
492 0 : tile->pack.bundle.commission_bps = config->tiles.bundle.commission_bps;
493 0 : fd_cstr_ncpy( tile->pack.bundle.identity_key_path, config->paths.identity_key, sizeof(tile->pack.bundle.identity_key_path) );
494 0 : fd_cstr_ncpy( tile->pack.bundle.vote_account_path, config->paths.vote_account, sizeof(tile->pack.bundle.vote_account_path) );
495 0 : } else {
496 0 : fd_memset( &tile->pack.bundle, '\0', sizeof(tile->pack.bundle) );
497 0 : }
498 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "bank" ) ) ) {
499 :
500 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "pohh" ) ) ) {
501 0 : fd_cstr_ncpy( tile->pohh.identity_key_path, config->paths.identity_key, sizeof(tile->pohh.identity_key_path) );
502 :
503 0 : tile->pohh.plugins_enabled = plugins_enabled;
504 0 : tile->pohh.execle_cnt = config->frankendancer.layout.bank_tile_count;
505 0 : tile->pohh.lagged_consecutive_leader_start = config->tiles.pohh.lagged_consecutive_leader_start;
506 :
507 0 : if( FD_UNLIKELY( config->tiles.bundle.enabled ) ) {
508 0 : tile->pohh.bundle.enabled = 1;
509 0 : PARSE_PUBKEY( pohh, tip_distribution_program_addr );
510 0 : PARSE_PUBKEY( pohh, tip_payment_program_addr );
511 0 : fd_cstr_ncpy( tile->pohh.bundle.vote_account_path, config->paths.vote_account, sizeof(tile->pohh.bundle.vote_account_path) );
512 0 : #undef PARSE_PUBKEY
513 0 : } else {
514 0 : fd_memset( &tile->pohh.bundle, '\0', sizeof(tile->pohh.bundle) );
515 0 : }
516 :
517 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "shred" ) ) ) {
518 0 : fd_cstr_ncpy( tile->shred.identity_key_path, config->paths.identity_key, sizeof(tile->shred.identity_key_path) );
519 :
520 0 : tile->shred.depth = config->topo.links[ tile->out_link_id[ 0 ] ].depth;
521 0 : tile->shred.fec_resolver_depth = config->tiles.shred.max_pending_shred_sets;
522 0 : tile->shred.expected_shred_version = config->consensus.expected_shred_version;
523 0 : tile->shred.shred_listen_port = config->tiles.shred.shred_listen_port;
524 0 : tile->shred.larger_shred_limits_per_block = config->development.bench.larger_shred_limits_per_block;
525 0 : for( ulong i=0UL; i<config->tiles.shred.additional_shred_destinations_retransmit_cnt; i++ ) {
526 0 : parse_ip_port( "tiles.shred.additional_shred_destinations_retransmit",
527 0 : config->tiles.shred.additional_shred_destinations_retransmit[ i ],
528 0 : &tile->shred.adtl_dests_retransmit[ i ] );
529 0 : }
530 0 : tile->shred.adtl_dests_retransmit_cnt = config->tiles.shred.additional_shred_destinations_retransmit_cnt;
531 0 : for( ulong i=0UL; i<config->tiles.shred.additional_shred_destinations_leader_cnt; i++ ) {
532 0 : parse_ip_port( "tiles.shred.additional_shred_destinations_leader",
533 0 : config->tiles.shred.additional_shred_destinations_leader[ i ],
534 0 : &tile->shred.adtl_dests_leader[ i ] );
535 0 : }
536 0 : tile->shred.adtl_dests_leader_cnt = config->tiles.shred.additional_shred_destinations_leader_cnt;
537 :
538 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "store" ) ) ) {
539 0 : tile->store.disable_blockstore_from_slot = config->development.bench.disable_blockstore_from_slot;
540 :
541 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "sign" ) ) ) {
542 0 : fd_cstr_ncpy( tile->sign.identity_key_path, config->paths.identity_key, sizeof(tile->sign.identity_key_path) );
543 :
544 : /* Frankendancer does not use authorized voters in the sign tile. */
545 0 : tile->sign.authorized_voter_paths_cnt = 0UL;
546 :
547 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "metric" ) ) ) {
548 0 : if( FD_UNLIKELY( !fd_cstr_to_ip4_addr( config->tiles.metric.prometheus_listen_address, &tile->metric.prometheus_listen_addr ) ) )
549 0 : FD_LOG_ERR(( "failed to parse prometheus listen address `%s`", config->tiles.metric.prometheus_listen_address ));
550 0 : tile->metric.prometheus_listen_port = config->tiles.metric.prometheus_listen_port;
551 :
552 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "diag" ) ) ) {
553 :
554 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "guih" ) ) ) {
555 0 : if( FD_UNLIKELY( !fd_cstr_to_ip4_addr( config->tiles.gui.gui_listen_address, &tile->gui.listen_addr ) ) )
556 0 : FD_LOG_ERR(( "failed to parse gui listen address `%s`", config->tiles.gui.gui_listen_address ));
557 0 : tile->gui.listen_port = config->tiles.gui.gui_listen_port;
558 0 : tile->gui.is_voting = strcmp( config->paths.vote_account, "" );
559 0 : fd_cstr_ncpy( tile->gui.cluster, config->cluster, sizeof(tile->gui.cluster) );
560 0 : fd_cstr_ncpy( tile->gui.identity_key_path, config->paths.identity_key, sizeof(tile->gui.identity_key_path) );
561 0 : fd_cstr_ncpy( tile->gui.vote_key_path, config->paths.vote_account, sizeof(tile->gui.vote_key_path) );
562 0 : tile->gui.max_http_connections = config->tiles.gui.max_http_connections;
563 0 : tile->gui.max_websocket_connections = config->tiles.gui.max_websocket_connections;
564 0 : tile->gui.max_http_request_length = config->tiles.gui.max_http_request_length;
565 0 : tile->gui.send_buffer_size_mb = config->tiles.gui.send_buffer_size_mb;
566 0 : tile->gui.schedule_strategy = config->tiles.pack.schedule_strategy_enum;
567 0 : tile->gui.websocket_compression = config->development.gui.websocket_compression;
568 0 : tile->gui.accdb_obj_id = ULONG_MAX;
569 :
570 0 : } else if( FD_UNLIKELY( !strcmp( tile->name, "plugin" ) ) ) {
571 :
572 0 : } else {
573 0 : FD_LOG_ERR(( "unknown tile name %lu `%s`", tile->id, tile->name ));
574 0 : }
575 0 : }
|