22#include "fd_sched.h"
33#include "fd_exec.h"
44#include "fd_vote_tracker.h"
5- #include "../../flamenco/accdb/fd_accdb_sync.h"
65#include "generated/fd_replay_tile_seccomp.h"
76
87#include "../genesis/fd_genesi_tile.h"
2120#include "../../disco/genesis/fd_genesis_cluster.h"
2221#include "../../util/pod/fd_pod.h"
2322#include "../../flamenco/accdb/fd_accdb_admin.h"
24- #include "../../flamenco/accdb/fd_accdb_user .h"
23+ #include "../../flamenco/accdb/fd_accdb_impl_v1 .h"
2524#include "../../flamenco/rewards/fd_rewards.h"
2625#include "../../flamenco/leaders/fd_multi_epoch_leaders.h"
2726#include "../../flamenco/progcache/fd_progcache_admin.h"
@@ -642,9 +641,10 @@ static ulong
642641get_identity_balance ( fd_replay_tile_t * ctx , fd_funk_txn_xid_t xid ) {
643642 ulong identity_balance = ULONG_MAX ;
644643 fd_txn_account_t identity_acc [1 ];
644+ fd_funk_t * funk = fd_accdb_user_v1_funk ( ctx -> accdb );
645645 int err = fd_txn_account_init_from_funk_readonly ( identity_acc ,
646646 ctx -> identity_pubkey ,
647- ctx -> accdb -> funk ,
647+ funk ,
648648 & xid );
649649 if ( FD_LIKELY ( !err && identity_acc -> meta ) ) identity_balance = identity_acc -> meta -> lamports ;
650650
@@ -784,7 +784,8 @@ replay_block_finalize( fd_replay_tile_t * ctx,
784784 /* If enabled, dump the block to a file and reset the dumping
785785 context state */
786786 if ( FD_UNLIKELY ( ctx -> capture_ctx && ctx -> capture_ctx -> dump_block_to_pb ) ) {
787- fd_dump_block_to_protobuf ( ctx -> block_dump_ctx , ctx -> banks , bank , ctx -> accdb -> funk , ctx -> capture_ctx );
787+ fd_funk_t * funk = fd_accdb_user_v1_funk ( ctx -> accdb );
788+ fd_dump_block_to_protobuf ( ctx -> block_dump_ctx , ctx -> banks , bank , funk , ctx -> capture_ctx );
788789 fd_block_dump_context_reset ( ctx -> block_dump_ctx );
789790 }
790791# endif
@@ -881,7 +882,8 @@ fini_leader_bank( fd_replay_tile_t * ctx,
881882 fd_sched_block_add_done ( ctx -> sched , ctx -> leader_bank -> idx , ctx -> leader_bank -> parent_idx , curr_slot );
882883
883884 /* Do hashing and other end-of-block processing */
884- fd_funk_txn_map_t * txn_map = fd_funk_txn_map ( ctx -> accdb -> funk );
885+ fd_funk_t * funk = fd_accdb_user_v1_funk ( ctx -> accdb );
886+ fd_funk_txn_map_t * txn_map = fd_funk_txn_map ( funk );
885887 if ( FD_UNLIKELY ( !txn_map -> map ) ) {
886888 FD_LOG_ERR (( "Could not find valid funk transaction map" ));
887889 }
@@ -984,8 +986,8 @@ init_funk( fd_replay_tile_t * ctx,
984986 FD_LOG_CRIT (( "failed to initialize account database: replay tile is not joined to program cache" ));
985987 }
986988 fd_progcache_clear ( ctx -> progcache_admin );
987- fd_progcache_txn_attach_child ( ctx -> progcache_admin , fd_funk_root ( ctx -> progcache_admin -> funk ), fd_funk_last_publish ( ctx -> accdb -> funk ) );
988- fd_progcache_txn_advance_root ( ctx -> progcache_admin , fd_funk_last_publish ( ctx -> accdb -> funk ) );
989+ fd_progcache_txn_attach_child ( ctx -> progcache_admin , fd_funk_root ( ctx -> progcache_admin -> funk ), fd_funk_last_publish ( ctx -> accdb_admin -> funk ) );
990+ fd_progcache_txn_advance_root ( ctx -> progcache_admin , fd_funk_last_publish ( ctx -> accdb_admin -> funk ) );
989991}
990992
991993static void
@@ -1000,17 +1002,18 @@ init_after_snapshot( fd_replay_tile_t * ctx ) {
10001002 FD_LOG_CRIT (( "invariant violation: replay bank is NULL at bank index %lu" , FD_REPLAY_BOOT_BANK_IDX ));
10011003 }
10021004
1005+ fd_funk_t * funk = fd_accdb_user_v1_funk ( ctx -> accdb );
10031006 fd_funk_txn_xid_t xid = { .ul = { fd_bank_slot_get ( bank ), bank -> idx } };
10041007 init_funk ( ctx , fd_bank_slot_get ( bank ) );
10051008
10061009 fd_stake_delegations_t * root_delegations = fd_banks_stake_delegations_root_query ( ctx -> banks );
10071010
1008- fd_stake_delegations_refresh ( root_delegations , ctx -> accdb -> funk , & xid );
1011+ fd_stake_delegations_refresh ( root_delegations , funk , & xid );
10091012
10101013 /* After both snapshots have been loaded in, we can determine if we should
10111014 start distributing rewards. */
10121015
1013- fd_rewards_recalculate_partitioned_rewards ( ctx -> banks , bank , ctx -> accdb -> funk , & xid , & ctx -> runtime_stack , ctx -> capture_ctx );
1016+ fd_rewards_recalculate_partitioned_rewards ( ctx -> banks , bank , funk , & xid , & ctx -> runtime_stack , ctx -> capture_ctx );
10141017
10151018 ulong snapshot_slot = fd_bank_slot_get ( bank );
10161019 if ( FD_UNLIKELY ( !snapshot_slot ) ) {
@@ -1110,10 +1113,11 @@ maybe_become_leader( fd_replay_tile_t * ctx,
11101113 fd_acct_addr_t tip_receiver [1 ];
11111114 fd_bundle_crank_get_addresses ( ctx -> bundle .gen , fd_bank_epoch_get ( bank ), tip_payment_config , tip_receiver );
11121115
1116+ fd_funk_t * funk = fd_accdb_user_v1_funk ( ctx -> accdb );
11131117 fd_txn_account_t tip_config_acc [1 ];
11141118 int err = fd_txn_account_init_from_funk_readonly ( tip_config_acc ,
11151119 (fd_hash_t * )tip_payment_config -> b ,
1116- ctx -> accdb -> funk ,
1120+ funk ,
11171121 & xid );
11181122 if ( FD_UNLIKELY ( err ) ) {
11191123 FD_LOG_CRIT (( "failed to initialize tip payment config account: err=%d" , err ));
@@ -1125,7 +1129,7 @@ maybe_become_leader( fd_replay_tile_t * ctx,
11251129 fd_txn_account_t tip_receiver_acc [1 ];
11261130 err = fd_txn_account_init_from_funk_readonly ( tip_receiver_acc ,
11271131 (fd_hash_t * )tip_receiver -> b ,
1128- ctx -> accdb -> funk ,
1132+ funk ,
11291133 & xid );
11301134 if ( FD_LIKELY ( !err ) ) {
11311135 memcpy ( tip_receiver_owner , tip_receiver_acc -> meta -> owner , sizeof (fd_acct_addr_t ) );
@@ -1412,7 +1416,8 @@ on_snapshot_message( fd_replay_tile_t * ctx,
14121416
14131417 fd_funk_txn_xid_t xid = { .ul = { snapshot_slot , FD_REPLAY_BOOT_BANK_IDX } };
14141418
1415- fd_features_restore ( bank , ctx -> accdb -> funk , & xid );
1419+ fd_funk_t * funk = fd_accdb_user_v1_funk ( ctx -> accdb );
1420+ fd_features_restore ( bank , funk , & xid );
14161421
14171422 fd_runtime_update_leaders ( bank , & ctx -> runtime_stack );
14181423
@@ -1712,7 +1717,7 @@ process_fec_set( fd_replay_tile_t * ctx,
17121717 sched_fec -> slot = reasm_fec -> slot ;
17131718 sched_fec -> parent_slot = reasm_fec -> slot - reasm_fec -> parent_off ;
17141719 sched_fec -> is_first_in_block = reasm_fec -> fec_set_idx == 0U ;
1715- fd_funk_txn_xid_copy ( sched_fec -> alut_ctx -> xid , fd_funk_last_publish ( ctx -> accdb -> funk ) );
1720+ fd_funk_txn_xid_copy ( sched_fec -> alut_ctx -> xid , fd_funk_last_publish ( ctx -> accdb_admin -> funk ) );
17161721 sched_fec -> alut_ctx -> accdb [0 ] = ctx -> accdb [0 ];
17171722 sched_fec -> alut_ctx -> els = ctx -> published_root_slot ;
17181723
@@ -2389,7 +2394,7 @@ unprivileged_init( fd_topo_t * topo,
23892394 fd_features_enable_one_offs ( features , one_off_features , (uint )tile -> replay .enable_features_cnt , 0UL );
23902395
23912396 FD_TEST ( fd_accdb_admin_join ( ctx -> accdb_admin , fd_topo_obj_laddr ( topo , tile -> replay .funk_obj_id ) ) );
2392- FD_TEST ( fd_accdb_user_join ( ctx -> accdb , fd_topo_obj_laddr ( topo , tile -> replay .funk_obj_id ) ) );
2397+ FD_TEST ( fd_accdb_user_v1_init ( ctx -> accdb , fd_topo_obj_laddr ( topo , tile -> replay .funk_obj_id ) ) );
23932398 FD_TEST ( fd_progcache_admin_join ( ctx -> progcache_admin , fd_topo_obj_laddr ( topo , tile -> replay .progcache_obj_id ) ) );
23942399
23952400 void * _txncache_shmem = fd_topo_obj_laddr ( topo , tile -> replay .txncache_obj_id );
0 commit comments