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-06-29 05:51:35 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_fib4;
      17             : extern fd_topo_obj_callbacks_t fd_obj_cb_keyswitch;
      18             : extern fd_topo_obj_callbacks_t fd_obj_cb_node_info;
      19             : extern fd_topo_obj_callbacks_t fd_obj_cb_tile;
      20             : extern fd_topo_obj_callbacks_t fd_obj_cb_store;
      21             : extern fd_topo_obj_callbacks_t fd_obj_cb_fec_sets;
      22             : extern fd_topo_obj_callbacks_t fd_obj_cb_txncache;
      23             : extern fd_topo_obj_callbacks_t fd_obj_cb_accdb;
      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             : 
      28             : fd_topo_obj_callbacks_t * CALLBACKS[] = {
      29             :   &fd_obj_cb_mcache,
      30             :   &fd_obj_cb_dcache,
      31             :   &fd_obj_cb_fseq,
      32             :   &fd_obj_cb_metrics,
      33             :   &fd_obj_cb_netdev_tbl,
      34             :   &fd_obj_cb_neigh4_hmap,
      35             :   &fd_obj_cb_fib4,
      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_banks,
      44             :   &fd_obj_cb_progcache,
      45             :   &fd_obj_cb_rnonce_ss,
      46             :   NULL,
      47             : };
      48             : 
      49             : configure_stage_t * STAGES[] = {
      50             :   &fd_cfg_stage_hugetlbfs,
      51             :   &fd_cfg_stage_sysctl,
      52             :   &fd_cfg_stage_bonding,
      53             :   &fd_cfg_stage_ethtool_channels,
      54             :   &fd_cfg_stage_ethtool_offloads,
      55             :   &fd_cfg_stage_ethtool_loopback,
      56             :   &fd_cfg_stage_irq_balance,
      57             :   &fd_cfg_stage_irq_affinity,
      58             :   &fd_cfg_stage_snapshots,
      59             :   NULL,
      60             : };
      61             : 
      62             : 
      63             : extern fd_topo_run_tile_t fd_tile_net;
      64             : extern fd_topo_run_tile_t fd_tile_netlnk;
      65             : extern fd_topo_run_tile_t fd_tile_sock;
      66             : extern fd_topo_run_tile_t fd_tile_quic;
      67             : extern fd_topo_run_tile_t fd_tile_verify;
      68             : extern fd_topo_run_tile_t fd_tile_dedup;
      69             : extern fd_topo_run_tile_t fd_tile_resolv;
      70             : extern fd_topo_run_tile_t fd_tile_pack;
      71             : extern fd_topo_run_tile_t fd_tile_execle;
      72             : extern fd_topo_run_tile_t fd_tile_poh;
      73             : extern fd_topo_run_tile_t fd_tile_shred;
      74             : extern fd_topo_run_tile_t fd_tile_sign;
      75             : extern fd_topo_run_tile_t fd_tile_metric;
      76             : extern fd_topo_run_tile_t fd_tile_event;
      77             : extern fd_topo_run_tile_t fd_tile_diag;
      78             : extern fd_topo_run_tile_t fd_tile_gui;
      79             : extern fd_topo_run_tile_t fd_tile_rpc;
      80             : extern fd_topo_run_tile_t fd_tile_bundle;
      81             : extern fd_topo_run_tile_t fd_tile_genesi;
      82             : extern fd_topo_run_tile_t fd_tile_ipecho;
      83             : 
      84             : extern fd_topo_run_tile_t fd_tile_gossvf;
      85             : extern fd_topo_run_tile_t fd_tile_gossip;
      86             : extern fd_topo_run_tile_t fd_tile_repair;
      87             : extern fd_topo_run_tile_t fd_tile_rserve;
      88             : extern fd_topo_run_tile_t fd_tile_replay;
      89             : extern fd_topo_run_tile_t fd_tile_execrp;
      90             : extern fd_topo_run_tile_t fd_tile_txsend;
      91             : extern fd_topo_run_tile_t fd_tile_tower;
      92             : extern fd_topo_run_tile_t fd_tile_accdb;
      93             : extern fd_topo_run_tile_t fd_tile_solcap;
      94             : 
      95             : extern fd_topo_run_tile_t fd_tile_snapct;
      96             : extern fd_topo_run_tile_t fd_tile_snapld;
      97             : extern fd_topo_run_tile_t fd_tile_snapdc;
      98             : extern fd_topo_run_tile_t fd_tile_snapin;
      99             : extern fd_topo_run_tile_t fd_tile_snapwr;
     100             : 
     101             : fd_topo_run_tile_t * TILES[] = {
     102             :   &fd_tile_net,
     103             :   &fd_tile_netlnk,
     104             :   &fd_tile_sock,
     105             :   &fd_tile_quic,
     106             :   &fd_tile_verify,
     107             :   &fd_tile_dedup,
     108             :   &fd_tile_resolv,
     109             :   &fd_tile_pack,
     110             :   &fd_tile_execle,
     111             :   &fd_tile_shred,
     112             :   &fd_tile_sign,
     113             :   &fd_tile_metric,
     114             :   &fd_tile_event,
     115             :   &fd_tile_diag,
     116             :   &fd_tile_gui,
     117             :   &fd_tile_rpc,
     118             :   &fd_tile_bundle,
     119             :   &fd_tile_gossvf,
     120             :   &fd_tile_gossip,
     121             :   &fd_tile_repair,
     122             :   &fd_tile_rserve,
     123             :   &fd_tile_replay,
     124             :   &fd_tile_execrp,
     125             :   &fd_tile_poh,
     126             :   &fd_tile_txsend,
     127             :   &fd_tile_tower,
     128             :   &fd_tile_accdb,
     129             :   &fd_tile_snapct,
     130             :   &fd_tile_snapld,
     131             :   &fd_tile_snapdc,
     132             :   &fd_tile_snapin,
     133             :   &fd_tile_snapwr,
     134             :   &fd_tile_genesi,
     135             :   &fd_tile_ipecho,
     136             :   &fd_tile_solcap,
     137             :   NULL,
     138             : };
     139             : 
     140             : extern action_t fd_action_run;
     141             : extern action_t fd_action_run1;
     142             : extern action_t fd_action_configure;
     143             : extern action_t fd_action_monitor;
     144             : extern action_t fd_action_keys;
     145             : extern action_t fd_action_ready;
     146             : extern action_t fd_action_mem;
     147             : extern action_t fd_action_netconf;
     148             : extern action_t fd_action_help;
     149             : extern action_t fd_action_metrics;
     150             : extern action_t fd_action_version;
     151             : extern action_t fd_action_shred_version;
     152             : extern action_t fd_action_watch;
     153             : extern action_t fd_action_add_authorized_voter;
     154             : extern action_t fd_action_set_identity;
     155             : extern action_t fd_action_monitor_gossip;
     156             : 
     157             : action_t * ACTIONS[] = {
     158             :   &fd_action_run,
     159             :   &fd_action_run1,
     160             :   &fd_action_configure,
     161             :   &fd_action_monitor,
     162             :   &fd_action_keys,
     163             :   &fd_action_ready,
     164             :   &fd_action_mem,
     165             :   &fd_action_netconf,
     166             :   &fd_action_help,
     167             :   &fd_action_metrics,
     168             :   &fd_action_version,
     169             :   &fd_action_shred_version,
     170             :   &fd_action_add_authorized_voter,
     171             :   &fd_action_watch,
     172             :   &fd_action_monitor_gossip,
     173             :   &fd_action_set_identity,
     174             :   NULL,
     175             : };
     176             : 
     177             : int
     178             : main( int     argc,
     179          24 :       char ** argv ) {
     180          24 :   fd_config_file_t _default = fd_config_file_default();
     181          24 :   fd_config_file_t testnet = fd_config_file_testnet();
     182          24 :   fd_config_file_t devnet = fd_config_file_devnet();
     183          24 :   fd_config_file_t mainnet = fd_config_file_mainnet();
     184             : 
     185          24 :   fd_config_file_t * configs[] = {
     186          24 :     &_default,
     187          24 :     &testnet,
     188          24 :     &devnet,
     189          24 :     &mainnet,
     190          24 :     NULL
     191          24 :   };
     192             : 
     193          24 :   return fd_main( argc, argv, 1, configs, fd_topo_initialize );
     194          24 : }
     195             : 
     196             : /* Kind of a hack for now, we sometimes want to view bench generation
     197             :    in the monitor binary, but it's not part of the production binary. */
     198             : 
     199             : void
     200             : add_bench_topo( fd_topo_t  * topo,
     201             :                 char const * affinity,
     202             :                 ulong        benchg_tile_cnt,
     203             :                 ulong        benchs_tile_cnt,
     204             :                 ulong        accounts_cnt,
     205             :                 int          transaction_mode,
     206             :                 float        contending_fraction,
     207             :                 float        cu_price_spread,
     208             :                 ulong        conn_cnt,
     209             :                 ushort       send_to_port,
     210             :                 uint         send_to_ip_addr,
     211             :                 ushort       rpc_port,
     212             :                 uint         rpc_ip_addr,
     213           0 :                 int          reserve_agave_cores ) {
     214           0 :   (void)topo;
     215           0 :   (void)affinity;
     216           0 :   (void)benchg_tile_cnt;
     217           0 :   (void)benchs_tile_cnt;
     218           0 :   (void)accounts_cnt;
     219           0 :   (void)transaction_mode;
     220           0 :   (void)contending_fraction;
     221           0 :   (void)cu_price_spread;
     222           0 :   (void)conn_cnt;
     223           0 :   (void)send_to_port;
     224           0 :   (void)send_to_ip_addr;
     225           0 :   (void)rpc_port;
     226           0 :   (void)rpc_ip_addr;
     227           0 :   (void)reserve_agave_cores;
     228           0 : }

Generated by: LCOV version 1.14