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-01 05:00:49 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             :   ulong                       slot;
      26             : 
      27             :   fd_banks_t *                banks;
      28             :   fd_bank_t *                 bank;
      29             : 
      30             :   /* External joins, pointers to be set by caller */
      31             : 
      32             :   fd_funk_t *                 funk;
      33             :   fd_funk_txn_t *             funk_txn;
      34             : 
      35             :   fd_txncache_t *             status_cache;
      36             : };
      37             : 
      38        7668 : #define FD_EXEC_SLOT_CTX_ALIGN     (alignof(fd_exec_slot_ctx_t))
      39        7668 : #define FD_EXEC_SLOT_CTX_FOOTPRINT (sizeof (fd_exec_slot_ctx_t))
      40           3 : #define FD_EXEC_SLOT_CTX_MAGIC     (0xC2287BA2A5E6FC3DUL) /* random */
      41             : 
      42             : FD_PROTOTYPES_BEGIN
      43             : 
      44             : void *
      45             : fd_exec_slot_ctx_new( void * mem );
      46             : 
      47             : fd_exec_slot_ctx_t *
      48             : fd_exec_slot_ctx_join( void * mem );
      49             : 
      50             : void *
      51             : fd_exec_slot_ctx_leave( fd_exec_slot_ctx_t * ctx );
      52             : 
      53             : void *
      54             : fd_exec_slot_ctx_delete( void * mem );
      55             : 
      56             : /* fd_exec_slot_ctx_recover re-initializes the current epoch/slot
      57             :    context and recovers it from the manifest of a Solana Labs snapshot.
      58             : 
      59             :    Copies content of manifest to ctx.  The 'manifest' object may be
      60             :    freed after this function returns.  Assumes that slot context and
      61             :    epoch context use same allocator.  Returns ctx on success.
      62             :    On failure, logs reason for error and returns NULL. */
      63             : 
      64             : fd_exec_slot_ctx_t *
      65             : fd_exec_slot_ctx_recover( fd_exec_slot_ctx_t *                ctx,
      66             :                           fd_solana_manifest_global_t const * manifest_global,
      67             :                           fd_spad_t *                         spad );
      68             : 
      69             : /* fd_exec_slot_ctx_recover re-initializes the current slot
      70             :    context's status cache from the provided solana slot deltas.
      71             :    Assumes objects in slot deltas were allocated using slot ctx valloc
      72             :    (U.B. otherwise).
      73             :    On return, slot deltas is destroyed.  Returns ctx on success.
      74             :    On failure, logs reason for error and returns NULL. */
      75             : 
      76             : fd_exec_slot_ctx_t *
      77             : fd_exec_slot_ctx_recover_status_cache( fd_exec_slot_ctx_t *    ctx,
      78             :                                        fd_bank_slot_deltas_t * slot_deltas,
      79             :                                        fd_spad_t *             runtime_spad );
      80             : 
      81             : FD_PROTOTYPES_END
      82             : 
      83             : #endif /* HEADER_fd_src_flamenco_runtime_context_fd_exec_slot_ctx_h */

Generated by: LCOV version 1.14