LCOV - code coverage report
Current view: top level - flamenco/runtime/context - fd_exec_slot_ctx.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 3 3 100.0 %
Date: 2025-07-18 05:01:12 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef HEADER_fd_src_flamenco_runtime_context_fd_exec_slot_ctx_h
       2             : #define HEADER_fd_src_flamenco_runtime_context_fd_exec_slot_ctx_h
       3             : 
       4             : #include "../fd_blockstore.h"
       5             : #include "../../../funk/fd_funk.h"
       6             : #include "../../../util/rng/fd_rng.h"
       7             : #include "../../../util/wksp/fd_wksp.h"
       8             : 
       9             : #include "../../types/fd_types.h"
      10             : #include "../fd_txncache.h"
      11             : #include "../fd_acc_mgr.h"
      12             : #include "../fd_bank_hash_cmp.h"
      13             : #include "../fd_bank.h"
      14             : 
      15             : /* fd_exec_slot_ctx_t is the context that stays constant during all
      16             :    transactions in a block. */
      17             : 
      18             : /* TODO: The slot ctx should be removed entirely. Pointers to
      19             :    funk, funk_txn, status_cache should be passed in
      20             :    seperately.*/
      21             : 
      22             : struct fd_exec_slot_ctx {
      23             :   ulong           magic; /* ==FD_EXEC_SLOT_CTX_MAGIC */
      24             : 
      25             :   fd_banks_t *    banks; /* TODO: Remove fd_banks_t when fd_ledger is removed*/
      26             :   fd_bank_t *     bank;
      27             : 
      28             :   fd_funk_t *     funk;
      29             :   fd_funk_txn_t * funk_txn;
      30             : 
      31             :   fd_txncache_t * status_cache;
      32             : };
      33             : 
      34        7668 : #define FD_EXEC_SLOT_CTX_ALIGN     (alignof(fd_exec_slot_ctx_t))
      35        7668 : #define FD_EXEC_SLOT_CTX_FOOTPRINT (sizeof (fd_exec_slot_ctx_t))
      36           3 : #define FD_EXEC_SLOT_CTX_MAGIC     (0xC2287BA2A5E6FC3DUL) /* random */
      37             : 
      38             : FD_PROTOTYPES_BEGIN
      39             : 
      40             : void *
      41             : fd_exec_slot_ctx_new( void * mem );
      42             : 
      43             : fd_exec_slot_ctx_t *
      44             : fd_exec_slot_ctx_join( void * mem );
      45             : 
      46             : void *
      47             : fd_exec_slot_ctx_leave( fd_exec_slot_ctx_t * ctx );
      48             : 
      49             : void *
      50             : fd_exec_slot_ctx_delete( void * mem );
      51             : 
      52             : /* fd_exec_slot_ctx_recover re-initializes the current epoch/slot
      53             :    context and recovers it from the manifest of a Solana Labs snapshot.
      54             : 
      55             :    Copies content of manifest to ctx.  The 'manifest' object may be
      56             :    freed after this function returns.  Assumes that slot context and
      57             :    epoch context use same allocator.  Returns ctx on success.
      58             :    On failure, logs reason for error and returns NULL. */
      59             : 
      60             : fd_exec_slot_ctx_t *
      61             : fd_exec_slot_ctx_recover( fd_exec_slot_ctx_t *                ctx,
      62             :                           fd_solana_manifest_global_t const * manifest_global,
      63             :                           fd_spad_t *                         spad );
      64             : 
      65             : /* fd_exec_slot_ctx_recover re-initializes the current slot
      66             :    context's status cache from the provided solana slot deltas.
      67             :    Assumes objects in slot deltas were allocated using slot ctx valloc
      68             :    (U.B. otherwise).
      69             :    On return, slot deltas is destroyed.  Returns ctx on success.
      70             :    On failure, logs reason for error and returns NULL. */
      71             : 
      72             : fd_exec_slot_ctx_t *
      73             : fd_exec_slot_ctx_recover_status_cache( fd_exec_slot_ctx_t *    ctx,
      74             :                                        fd_bank_slot_deltas_t * slot_deltas,
      75             :                                        fd_spad_t *             runtime_spad );
      76             : 
      77             : FD_PROTOTYPES_END
      78             : 
      79             : #endif /* HEADER_fd_src_flamenco_runtime_context_fd_exec_slot_ctx_h */

Generated by: LCOV version 1.14