LCOV - code coverage report
Current view: top level - flamenco/runtime - fd_system_ids.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 10 10 100.0 %
Date: 2024-11-13 11:58:15 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include "fd_system_ids.h"
       2             : #include "fd_system_ids_pp.h"
       3             : 
       4             : const fd_pubkey_t fd_sysvar_recent_block_hashes_id = { .uc = { SYSVAR_RECENT_BLKHASH_ID } };
       5             : const fd_pubkey_t fd_sysvar_clock_id               = { .uc = { SYSVAR_CLOCK_ID          } };
       6             : const fd_pubkey_t fd_sysvar_slot_history_id        = { .uc = { SYSVAR_SLOT_HIST_ID      } };
       7             : const fd_pubkey_t fd_sysvar_slot_hashes_id         = { .uc = { SYSVAR_SLOT_HASHES_ID    } };
       8             : const fd_pubkey_t fd_sysvar_epoch_schedule_id      = { .uc = { SYSVAR_EPOCH_SCHED_ID    } };
       9             : const fd_pubkey_t fd_sysvar_epoch_rewards_id       = { .uc = { SYSVAR_EPOCH_REWARDS_ID  } };
      10             : const fd_pubkey_t fd_sysvar_fees_id                = { .uc = { SYSVAR_FEES_ID           } };
      11             : const fd_pubkey_t fd_sysvar_rent_id                = { .uc = { SYSVAR_RENT_ID           } };
      12             : const fd_pubkey_t fd_sysvar_stake_history_id       = { .uc = { SYSVAR_STAKE_HIST_ID     } };
      13             : const fd_pubkey_t fd_sysvar_owner_id               = { .uc = { SYSVAR_PROG_ID           } };
      14             : const fd_pubkey_t fd_sysvar_last_restart_slot_id   = { .uc = { SYSVAR_LAST_RESTART_ID   } };
      15             : const fd_pubkey_t fd_sysvar_instructions_id        = { .uc = { SYSVAR_INSTRUCTIONS_ID   } };
      16             : const fd_pubkey_t fd_sysvar_incinerator_id         = { .uc = { SYSVAR_INCINERATOR_ID    } };
      17             : const fd_pubkey_t fd_sysvar_rewards_id             = { .uc = { SYSVAR_REWARDS_ID        } };
      18             : 
      19             : const fd_pubkey_t fd_solana_native_loader_id                  = { .uc = { NATIVE_LOADER_ID         } };
      20             : const fd_pubkey_t fd_solana_feature_program_id                = { .uc = { FEATURE_ID               } };
      21             : const fd_pubkey_t fd_solana_config_program_id                 = { .uc = { CONFIG_PROG_ID           } };
      22             : const fd_pubkey_t fd_solana_stake_program_id                  = { .uc = { STAKE_PROG_ID            } };
      23             : const fd_pubkey_t fd_solana_stake_program_config_id           = { .uc = { STAKE_CONFIG_PROG_ID     } };
      24             : const fd_pubkey_t fd_solana_system_program_id                 = { .uc = { SYS_PROG_ID              } };
      25             : const fd_pubkey_t fd_solana_vote_program_id                   = { .uc = { VOTE_PROG_ID             } };
      26             : const fd_pubkey_t fd_solana_bpf_loader_deprecated_program_id  = { .uc = { BPF_LOADER_1_PROG_ID     } };
      27             : const fd_pubkey_t fd_solana_bpf_loader_program_id             = { .uc = { BPF_LOADER_2_PROG_ID     } };
      28             : const fd_pubkey_t fd_solana_bpf_loader_upgradeable_program_id = { .uc = { BPF_UPGRADEABLE_PROG_ID  } };
      29             : const fd_pubkey_t fd_solana_bpf_loader_v4_program_id          = { .uc = { LOADER_V4_PROG_ID        } };
      30             : const fd_pubkey_t fd_solana_ed25519_sig_verify_program_id     = { .uc = { ED25519_SV_PROG_ID       } };
      31             : const fd_pubkey_t fd_solana_keccak_secp_256k_program_id       = { .uc = { KECCAK_SECP_PROG_ID      } };
      32             : const fd_pubkey_t fd_solana_secp256r1_program_id              = { .uc = { SECP256R1_PROG_ID        } };
      33             : const fd_pubkey_t fd_solana_compute_budget_program_id         = { .uc = { COMPUTE_BUDGET_PROG_ID   } };
      34             : const fd_pubkey_t fd_solana_address_lookup_table_program_id   = { .uc = { ADDR_LUT_PROG_ID         } };
      35             : const fd_pubkey_t fd_solana_spl_native_mint_id                = { .uc = { NATIVE_MINT_ID           } };
      36             : const fd_pubkey_t fd_solana_spl_token_id                      = { .uc = { TOKEN_PROG_ID            } };
      37             : const fd_pubkey_t fd_solana_zk_token_proof_program_id         = { .uc = { ZK_TOKEN_PROG_ID         } };
      38             : const fd_pubkey_t fd_solana_zk_elgamal_proof_program_id       = { .uc = { ZK_EL_GAMAL_PROG_ID      } };
      39             : 
      40             : /* https://github.com/firedancer-io/agave/blob/66c126b41ec2b55b3f747a4ac4e3ee6b439164a5/sdk/src/reserved_account_keys.rs#L152-L194 */
      41             : #define MAP_PERFECT_NAME fd_pubkey_active_reserved_keys_tbl
      42             : #define MAP_PERFECT_LG_TBL_SZ 5
      43             : #define MAP_PERFECT_T fd_pubkey_t
      44      133152 : #define MAP_PERFECT_HASH_C 928U
      45             : #define MAP_PERFECT_KEY uc
      46             : #define MAP_PERFECT_KEY_T fd_pubkey_t const *
      47             : #define MAP_PERFECT_ZERO_KEY  (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0)
      48             : #define MAP_PERFECT_COMPLEX_KEY 1
      49      133152 : #define MAP_PERFECT_KEYS_EQUAL(k1,k2) (!memcmp( (k1), (k2), 32UL ))
      50             : 
      51      133152 : #define PERFECT_HASH( u ) (((MAP_PERFECT_HASH_C*(u))>>27)&0x1FU)
      52             : 
      53             : #define MAP_PERFECT_HASH_PP( a00,a01,a02,a03,a04,a05,a06,a07,a08,a09,a10,a11,a12,a13,a14,a15, \
      54             :                              a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31) \
      55             :                                           PERFECT_HASH( (a08 | (a09<<8) | (a10<<16) | (a11<<24)) )
      56      133152 : #define MAP_PERFECT_HASH_R( ptr ) PERFECT_HASH( fd_uint_load_4( (uchar const *)ptr->uc + 8UL ) )
      57             : 
      58             : #define MAP_PERFECT_0       ( BPF_LOADER_2_PROG_ID     ),
      59             : #define MAP_PERFECT_1       ( BPF_LOADER_1_PROG_ID     ),
      60             : #define MAP_PERFECT_2       ( BPF_UPGRADEABLE_PROG_ID  ),
      61             : #define MAP_PERFECT_3       ( CONFIG_PROG_ID           ),
      62             : #define MAP_PERFECT_4       ( FEATURE_ID               ),
      63             : #define MAP_PERFECT_5       ( STAKE_CONFIG_PROG_ID     ),
      64             : #define MAP_PERFECT_6       ( STAKE_PROG_ID            ),
      65             : #define MAP_PERFECT_7       ( SYS_PROG_ID              ),
      66             : #define MAP_PERFECT_8       ( VOTE_PROG_ID             ),
      67             : #define MAP_PERFECT_9       ( SYSVAR_CLOCK_ID          ),
      68             : #define MAP_PERFECT_10      ( SYSVAR_EPOCH_SCHED_ID    ),
      69             : #define MAP_PERFECT_11      ( SYSVAR_FEES_ID           ),
      70             : #define MAP_PERFECT_12      ( SYSVAR_INSTRUCTIONS_ID   ),
      71             : #define MAP_PERFECT_13      ( SYSVAR_RECENT_BLKHASH_ID ),
      72             : #define MAP_PERFECT_14      ( SYSVAR_RENT_ID           ),
      73             : #define MAP_PERFECT_15      ( SYSVAR_REWARDS_ID        ),
      74             : #define MAP_PERFECT_16      ( SYSVAR_SLOT_HASHES_ID    ),
      75             : #define MAP_PERFECT_17      ( SYSVAR_SLOT_HIST_ID      ),
      76             : #define MAP_PERFECT_18      ( SYSVAR_STAKE_HIST_ID     ),
      77             : #define MAP_PERFECT_19      ( NATIVE_LOADER_ID         ),
      78             : 
      79             : #include "../../util/tmpl/fd_map_perfect.c"
      80             : #undef PERFECT_HASH
      81             : 
      82             : 
      83             : 
      84             : #define MAP_PERFECT_NAME fd_pubkey_pending_reserved_keys_tbl
      85             : #define MAP_PERFECT_LG_TBL_SZ 4
      86             : #define MAP_PERFECT_T fd_pubkey_t
      87       23355 : #define MAP_PERFECT_HASH_C 146U
      88             : #define MAP_PERFECT_KEY uc
      89             : #define MAP_PERFECT_KEY_T fd_pubkey_t const *
      90             : #define MAP_PERFECT_ZERO_KEY  (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0)
      91             : #define MAP_PERFECT_COMPLEX_KEY 1
      92       23355 : #define MAP_PERFECT_KEYS_EQUAL(k1,k2) (!memcmp( (k1), (k2), 32UL ))
      93             : 
      94       23355 : #define PERFECT_HASH( u ) (((MAP_PERFECT_HASH_C*(u))>>28)&0x0FU)
      95             : 
      96             : #define MAP_PERFECT_HASH_PP( a00,a01,a02,a03,a04,a05,a06,a07,a08,a09,a10,a11,a12,a13,a14,a15, \
      97             :                              a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31) \
      98             :                                           PERFECT_HASH( (a08 | (a09<<8) | (a10<<16) | (a11<<24)) )
      99       23355 : #define MAP_PERFECT_HASH_R( ptr ) PERFECT_HASH( fd_uint_load_4( (uchar const *)ptr->uc + 8UL ) )
     100             : 
     101             : #define MAP_PERFECT_0       ( ADDR_LUT_PROG_ID        ),
     102             : #define MAP_PERFECT_1       ( COMPUTE_BUDGET_PROG_ID  ),
     103             : #define MAP_PERFECT_2       ( ED25519_SV_PROG_ID      ),
     104             : #define MAP_PERFECT_3       ( LOADER_V4_PROG_ID       ),
     105             : #define MAP_PERFECT_4       ( KECCAK_SECP_PROG_ID     ),
     106             : #define MAP_PERFECT_5       ( ZK_EL_GAMAL_PROG_ID     ),
     107             : #define MAP_PERFECT_6       ( ZK_TOKEN_PROG_ID        ),
     108             : #define MAP_PERFECT_7       ( SYSVAR_EPOCH_REWARDS_ID ),
     109             : #define MAP_PERFECT_8       ( SYSVAR_LAST_RESTART_ID  ),
     110             : #define MAP_PERFECT_9       ( SYSVAR_PROG_ID          ),
     111             : #define MAP_PERFECT_10      ( SECP256R1_PROG_ID       ),
     112             : 
     113             : #include "../../util/tmpl/fd_map_perfect.c"
     114             : #undef PERFECT_HASH
     115             : 
     116      133152 : int fd_pubkey_is_active_reserved_key ( fd_pubkey_t const * acct ) { return fd_pubkey_active_reserved_keys_tbl_contains( acct );  }
     117       23355 : int fd_pubkey_is_pending_reserved_key( fd_pubkey_t const * acct ) { return fd_pubkey_pending_reserved_keys_tbl_contains( acct ); }

Generated by: LCOV version 1.14