LCOV - code coverage report
Current view: top level - app/firedancer - main.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 14 31 45.2 %
Date: 2026-01-23 05:02:40 Functions: 1 2 50.0 %

          Line data    Source code
       1             : #include "topology.h"
       2             : #include "config.h"
       3             : #include "../shared/boot/fd_boot.h"
       4             : #include "../shared/commands/configure/configure.h"
       5             : 
       6             : char const * FD_APP_NAME    = "Firedancer";
       7             : char const * FD_BINARY_NAME = "firedancer";
       8             : 
       9             : extern fd_topo_obj_callbacks_t fd_obj_cb_mcache;
      10             : extern fd_topo_obj_callbacks_t fd_obj_cb_dcache;
      11             : extern fd_topo_obj_callbacks_t fd_obj_cb_fseq;
      12             : extern fd_topo_obj_callbacks_t fd_obj_cb_metrics;
      13             : extern fd_topo_obj_callbacks_t fd_obj_cb_dbl_buf;
      14             : extern fd_topo_obj_callbacks_t fd_obj_cb_neigh4_hmap;
      15             : extern fd_topo_obj_callbacks_t fd_obj_cb_fib4;
      16             : extern fd_topo_obj_callbacks_t fd_obj_cb_keyswitch;
      17             : extern fd_topo_obj_callbacks_t fd_obj_cb_tile;
      18             : extern fd_topo_obj_callbacks_t fd_obj_cb_store;
      19             : extern fd_topo_obj_callbacks_t fd_obj_cb_fec_sets;
      20             : extern fd_topo_obj_callbacks_t fd_obj_cb_txncache;
      21             : extern fd_topo_obj_callbacks_t fd_obj_cb_banks;
      22             : extern fd_topo_obj_callbacks_t fd_obj_cb_banks_locks;
      23             : extern fd_topo_obj_callbacks_t fd_obj_cb_funk;
      24             : extern fd_topo_obj_callbacks_t fd_obj_cb_acc_pool;
      25             : 
      26             : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_meta;
      27             : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_meta_ele;
      28             : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_data;
      29             : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_req_pool;
      30             : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_rq;
      31             : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_cq;
      32             : 
      33             : fd_topo_obj_callbacks_t * CALLBACKS[] = {
      34             :   &fd_obj_cb_mcache,
      35             :   &fd_obj_cb_dcache,
      36             :   &fd_obj_cb_fseq,
      37             :   &fd_obj_cb_metrics,
      38             :   &fd_obj_cb_dbl_buf,
      39             :   &fd_obj_cb_neigh4_hmap,
      40             :   &fd_obj_cb_fib4,
      41             :   &fd_obj_cb_keyswitch,
      42             :   &fd_obj_cb_tile,
      43             :   &fd_obj_cb_store,
      44             :   &fd_obj_cb_fec_sets,
      45             :   &fd_obj_cb_txncache,
      46             :   &fd_obj_cb_banks,
      47             :   &fd_obj_cb_banks_locks,
      48             :   &fd_obj_cb_funk,
      49             :   &fd_obj_cb_acc_pool,
      50             :   &fd_obj_cb_vinyl_meta,
      51             :   &fd_obj_cb_vinyl_meta_ele,
      52             :   &fd_obj_cb_vinyl_data,
      53             :   &fd_obj_cb_acc_pool,
      54             :   &fd_obj_cb_vinyl_req_pool,
      55             :   &fd_obj_cb_vinyl_rq,
      56             :   &fd_obj_cb_vinyl_cq,
      57             :   NULL,
      58             : };
      59             : 
      60             : extern configure_stage_t fd_cfg_stage_accdb;
      61             : 
      62             : configure_stage_t * STAGES[] = {
      63             :   &fd_cfg_stage_hugetlbfs,
      64             :   &fd_cfg_stage_sysctl,
      65             :   &fd_cfg_stage_bonding,
      66             :   &fd_cfg_stage_ethtool_channels,
      67             :   &fd_cfg_stage_ethtool_offloads,
      68             :   &fd_cfg_stage_ethtool_loopback,
      69             :   &fd_cfg_stage_snapshots,
      70             :   &fd_cfg_stage_accdb,
      71             :   NULL,
      72             : };
      73             : 
      74             : 
      75             : extern fd_topo_run_tile_t fd_tile_net;
      76             : extern fd_topo_run_tile_t fd_tile_netlnk;
      77             : extern fd_topo_run_tile_t fd_tile_sock;
      78             : extern fd_topo_run_tile_t fd_tile_quic;
      79             : extern fd_topo_run_tile_t fd_tile_verify;
      80             : extern fd_topo_run_tile_t fd_tile_dedup;
      81             : extern fd_topo_run_tile_t fd_tile_resolv;
      82             : extern fd_topo_run_tile_t fd_tile_pack;
      83             : extern fd_topo_run_tile_t fd_tile_bank;
      84             : extern fd_topo_run_tile_t fd_tile_poh;
      85             : extern fd_topo_run_tile_t fd_tile_shred;
      86             : extern fd_topo_run_tile_t fd_tile_sign;
      87             : extern fd_topo_run_tile_t fd_tile_metric;
      88             : extern fd_topo_run_tile_t fd_tile_diag;
      89             : extern fd_topo_run_tile_t fd_tile_gui;
      90             : extern fd_topo_run_tile_t fd_tile_rpc;
      91             : extern fd_topo_run_tile_t fd_tile_plugin;
      92             : extern fd_topo_run_tile_t fd_tile_bundle;
      93             : #if FD_HAS_BZIP2
      94             : extern fd_topo_run_tile_t fd_tile_genesi;
      95             : #endif
      96             : extern fd_topo_run_tile_t fd_tile_ipecho;
      97             : 
      98             : extern fd_topo_run_tile_t fd_tile_gossvf;
      99             : extern fd_topo_run_tile_t fd_tile_gossip;
     100             : extern fd_topo_run_tile_t fd_tile_repair;
     101             : extern fd_topo_run_tile_t fd_tile_replay;
     102             : extern fd_topo_run_tile_t fd_tile_execor;
     103             : extern fd_topo_run_tile_t fd_tile_send;
     104             : extern fd_topo_run_tile_t fd_tile_tower;
     105             : extern fd_topo_run_tile_t fd_tile_vinyl;
     106             : extern fd_topo_run_tile_t fd_tile_solcap;
     107             : 
     108             : extern fd_topo_run_tile_t fd_tile_snapct;
     109             : extern fd_topo_run_tile_t fd_tile_snapld;
     110             : extern fd_topo_run_tile_t fd_tile_snapdc;
     111             : extern fd_topo_run_tile_t fd_tile_snapin;
     112             : extern fd_topo_run_tile_t fd_tile_snapwm;
     113             : extern fd_topo_run_tile_t fd_tile_snapwh;
     114             : extern fd_topo_run_tile_t fd_tile_snapwr;
     115             : extern fd_topo_run_tile_t fd_tile_snapla;
     116             : extern fd_topo_run_tile_t fd_tile_snapls;
     117             : extern fd_topo_run_tile_t fd_tile_snaplh;
     118             : extern fd_topo_run_tile_t fd_tile_snaplv;
     119             : 
     120             : fd_topo_run_tile_t * TILES[] = {
     121             :   &fd_tile_net,
     122             :   &fd_tile_netlnk,
     123             :   &fd_tile_sock,
     124             :   &fd_tile_quic,
     125             :   &fd_tile_verify,
     126             :   &fd_tile_dedup,
     127             :   &fd_tile_resolv,
     128             :   &fd_tile_pack,
     129             :   &fd_tile_bank,
     130             :   &fd_tile_shred,
     131             :   &fd_tile_sign,
     132             :   &fd_tile_metric,
     133             :   &fd_tile_diag,
     134             :   &fd_tile_gui,
     135             :   &fd_tile_rpc,
     136             :   &fd_tile_plugin,
     137             :   &fd_tile_bundle,
     138             :   &fd_tile_gossvf,
     139             :   &fd_tile_gossip,
     140             :   &fd_tile_repair,
     141             :   &fd_tile_replay,
     142             :   &fd_tile_execor,
     143             :   &fd_tile_poh,
     144             :   &fd_tile_send,
     145             :   &fd_tile_tower,
     146             :   &fd_tile_snapct,
     147             :   &fd_tile_snapld,
     148             :   &fd_tile_snapdc,
     149             :   &fd_tile_snapin,
     150             :   &fd_tile_snapwm,
     151             :   &fd_tile_snapwh,
     152             :   &fd_tile_snapwr,
     153             :   &fd_tile_snapla,
     154             :   &fd_tile_snapls,
     155             :   &fd_tile_snaplh,
     156             :   &fd_tile_snaplv,
     157             : # if FD_HAS_BZIP2
     158             :   &fd_tile_genesi,
     159             : # endif
     160             :   &fd_tile_ipecho,
     161             :   &fd_tile_vinyl,
     162             :   &fd_tile_solcap,
     163             :   NULL,
     164             : };
     165             : 
     166             : extern action_t fd_action_run;
     167             : extern action_t fd_action_run1;
     168             : extern action_t fd_action_configure;
     169             : extern action_t fd_action_monitor;
     170             : extern action_t fd_action_keys;
     171             : extern action_t fd_action_ready;
     172             : extern action_t fd_action_mem;
     173             : extern action_t fd_action_netconf;
     174             : extern action_t fd_action_set_identity;
     175             : extern action_t fd_action_help;
     176             : extern action_t fd_action_metrics;
     177             : extern action_t fd_action_version;
     178             : extern action_t fd_action_shred_version;
     179             : extern action_t fd_action_watch;
     180             : 
     181             : action_t * ACTIONS[] = {
     182             :   &fd_action_run,
     183             :   &fd_action_run1,
     184             :   &fd_action_configure,
     185             :   &fd_action_monitor,
     186             :   &fd_action_keys,
     187             :   &fd_action_ready,
     188             :   &fd_action_mem,
     189             :   &fd_action_netconf,
     190             :   &fd_action_set_identity,
     191             :   &fd_action_help,
     192             :   &fd_action_metrics,
     193             :   &fd_action_version,
     194             :   &fd_action_shred_version,
     195             :   &fd_action_watch,
     196             :   NULL,
     197             : };
     198             : 
     199             : int
     200             : main( int     argc,
     201           9 :       char ** argv ) {
     202           9 :   fd_config_file_t _default = fd_config_file_default();
     203           9 :   fd_config_file_t testnet = fd_config_file_testnet();
     204           9 :   fd_config_file_t devnet = fd_config_file_devnet();
     205           9 :   fd_config_file_t mainnet = fd_config_file_mainnet();
     206             : 
     207           9 :   fd_config_file_t * configs[] = {
     208           9 :     &_default,
     209           9 :     &testnet,
     210           9 :     &devnet,
     211           9 :     &mainnet,
     212           9 :     NULL
     213           9 :   };
     214             : 
     215           9 :   return fd_main( argc, argv, 1, configs, fd_topo_initialize );
     216           9 : }
     217             : 
     218             : /* Kind of a hack for now, we sometimes want to view bench generation
     219             :    in the monitor binary, but it's not part of the production binary. */
     220             : 
     221             : void
     222             : add_bench_topo( fd_topo_t  * topo,
     223             :                 char const * affinity,
     224             :                 ulong        benchg_tile_cnt,
     225             :                 ulong        benchs_tile_cnt,
     226             :                 ulong        accounts_cnt,
     227             :                 int          transaction_mode,
     228             :                 float        contending_fraction,
     229             :                 float        cu_price_spread,
     230             :                 ulong        conn_cnt,
     231             :                 ushort       send_to_port,
     232             :                 uint         send_to_ip_addr,
     233             :                 ushort       rpc_port,
     234             :                 uint         rpc_ip_addr,
     235             :                 int          no_quic,
     236           0 :                 int          reserve_agave_cores ) {
     237           0 :   (void)topo;
     238           0 :   (void)affinity;
     239           0 :   (void)benchg_tile_cnt;
     240           0 :   (void)benchs_tile_cnt;
     241           0 :   (void)accounts_cnt;
     242           0 :   (void)transaction_mode;
     243           0 :   (void)contending_fraction;
     244           0 :   (void)cu_price_spread;
     245           0 :   (void)conn_cnt;
     246           0 :   (void)send_to_port;
     247           0 :   (void)send_to_ip_addr;
     248           0 :   (void)rpc_port;
     249           0 :   (void)rpc_ip_addr;
     250           0 :   (void)no_quic;
     251           0 :   (void)reserve_agave_cores;
     252           0 : }

Generated by: LCOV version 1.14