LCOV - code coverage report
Current view: top level - app/firedancer - callbacks.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 88 0.0 %
Date: 2025-08-05 05:04:49 Functions: 0 25 0.0 %

          Line data    Source code
       1             : #include "../shared/fd_config.h"
       2             : #include "../../util/pod/fd_pod_format.h"
       3             : 
       4             : #include "../../disco/store/fd_store.h"
       5             : #include "../../flamenco/runtime/fd_txncache.h"
       6             : #include "../../flamenco/runtime/fd_runtime.h"
       7             : #include "../../flamenco/runtime/fd_runtime_public.h"
       8             : 
       9           0 : #define VAL(name) (__extension__({                                                             \
      10           0 :   ulong __x = fd_pod_queryf_ulong( topo->props, ULONG_MAX, "obj.%lu.%s", obj->id, name );      \
      11           0 :   if( FD_UNLIKELY( __x==ULONG_MAX ) ) FD_LOG_ERR(( "obj.%lu.%s was not set", obj->id, name )); \
      12           0 :   __x; }))
      13             : 
      14             : static ulong
      15             : runtime_pub_footprint( fd_topo_t const *     topo,
      16           0 :                        fd_topo_obj_t const * obj ) {
      17           0 :   (void)topo;
      18           0 :   return fd_runtime_public_footprint( VAL("mem_max") );
      19           0 : }
      20             : 
      21             : static ulong
      22             : runtime_pub_align( fd_topo_t const *     topo FD_FN_UNUSED,
      23           0 :                   fd_topo_obj_t const * obj  FD_FN_UNUSED ) {
      24           0 :   return fd_runtime_public_align();
      25           0 : }
      26             : 
      27             : static void
      28             : runtime_pub_new( fd_topo_t const *     topo,
      29           0 :                  fd_topo_obj_t const * obj ) {
      30           0 :   FD_TEST( fd_runtime_public_new( fd_topo_obj_laddr( topo, obj->id ), VAL("mem_max") ) );
      31           0 : }
      32             : 
      33             : fd_topo_obj_callbacks_t fd_obj_cb_runtime_pub = {
      34             :   .name      = "runtime_pub",
      35             :   .footprint = runtime_pub_footprint,
      36             :   .align     = runtime_pub_align,
      37             :   .new       = runtime_pub_new,
      38             : };
      39             : 
      40             : static ulong
      41             : banks_footprint( fd_topo_t const *     topo,
      42           0 :                  fd_topo_obj_t const * obj ) {
      43           0 :   return fd_banks_footprint( VAL("max_total_banks"), VAL("max_fork_width") );
      44           0 : }
      45             : 
      46             : static ulong
      47             : banks_align( fd_topo_t const *     topo FD_FN_UNUSED,
      48           0 :              fd_topo_obj_t const * obj  FD_FN_UNUSED ) {
      49           0 :   return fd_banks_align();
      50           0 : }
      51             : 
      52             : static void
      53             : banks_new( fd_topo_t const *     topo,
      54           0 :            fd_topo_obj_t const * obj ) {
      55           0 :   FD_TEST( fd_banks_new( fd_topo_obj_laddr( topo, obj->id ), VAL("max_total_banks"), VAL("max_fork_width") ) );
      56           0 : }
      57             : 
      58             : fd_topo_obj_callbacks_t fd_obj_cb_banks = {
      59             :   .name      = "banks",
      60             :   .footprint = banks_footprint,
      61             :   .align     = banks_align,
      62             :   .new       = banks_new,
      63             : };
      64             : 
      65             : static ulong
      66             : bh_cmp_footprint( fd_topo_t const *     topo,
      67           0 :                   fd_topo_obj_t const * obj ) {
      68           0 :   (void)topo; (void)obj;
      69           0 :   return fd_bank_hash_cmp_footprint();
      70           0 : }
      71             : 
      72             : static ulong
      73             : bh_cmp_align( fd_topo_t const *     topo,
      74           0 :               fd_topo_obj_t const * obj ) {
      75           0 :   (void)topo; (void)obj;
      76           0 :   return fd_bank_hash_cmp_align();
      77           0 : }
      78             : 
      79             : static void
      80             : bh_cmp_new( fd_topo_t const *     topo,
      81           0 :                    fd_topo_obj_t const * obj ) {
      82           0 :   (void)topo; (void)obj;
      83           0 :   FD_TEST( fd_bank_hash_cmp_new( fd_topo_obj_laddr( topo, obj->id ) ) );
      84           0 : }
      85             : 
      86             : fd_topo_obj_callbacks_t fd_obj_cb_bank_hash_cmp = {
      87             :   .name      = "bh_cmp",
      88             :   .footprint = bh_cmp_footprint,
      89             :   .align     = bh_cmp_align,
      90             :   .new       = bh_cmp_new,
      91             : };
      92             : 
      93             : static ulong
      94             : funk_align( fd_topo_t const *     topo,
      95           0 :             fd_topo_obj_t const * obj ) {
      96           0 :   (void)topo; (void)obj;
      97           0 :   return fd_funk_align();
      98           0 : }
      99             : 
     100             : static ulong
     101             : funk_footprint( fd_topo_t const *     topo,
     102           0 :                 fd_topo_obj_t const * obj ) {
     103           0 :   (void)topo;
     104           0 :   return fd_funk_footprint( VAL("txn_max"), VAL("rec_max") );
     105           0 : }
     106             : 
     107             : static ulong
     108             : funk_loose( fd_topo_t const *     topo,
     109           0 :             fd_topo_obj_t const * obj ) {
     110           0 :   (void)topo;
     111           0 :   return VAL("heap_max");
     112           0 : }
     113             : 
     114             : static void
     115             : funk_new( fd_topo_t const *     topo,
     116           0 :            fd_topo_obj_t const * obj ) {
     117           0 :   ulong funk_seed = fd_pod_queryf_ulong( topo->props, 0UL, "obj.%lu.seed", obj->id );
     118           0 :   if( !funk_seed ) FD_TEST( fd_rng_secure( &funk_seed, sizeof(ulong) ) );
     119           0 :   FD_TEST( fd_funk_new( fd_topo_obj_laddr( topo, obj->id ), 2UL, funk_seed, VAL("txn_max"), VAL("rec_max") ) );
     120           0 : }
     121             : 
     122             : fd_topo_obj_callbacks_t fd_obj_cb_funk = {
     123             :   .name      = "funk",
     124             :   .footprint = funk_footprint,
     125             :   .loose     = funk_loose,
     126             :   .align     = funk_align,
     127             :   .new       = funk_new,
     128             : };
     129             : 
     130             : static ulong
     131             : fec_sets_footprint( fd_topo_t const *     topo,
     132           0 :                     fd_topo_obj_t const * obj ) {
     133           0 :   return VAL("sz");
     134           0 : }
     135             : 
     136             : static ulong
     137             : fec_sets_align( fd_topo_t const *     topo FD_FN_UNUSED,
     138           0 :                   fd_topo_obj_t const * obj  FD_FN_UNUSED ) {
     139           0 :   return fd_dcache_align();
     140           0 : }
     141             : 
     142             : static void
     143             : fec_sets_new( FD_PARAM_UNUSED fd_topo_t const *     topo,
     144           0 :               FD_PARAM_UNUSED fd_topo_obj_t const * obj ) {
     145           0 :   FD_TEST( fd_topo_obj_laddr( topo, obj->id ) );
     146           0 : }
     147             : 
     148             : fd_topo_obj_callbacks_t fd_obj_cb_fec_sets = {
     149             :   .name      = "fec_sets",
     150             :   .footprint = fec_sets_footprint,
     151             :   .align     = fec_sets_align,
     152             :   .new       = fec_sets_new,
     153             : };
     154             : 
     155             : static ulong
     156             : store_footprint( fd_topo_t const * topo,
     157           0 :                  fd_topo_obj_t const * obj ) {
     158           0 :   return fd_store_footprint( VAL("fec_max") );
     159           0 : }
     160             : 
     161             : static ulong
     162             : store_align( fd_topo_t const *     topo FD_FN_UNUSED,
     163           0 :              fd_topo_obj_t const * obj  FD_FN_UNUSED ) {
     164           0 :   return fd_store_align();
     165           0 : }
     166             : 
     167             : static void
     168             : store_new( fd_topo_t const *     topo,
     169           0 :            fd_topo_obj_t const * obj ) {
     170           0 :   FD_TEST( fd_store_new( fd_topo_obj_laddr( topo, obj->id ), VAL("fec_max"), VAL("part_cnt") ) );
     171           0 : }
     172             : 
     173             : fd_topo_obj_callbacks_t fd_obj_cb_store = {
     174             :   .name      = "store",
     175             :   .footprint = store_footprint,
     176             :   .align     = store_align,
     177             :   .new       = store_new,
     178             : };
     179             : 
     180             : static ulong
     181             : txncache_footprint( fd_topo_t const *     topo,
     182           0 :                     fd_topo_obj_t const * obj ) {
     183           0 :   return fd_txncache_footprint( VAL("max_rooted_slots"), VAL("max_live_slots"), VAL("max_txn_per_slot") );
     184           0 : }
     185             : 
     186             : static ulong
     187             : txncache_align( fd_topo_t const *     topo FD_FN_UNUSED,
     188           0 :                 fd_topo_obj_t const * obj  FD_FN_UNUSED ) {
     189           0 :   return fd_txncache_align();
     190           0 : }
     191             : 
     192             : static void
     193             : txncache_new( fd_topo_t const *     topo,
     194           0 :               fd_topo_obj_t const * obj ) {
     195           0 :   FD_TEST( fd_txncache_new( fd_topo_obj_laddr( topo, obj->id ), VAL("max_rooted_slots"), VAL("max_live_slots"), VAL("max_txn_per_slot") ) );
     196           0 : }
     197             : 
     198             : fd_topo_obj_callbacks_t fd_obj_cb_txncache = {
     199             :   .name      = "txncache",
     200             :   .footprint = txncache_footprint,
     201             :   .align     = txncache_align,
     202             :   .new       = txncache_new,
     203             : };
     204             : 
     205             : static ulong
     206             : exec_spad_footprint( fd_topo_t const *     topo FD_FN_UNUSED,
     207           0 :                      fd_topo_obj_t const * obj  FD_FN_UNUSED ) {
     208           0 :   return fd_spad_footprint( FD_RUNTIME_TRANSACTION_EXECUTION_FOOTPRINT_DEFAULT );
     209           0 : }
     210             : 
     211             : static ulong
     212             : exec_spad_align( fd_topo_t const *     topo FD_FN_UNUSED,
     213           0 :                  fd_topo_obj_t const * obj  FD_FN_UNUSED ) {
     214           0 :   return fd_spad_align();
     215           0 : }
     216             : 
     217             : static void
     218             : exec_spad_new( fd_topo_t const *     topo,
     219           0 :                fd_topo_obj_t const * obj ) {
     220           0 :   FD_TEST( fd_spad_new( fd_topo_obj_laddr( topo, obj->id ), FD_RUNTIME_TRANSACTION_EXECUTION_FOOTPRINT_DEFAULT ) );
     221           0 : }
     222             : 
     223             : fd_topo_obj_callbacks_t fd_obj_cb_exec_spad = {
     224             :   .name      = "exec_spad",
     225             :   .footprint = exec_spad_footprint,
     226             :   .align     = exec_spad_align,
     227             :   .new       = exec_spad_new,
     228             : };
     229             : 
     230             : #undef VAL

Generated by: LCOV version 1.14