Skip to content

Commit

Permalink
fd_pack: Update list of unwritable accounts to sync with the related …
Browse files Browse the repository at this point in the history
…list in Labs' code
  • Loading branch information
ptaffet-jump committed Jan 9, 2024
1 parent 6c93623 commit ef5a611
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/ballet/pack/fd_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ typedef struct fd_pack_sig_to_txn fd_pack_sig_to_txn_t;
#define MAP_PERFECT_NAME fd_pack_unwritable
#define MAP_PERFECT_LG_TBL_SZ 5
#define MAP_PERFECT_T fd_acct_addr_t
#define MAP_PERFECT_HASH_C 3995341266U
#define MAP_PERFECT_HASH_C 714791685U
#define MAP_PERFECT_KEY b
#define MAP_PERFECT_KEY_T fd_acct_addr_t const *
#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)
Expand All @@ -114,37 +114,39 @@ typedef struct fd_pack_sig_to_txn fd_pack_sig_to_txn_t;
PERFECT_HASH( (a08 | (a09<<8) | (a10<<16) | (a11<<24)) )
#define MAP_PERFECT_HASH_R( ptr ) PERFECT_HASH( fd_uint_load_4( (uchar const *)ptr->b + 8UL ) )

/* SysvarEpochRewards1111111111111111111111111, and
ZkTokenProof1111111111111111111111111111111 omitted from this list
due to lack of use and lack of space in the table. */
#define MAP_PERFECT_0 ( SYSVAR_PROG_ID ),
#define MAP_PERFECT_1 ( SYSVAR_RECENT_BLKHASH_ID ),
#define MAP_PERFECT_2 ( SYSVAR_CLOCK_ID ),
#define MAP_PERFECT_3 ( SYSVAR_SLOT_HIST_ID ),
#define MAP_PERFECT_4 ( SYSVAR_SLOT_HASHES_ID ),
#define MAP_PERFECT_5 ( SYSVAR_EPOCH_SCHED_ID ),
#define MAP_PERFECT_6 ( SYSVAR_FEES_ID ),
#define MAP_PERFECT_7 ( SYSVAR_RENT_ID ),
/* This list is a superset of what Lab's is_builtin_key_or_sysvar checks. */
/* Sysvars */
#define MAP_PERFECT_0 ( SYSVAR_CLOCK_ID ),
#define MAP_PERFECT_1 ( SYSVAR_EPOCH_SCHED_ID ),
#define MAP_PERFECT_2 ( SYSVAR_FEES_ID ),
#define MAP_PERFECT_3 ( SYSVAR_RECENT_BLKHASH_ID ),
#define MAP_PERFECT_4 ( SYSVAR_RENT_ID ),
#define MAP_PERFECT_5 ( SYSVAR_REWARDS_ID ),
#define MAP_PERFECT_6 ( SYSVAR_SLOT_HASHES_ID ),
#define MAP_PERFECT_7 ( SYSVAR_SLOT_HIST_ID ),
#define MAP_PERFECT_8 ( SYSVAR_STAKE_HIST_ID ),
#define MAP_PERFECT_9 ( SYSVAR_LAST_RESTART_ID ),
#define MAP_PERFECT_10 ( SYSVAR_INSTRUCTIONS_ID ),
#define MAP_PERFECT_11 ( NATIVE_LOADER_ID ),
#define MAP_PERFECT_9 ( SYSVAR_INSTRUCTIONS_ID ),
#define MAP_PERFECT_10 ( SYSVAR_LAST_RESTART_ID ),
/* Programs */
#define MAP_PERFECT_11 ( CONFIG_PROG_ID ),
#define MAP_PERFECT_12 ( FEATURE_ID ),
#define MAP_PERFECT_13 ( CONFIG_PROG_ID ),
#define MAP_PERFECT_13 ( NATIVE_LOADER_ID ),
#define MAP_PERFECT_14 ( STAKE_PROG_ID ),
#define MAP_PERFECT_15 ( STAKE_CONFIG_PROG_ID ),
#define MAP_PERFECT_16 ( SYS_PROG_ID ),
#define MAP_PERFECT_17 ( VOTE_PROG_ID ),
#define MAP_PERFECT_16 ( VOTE_PROG_ID ),
#define MAP_PERFECT_17 ( SYS_PROG_ID ), /* Do not remove. See above. */
#define MAP_PERFECT_18 ( BPF_LOADER_1_PROG_ID ),
#define MAP_PERFECT_19 ( BPF_LOADER_2_PROG_ID ),
#define MAP_PERFECT_20 ( BPF_UPGRADEABLE_PROG_ID ),
/* Extras */
#define MAP_PERFECT_21 ( LOADER_V4_PROG_ID ),
#define MAP_PERFECT_22 ( ED25519_SV_PROG_ID ),
#define MAP_PERFECT_23 ( KECCAK_SECP_PROG_ID ),
#define MAP_PERFECT_24 ( COMPUTE_BUDGET_PROG_ID ),
#define MAP_PERFECT_25 ( ADDR_LUT_PROG_ID ),
#define MAP_PERFECT_26 ( NATIVE_MINT_ID ),
#define MAP_PERFECT_27 ( TOKEN_PROG_ID ),
#define MAP_PERFECT_28 ( SYSVAR_PROG_ID ),

#include "../../util/tmpl/fd_map_perfect.c"

Expand Down
2 changes: 2 additions & 0 deletions src/ballet/pack/fd_pack_pubkeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
0x26U,0xfdU,0x72U,0x00U,0xdfU,0x6fU,0xc4U,0xedU,0x52U,0x6aU,0x9cU,0x90U,0x00U,0x00U,0x00U,0x00U
#define SYSVAR_RENT_ID 0x06U,0xa7U,0xd5U,0x17U,0x19U,0x2cU,0x5cU,0x51U,0x21U,0x8cU,0xc9U,0x4cU,0x3dU,0x4aU,0xf1U,0x7fU, \
0x58U,0xdaU,0xeeU,0x08U,0x9bU,0xa1U,0xfdU,0x44U,0xe3U,0xdbU,0xd9U,0x8aU,0x00U,0x00U,0x00U,0x00U
#define SYSVAR_REWARDS_ID 0x06U,0xa7U,0xd5U,0x17U,0x19U,0x2cU,0x61U,0x37U,0xceU,0xe0U,0x92U,0xd9U,0xb6U,0x92U,0x3eU,0xe1U, \
0xccU,0xd6U,0x19U,0x03U,0xfaU,0x82U,0xb8U,0xa1U,0x61U,0x91U,0x57U,0x8dU,0x80U,0x00U,0x00U,0x00U
#define SYSVAR_STAKE_HIST_ID 0x06U,0xa7U,0xd5U,0x17U,0x19U,0x35U,0x84U,0xd0U,0xfeU,0xedU,0x9bU,0xb3U,0x43U,0x1dU,0x13U,0x20U, \
0x6bU,0xe5U,0x44U,0x28U,0x1bU,0x57U,0xb8U,0x56U,0x6cU,0xc5U,0x37U,0x5fU,0xf4U,0x00U,0x00U,0x00U
#define SYSVAR_LAST_RESTART_ID 0x06U,0xa7U,0xd5U,0x17U,0x19U,0x06U,0xddU,0xe1U,0xcdU,0x3fU,0x94U,0x7dU,0xcaU,0xb4U,0xc8U,0xf4U, \
Expand Down

0 comments on commit ef5a611

Please sign in to comment.