2727#include "../../../discof/tower/fd_tower_tile.h"
2828#include "../../../discof/replay/fd_exec.h"
2929#include "../../../ballet/lthash/fd_lthash.h"
30- #include "../../../flamenco/runtime/context /fd_capture_ctx.h"
30+ #include "../../../flamenco/capture /fd_capture_ctx.h"
3131#include "../../../disco/pack/fd_pack_cost.h"
3232#include "../../../flamenco/progcache/fd_progcache_admin.h"
3333
@@ -102,6 +102,14 @@ backtest_topo( config_t * config ) {
102102 #define FOR (cnt ) for( ulong i=0UL; i<cnt; i++ )
103103 FOR (exec_tile_cnt ) fd_topob_tile ( topo , "exec ", " exec ", " metric_in ", cpu_idx++, 0, 0 );
104104
105+ /**********************************************************************/
106+ /* Add the capture tile to topo */
107+ /**********************************************************************/
108+ if ( solcap_enabled ) {
109+ fd_topob_wksp ( topo , "solcap" );
110+ fd_topob_tile ( topo , "solcap" , "solcap" , "metric_in" , cpu_idx ++ , 0 , 0 );
111+ }
112+
105113 /**********************************************************************/
106114 /* Add the snapshot tiles to topo */
107115 /**********************************************************************/
@@ -313,15 +321,7 @@ backtest_topo( config_t * config ) {
313321 /**********************************************************************/
314322 fd_topob_wksp ( topo , "exec_replay" );
315323
316- /* If solcap is enabled, we need to overload this link to also send
317- solcap account updates to the replay tile. We can't use a separate
318- link for this without introducing a race. This will get removed with solcap V2. */
319- if ( FD_UNLIKELY ( solcap_enabled ) ) {
320- /* TODO: remove this with solcap V2 */
321- FOR (exec_tile_cnt ) fd_topob_link ( topo , "exec_replay ", " exec_replay ", 1024UL, FD_CAPTURE_CTX_ACCOUNT_UPDATE_MSG_FOOTPRINT, 1UL );
322- } else {
323- FOR (exec_tile_cnt ) fd_topob_link ( topo , "exec_replay ", " exec_replay ", 16384UL, sizeof(fd_exec_task_done_msg_t), 1UL );
324- }
324+ FOR (exec_tile_cnt ) fd_topob_link ( topo , "exec_replay ", " exec_replay ", 16384UL, sizeof(fd_exec_task_done_msg_t), 1UL );
325325
326326 FOR (exec_tile_cnt ) fd_topob_tile_out ( topo , "exec" , i , "exec_replay" , i );
327327 FOR (exec_tile_cnt ) fd_topob_tile_in ( topo , "replay ", 0UL, " metric_in ", " exec_replay ", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
@@ -330,6 +330,18 @@ backtest_topo( config_t * config ) {
330330 /* Setup the shared objs used by replay and exec tiles */
331331 /**********************************************************************/
332332
333+ if ( FD_UNLIKELY ( solcap_enabled ) ) {
334+ /* 32 sections of SOLCAP_WRITE_ACCOUNT_DATA_MTU bytes each ≈ 4MB.
335+ This is done to ideally avoid cache thrashing and allow for all
336+ the links to sit on L3 cache. */
337+ fd_topob_link ( topo , "cap_repl" , "solcap" , 32UL , SOLCAP_WRITE_ACCOUNT_DATA_MTU , 1UL );
338+ fd_topob_tile_out ( topo , "replay" , 0UL , "cap_repl" , 0UL );
339+ fd_topob_tile_in ( topo , "solcap" , 0UL , "metric_in" , "cap_repl" , 0UL , FD_TOPOB_RELIABLE , FD_TOPOB_POLLED );
340+ FOR (exec_tile_cnt ) fd_topob_link ( topo , "cap_exec ", " solcap ", 32UL, SOLCAP_WRITE_ACCOUNT_DATA_MTU, 1UL );
341+ FOR (exec_tile_cnt ) fd_topob_tile_out ( topo , "exec" , i , "cap_exec" , i );
342+ FOR (exec_tile_cnt ) fd_topob_tile_in ( topo , "solcap ", 0UL, " metric_in ", " cap_exec ", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
343+ }
344+
333345 fd_topob_wksp ( topo , "store" );
334346 fd_topo_obj_t * store_obj = setup_topo_store ( topo , "store" , config -> firedancer .store .max_completed_shred_sets , 1 );
335347 fd_topob_tile_uses ( topo , backt_tile , store_obj , FD_SHMEM_JOIN_MODE_READ_WRITE );
0 commit comments