LCOV - code coverage report
Current view: top level - app/firedancer - main.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 14 30 46.7 %
Date: 2026-08-13 04:56:22 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             : #include "../shared/fd_action.h"
       6             : 
       7             : char const * FD_APP_NAME    = "Firedancer";
       8             : char const * FD_BINARY_NAME = "firedancer";
       9             : 
      10             : extern fd_topo_obj_callbacks_t fd_obj_cb_mcache;
      11             : extern fd_topo_obj_callbacks_t fd_obj_cb_dcache;
      12             : extern fd_topo_obj_callbacks_t fd_obj_cb_fseq;
      13             : extern fd_topo_obj_callbacks_t fd_obj_cb_metrics;
      14             : extern fd_topo_obj_callbacks_t fd_obj_cb_netdev_tbl;
      15             : extern fd_topo_obj_callbacks_t fd_obj_cb_neigh4_hmap;
      16             : extern fd_topo_obj_callbacks_t fd_obj_cb_keyswitch;
      17             : extern fd_topo_obj_callbacks_t fd_obj_cb_node_info;
      18             : extern fd_topo_obj_callbacks_t fd_obj_cb_tile;
      19             : extern fd_topo_obj_callbacks_t fd_obj_cb_store;
      20             : extern fd_topo_obj_callbacks_t fd_obj_cb_fec_sets;
      21             : extern fd_topo_obj_callbacks_t fd_obj_cb_txncache;
      22             : extern fd_topo_obj_callbacks_t fd_obj_cb_accdb;
      23             : extern fd_topo_obj_callbacks_t fd_obj_cb_backup;
      24             : extern fd_topo_obj_callbacks_t fd_obj_cb_banks;
      25             : extern fd_topo_obj_callbacks_t fd_obj_cb_progcache;
      26             : extern fd_topo_obj_callbacks_t fd_obj_cb_rnonce_ss;
      27             : extern fd_topo_obj_callbacks_t fd_obj_cb_adminctl;
      28             : 
      29             : fd_topo_obj_callbacks_t * CALLBACKS[] = {
      30             :   &fd_obj_cb_mcache,
      31             :   &fd_obj_cb_dcache,
      32             :   &fd_obj_cb_fseq,
      33             :   &fd_obj_cb_metrics,
      34             :   &fd_obj_cb_netdev_tbl,
      35             :   &fd_obj_cb_neigh4_hmap,
      36             :   &fd_obj_cb_keyswitch,
      37             :   &fd_obj_cb_node_info,
      38             :   &fd_obj_cb_tile,
      39             :   &fd_obj_cb_store,
      40             :   &fd_obj_cb_fec_sets,
      41             :   &fd_obj_cb_txncache,
      42             :   &fd_obj_cb_accdb,
      43             :   &fd_obj_cb_backup,
      44             :   &fd_obj_cb_banks,
      45             :   &fd_obj_cb_progcache,
      46             :   &fd_obj_cb_rnonce_ss,
      47             :   &fd_obj_cb_adminctl,
      48             :   NULL,
      49             : };
      50             : 
      51             : configure_stage_t * STAGES[] = {
      52             :   &fd_cfg_stage_hugetlbfs,
      53             :   &fd_cfg_stage_sysctl,
      54             :   &fd_cfg_stage_bonding,
      55             :   &fd_cfg_stage_ethtool_channels,
      56             :   &fd_cfg_stage_ethtool_offloads,
      57             :   &fd_cfg_stage_ethtool_loopback,
      58             :   &fd_cfg_stage_irq_balance,
      59             :   &fd_cfg_stage_irq_affinity,
      60             :   &fd_cfg_stage_sysfs_poll,
      61             :   &fd_cfg_stage_kworkers,
      62             :   &fd_cfg_stage_cpuset,
      63             :   &fd_cfg_stage_nohz_full,
      64             :   &fd_cfg_stage_rcu_nocbs,
      65             :   &fd_cfg_stage_console,
      66             :   &fd_cfg_stage_snapshots,
      67             :   NULL,
      68             : };
      69             : 
      70             : FD_STATIC_ASSERT( sizeof(STAGES)/sizeof(STAGES[0])<=CONFIGURE_STAGE_COUNT, stage_array_larger_than_configure_stage_count );
      71             : 
      72             : 
      73             : extern fd_topo_run_tile_t fd_tile_net;
      74             : extern fd_topo_run_tile_t fd_tile_netlnk;
      75             : extern fd_topo_run_tile_t fd_tile_sock;
      76             : extern fd_topo_run_tile_t fd_tile_quic;
      77             : extern fd_topo_run_tile_t fd_tile_verify;
      78             : extern fd_topo_run_tile_t fd_tile_dedup;
      79             : extern fd_topo_run_tile_t fd_tile_resolv;
      80             : extern fd_topo_run_tile_t fd_tile_pack;
      81             : extern fd_topo_run_tile_t fd_tile_execle;
      82             : extern fd_topo_run_tile_t fd_tile_poh;
      83             : extern fd_topo_run_tile_t fd_tile_shred;
      84             : extern fd_topo_run_tile_t fd_tile_sign;
      85             : extern fd_topo_run_tile_t fd_tile_metric;
      86             : extern fd_topo_run_tile_t fd_tile_event;
      87             : extern fd_topo_run_tile_t fd_tile_diag;
      88             : extern fd_topo_run_tile_t fd_tile_gui;
      89             : extern fd_topo_run_tile_t fd_tile_rpc;
      90             : extern fd_topo_run_tile_t fd_tile_bundle;
      91             : extern fd_topo_run_tile_t fd_tile_genesi;
      92             : extern fd_topo_run_tile_t fd_tile_ipecho;
      93             : extern fd_topo_run_tile_t fd_tile_admin;
      94             : 
      95             : extern fd_topo_run_tile_t fd_tile_gossvf;
      96             : extern fd_topo_run_tile_t fd_tile_gossip;
      97             : extern fd_topo_run_tile_t fd_tile_repair;
      98             : extern fd_topo_run_tile_t fd_tile_rserve;
      99             : extern fd_topo_run_tile_t fd_tile_replay;
     100             : extern fd_topo_run_tile_t fd_tile_execrp;
     101             : extern fd_topo_run_tile_t fd_tile_txsend;
     102             : extern fd_topo_run_tile_t fd_tile_tower;
     103             : extern fd_topo_run_tile_t fd_tile_accdb;
     104             : extern fd_topo_run_tile_t fd_tile_solcap;
     105             : 
     106             : extern fd_topo_run_tile_t fd_tile_snapct;
     107             : extern fd_topo_run_tile_t fd_tile_snapld;
     108             : extern fd_topo_run_tile_t fd_tile_snapdc;
     109             : extern fd_topo_run_tile_t fd_tile_snapin;
     110             : extern fd_topo_run_tile_t fd_tile_snapwr;
     111             : extern fd_topo_run_tile_t fd_tile_snapmk;
     112             : extern fd_topo_run_tile_t fd_tile_snapzp;
     113             : extern fd_topo_run_tile_t fd_tile_snaprd;
     114             : extern fd_topo_run_tile_t fd_tile_snapsv;
     115             : 
     116             : fd_topo_run_tile_t * TILES[] = {
     117             :   &fd_tile_net,
     118             :   &fd_tile_netlnk,
     119             :   &fd_tile_sock,
     120             :   &fd_tile_quic,
     121             :   &fd_tile_verify,
     122             :   &fd_tile_dedup,
     123             :   &fd_tile_resolv,
     124             :   &fd_tile_pack,
     125             :   &fd_tile_execle,
     126             :   &fd_tile_shred,
     127             :   &fd_tile_sign,
     128             :   &fd_tile_metric,
     129             :   &fd_tile_event,
     130             :   &fd_tile_diag,
     131             :   &fd_tile_gui,
     132             :   &fd_tile_rpc,
     133             :   &fd_tile_bundle,
     134             :   &fd_tile_gossvf,
     135             :   &fd_tile_gossip,
     136             :   &fd_tile_repair,
     137             :   &fd_tile_rserve,
     138             :   &fd_tile_replay,
     139             :   &fd_tile_execrp,
     140             :   &fd_tile_poh,
     141             :   &fd_tile_txsend,
     142             :   &fd_tile_tower,
     143             :   &fd_tile_accdb,
     144             :   &fd_tile_snapct,
     145             :   &fd_tile_snapld,
     146             :   &fd_tile_snapdc,
     147             :   &fd_tile_snapin,
     148             :   &fd_tile_snapwr,
     149             :   &fd_tile_genesi,
     150             :   &fd_tile_ipecho,
     151             :   &fd_tile_admin,
     152             :   &fd_tile_solcap,
     153             :   &fd_tile_snapmk,
     154             :   &fd_tile_snapzp,
     155             :   &fd_tile_snaprd,
     156             :   &fd_tile_snapsv,
     157             :   NULL,
     158             : };
     159             : 
     160             : extern action_t fd_action_run;
     161             : extern action_t fd_action_run1;
     162             : extern action_t fd_action_configure;
     163             : extern action_t fd_action_monitor;
     164             : extern action_t fd_action_keys;
     165             : extern action_t fd_action_ready;
     166             : extern action_t fd_action_mem;
     167             : extern action_t fd_action_netconf;
     168             : extern action_t fd_action_help;
     169             : extern action_t fd_action_metrics;
     170             : extern action_t fd_action_version;
     171             : extern action_t fd_action_shred_version;
     172             : extern action_t fd_action_watch;
     173             : extern action_t fd_action_add_authorized_voter;
     174             : extern action_t fd_action_remove_all_authorized_voters;
     175             : extern action_t fd_action_set_identity;
     176             : extern action_t fd_action_get_identity;
     177             : extern action_t fd_action_ps;
     178             : extern action_t fd_action_monitor_gossip;
     179             : extern action_t fd_action_snapshot_create;
     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_help,
     191             :   &fd_action_metrics,
     192             :   &fd_action_version,
     193             :   &fd_action_shred_version,
     194             :   &fd_action_add_authorized_voter,
     195             :   &fd_action_remove_all_authorized_voters,
     196             :   &fd_action_watch,
     197             :   &fd_action_monitor_gossip,
     198             :   &fd_action_set_identity,
     199             :   &fd_action_get_identity,
     200             :   &fd_action_ps,
     201             :   &fd_action_snapshot_create,
     202             :   NULL,
     203             : };
     204             : 
     205             : int
     206             : main( int     argc,
     207          24 :       char ** argv ) {
     208          24 :   fd_config_file_t _default = fd_config_file_default();
     209          24 :   fd_config_file_t testnet = fd_config_file_testnet();
     210          24 :   fd_config_file_t devnet = fd_config_file_devnet();
     211          24 :   fd_config_file_t mainnet = fd_config_file_mainnet();
     212             : 
     213          24 :   fd_config_file_t * configs[] = {
     214          24 :     &_default,
     215          24 :     &testnet,
     216          24 :     &devnet,
     217          24 :     &mainnet,
     218          24 :     NULL
     219          24 :   };
     220             : 
     221          24 :   return fd_main( argc, argv, 1, configs, fd_topo_initialize );
     222          24 : }
     223             : 
     224             : /* Kind of a hack for now, we sometimes want to view bench generation
     225             :    in the monitor binary, but it's not part of the production binary. */
     226             : 
     227             : void
     228             : add_bench_topo( fd_topo_t  * topo,
     229             :                 char const * affinity,
     230             :                 ulong        benchg_tile_cnt,
     231             :                 ulong        benchs_tile_cnt,
     232             :                 ulong        accounts_cnt,
     233             :                 int          transaction_mode,
     234             :                 float        contending_fraction,
     235             :                 float        cu_price_spread,
     236             :                 ulong        conn_cnt,
     237             :                 ushort       send_to_port,
     238             :                 uint         send_to_ip_addr,
     239             :                 ushort       rpc_port,
     240             :                 uint         rpc_ip_addr,
     241           0 :                 int          reserve_agave_cores ) {
     242           0 :   (void)topo;
     243           0 :   (void)affinity;
     244           0 :   (void)benchg_tile_cnt;
     245           0 :   (void)benchs_tile_cnt;
     246           0 :   (void)accounts_cnt;
     247           0 :   (void)transaction_mode;
     248           0 :   (void)contending_fraction;
     249           0 :   (void)cu_price_spread;
     250           0 :   (void)conn_cnt;
     251           0 :   (void)send_to_port;
     252           0 :   (void)send_to_ip_addr;
     253           0 :   (void)rpc_port;
     254           0 :   (void)rpc_ip_addr;
     255           0 :   (void)reserve_agave_cores;
     256           0 : }

Generated by: LCOV version 1.14