Skip to content

Commit

Permalink
flamenco: slot ctx in txn ctx is const
Browse files Browse the repository at this point in the history
  • Loading branch information
CantelopePeel authored and lheeger-jump committed Oct 29, 2024
1 parent 70f61e2 commit 030763a
Show file tree
Hide file tree
Showing 21 changed files with 89 additions and 64 deletions.
2 changes: 1 addition & 1 deletion src/flamenco/runtime/context/fd_exec_instr_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct __attribute__((aligned(8UL))) fd_exec_instr_ctx {
ulong magic; /* ==FD_EXEC_INSTR_CTX_MAGIC */

fd_exec_epoch_ctx_t const * epoch_ctx;
fd_exec_slot_ctx_t * slot_ctx; /* TODO: needs to be made const to be thread safe. */
fd_exec_slot_ctx_t const * slot_ctx; /* TODO: needs to be made const to be thread safe. */
fd_exec_txn_ctx_t * txn_ctx; /* The transaction context for this instruction */

fd_exec_instr_ctx_t const * parent;
Expand Down
1 change: 1 addition & 0 deletions src/flamenco/runtime/context/fd_exec_txn_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ fd_exec_txn_ctx_setup( fd_exec_txn_ctx_t * txn_ctx,
txn_ctx->heap_size = FD_VM_HEAP_DEFAULT;
txn_ctx->loaded_accounts_data_size_limit = FD_VM_LOADED_ACCOUNTS_DATA_SIZE_LIMIT;
txn_ctx->accounts_resize_delta = 0;
txn_ctx->collected_rent = 0UL;

txn_ctx->txn_descriptor = txn_descriptor;
txn_ctx->_txn_raw->raw = txn_raw->raw;
Expand Down
3 changes: 2 additions & 1 deletion src/flamenco/runtime/context/fd_exec_txn_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct __attribute__((aligned(8UL))) fd_exec_txn_ctx {
ulong magic; /* ==FD_EXEC_TXN_CTX_MAGIC */

fd_exec_epoch_ctx_t const * epoch_ctx;
fd_exec_slot_ctx_t * slot_ctx;
fd_exec_slot_ctx_t const * slot_ctx;

fd_funk_txn_t * funk_txn;
fd_acc_mgr_t * acc_mgr;
Expand Down Expand Up @@ -92,6 +92,7 @@ struct __attribute__((aligned(8UL))) fd_exec_txn_ctx {
fd_hash_t blake_txn_msg_hash; /* Hash of raw transaction message used by the status cache */
ulong execution_fee; /* Execution fee paid by the fee payer in the transaction */
ulong priority_fee; /* Priority fee paid by the fee payer in the transaction */
ulong collected_rent; /* Rent collected from accounts in this transaction */

uchar dirty_vote_acc : 1; /* 1 if this transaction maybe modified a vote account */
uchar dirty_stake_acc : 1; /* 1 if this transaction maybe modified a stake account */
Expand Down
18 changes: 10 additions & 8 deletions src/flamenco/runtime/fd_executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ fd_executor_check_status_cache( fd_exec_txn_ctx_t * txn_ctx ) {

// TODO: figure out if it is faster to batch query properly and loop all txns again
int err;
fd_txncache_query_batch( txn_ctx->slot_ctx->status_cache, &curr_query, 1UL, txn_ctx->slot_ctx, status_check_tower, &err );
fd_txncache_query_batch( txn_ctx->slot_ctx->status_cache, &curr_query, 1UL, (void *)txn_ctx->slot_ctx, status_check_tower, &err );
return err;
}

Expand Down Expand Up @@ -359,7 +359,7 @@ fd_executor_load_transaction_accounts( fd_exec_txn_ctx_t * txn_ctx ) {
TODO: the rent epoch check in the conditional should probably be moved
to inside fd_runtime_collect_rent_from_account. */
if( fd_txn_account_is_writable_idx( txn_ctx, (int)i ) && acct->const_meta->info.rent_epoch<=epoch ) {
fd_runtime_collect_rent_from_account( txn_ctx->slot_ctx, acct->meta, acct->pubkey, epoch );
txn_ctx->collected_rent += fd_runtime_collect_rent_from_account( txn_ctx->slot_ctx, acct->meta, acct->pubkey, epoch );
acct->starting_lamports = acct->meta->info.lamports;
}

Expand Down Expand Up @@ -519,8 +519,8 @@ fd_executor_validate_account_locks( fd_exec_txn_ctx_t const * txn_ctx ) {

/* https://github.com/anza-xyz/agave/blob/89050f3cb7e76d9e273f10bea5e8207f2452f79f/svm/src/account_loader.rs#L101-L126 */
static int
fd_should_set_exempt_rent_epoch_max( fd_exec_slot_ctx_t * slot_ctx,
fd_borrowed_account_t * rec ) {
fd_should_set_exempt_rent_epoch_max( fd_exec_slot_ctx_t const * slot_ctx,
fd_borrowed_account_t * rec ) {
/* https://github.com/anza-xyz/agave/blob/89050f3cb7e76d9e273f10bea5e8207f2452f79f/svm/src/account_loader.rs#L109-L125 */
if( FD_FEATURE_ACTIVE( slot_ctx, disable_rent_fees_collection ) ) {
if( FD_LIKELY( rec->const_meta->info.rent_epoch!=ULONG_MAX
Expand Down Expand Up @@ -620,7 +620,7 @@ fd_executor_validate_transaction_fee_payer( fd_exec_txn_ctx_t * txn_ctx ) {
https://github.com/anza-xyz/agave/blob/16de8b75ebcd57022409b422de557dd37b1de8db/svm/src/transaction_processor.rs#L438-L445 */
fd_epoch_schedule_t const * schedule = fd_sysvar_cache_epoch_schedule( txn_ctx->slot_ctx->sysvar_cache );
ulong epoch = fd_slot_to_epoch( schedule, txn_ctx->slot_ctx->slot_bank.slot, NULL );
fd_runtime_collect_rent_from_account( txn_ctx->slot_ctx, fee_payer_rec->meta, fee_payer_rec->pubkey, epoch );
txn_ctx->collected_rent += fd_runtime_collect_rent_from_account( txn_ctx->slot_ctx, fee_payer_rec->meta, fee_payer_rec->pubkey, epoch );
fee_payer_rec->starting_lamports = fee_payer_rec->meta->info.lamports;

/* https://github.com/anza-xyz/agave/blob/16de8b75ebcd57022409b422de557dd37b1de8db/svm/src/transaction_processor.rs#L431-L488 */
Expand Down Expand Up @@ -1412,7 +1412,7 @@ create_txn_context_protobuf_from_txn( fd_exec_test_txn_context_t * txn_context_m
fd_spad_t * spad ) {
fd_txn_t const * txn_descriptor = txn_ctx->txn_descriptor;
uchar const * txn_payload = (uchar const *) txn_ctx->_txn_raw->raw;
fd_exec_slot_ctx_t * slot_ctx = txn_ctx->slot_ctx;
fd_exec_slot_ctx_t const * slot_ctx = txn_ctx->slot_ctx;

/* We don't want to store builtins in account shared data */
fd_pubkey_t const loaded_builtins[] = {
Expand Down Expand Up @@ -1676,7 +1676,7 @@ create_txn_context_protobuf_from_txn( fd_exec_test_txn_context_t * txn_context_m
txn_context_msg->blockhash_queue = output_blockhash_queue;

// Iterate over all block hashes in the queue and save them
fd_block_hash_queue_t * queue = &slot_ctx->slot_bank.block_hash_queue;
fd_block_hash_queue_t const * queue = &slot_ctx->slot_bank.block_hash_queue;
fd_hash_hash_age_pair_t_mapnode_t * nn;
for ( fd_hash_hash_age_pair_t_mapnode_t * n = fd_hash_hash_age_pair_t_map_minimum( queue->ages_pool, queue->ages_root ); n; n = nn ) {
nn = fd_hash_hash_age_pair_t_map_successor( queue->ages_pool, n );
Expand Down Expand Up @@ -1895,7 +1895,9 @@ fd_execute_txn( fd_exec_txn_ctx_t * txn_ctx ) {
} FD_SCRATCH_SCOPE_END;
}

int fd_executor_txn_check( fd_exec_slot_ctx_t * slot_ctx, fd_exec_txn_ctx_t *txn ) {
int
fd_executor_txn_check( fd_exec_slot_ctx_t const * slot_ctx,
fd_exec_txn_ctx_t * txn ) {
fd_rent_t const * rent = fd_sysvar_cache_rent( slot_ctx->sysvar_cache );

ulong starting_lamports_l = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/flamenco/runtime/fd_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ fd_executor_is_system_nonce_account( fd_borrowed_account_t * account );
*/

int
fd_executor_txn_check( fd_exec_slot_ctx_t * slot_ctx, fd_exec_txn_ctx_t *txn );
fd_executor_txn_check( fd_exec_slot_ctx_t const * slot_ctx,
fd_exec_txn_ctx_t * txn );

void
fd_txn_reclaim_accounts( fd_exec_txn_ctx_t * txn_ctx );
Expand Down
56 changes: 38 additions & 18 deletions src/flamenco/runtime/fd_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,14 @@ fd_txn_prep_and_exec_task( void *tpool,
FD_COMPILER_MFENCE();
}

curr = slot_ctx->slot_bank.collected_rent;
FD_COMPILER_MFENCE();
while( FD_UNLIKELY( FD_ATOMIC_CAS( &slot_ctx->slot_bank.collected_rent, curr, curr + task_info->txn_ctx->collected_rent ) != curr ) ) {
FD_SPIN_PAUSE();
curr = slot_ctx->slot_bank.collected_rent;
FD_COMPILER_MFENCE();
}

// fd_runtime_finalize_txn( slot_ctx, capture_ctx, task_info );

}
Expand Down Expand Up @@ -1170,6 +1178,14 @@ fd_runtime_prepare_execute_finalize_txn( fd_exec_slot_ctx_t * slot_ctx,
FD_COMPILER_MFENCE();
}

curr = slot_ctx->slot_bank.collected_rent;
FD_COMPILER_MFENCE();
while( FD_UNLIKELY( FD_ATOMIC_CAS( &slot_ctx->slot_bank.collected_rent, curr, curr + task_info->txn_ctx->collected_rent ) != curr ) ) {
FD_SPIN_PAUSE();
curr = slot_ctx->slot_bank.collected_rent;
FD_COMPILER_MFENCE();
}

fd_runtime_finalize_txn( slot_ctx, capture_ctx, task_info );

return res;
Expand Down Expand Up @@ -3191,7 +3207,9 @@ fd_runtime_calculate_fee(fd_exec_txn_ctx_t *txn_ctx,
#define FD_RENT_EXEMPT (-1L)

static long
fd_runtime_get_rent_due( fd_exec_slot_ctx_t * slot_ctx, fd_account_meta_t * acc, ulong epoch ) {
fd_runtime_get_rent_due( fd_exec_slot_ctx_t const * slot_ctx,
fd_account_meta_t * acc,
ulong epoch ) {

fd_epoch_bank_t * epoch_bank = fd_exec_epoch_ctx_epoch_bank( slot_ctx->epoch_ctx );
fd_epoch_schedule_t * schedule = &epoch_bank->rent_epoch_schedule;
Expand Down Expand Up @@ -3237,11 +3255,13 @@ fd_runtime_get_rent_due( fd_exec_slot_ctx_t * slot_ctx, fd_account_meta_t * acc,
}

/* https://github.com/anza-xyz/agave/blob/v2.0.10/sdk/src/rent_collector.rs#L117-149 */
void
fd_runtime_collect_from_existing_account( fd_exec_slot_ctx_t * slot_ctx,
fd_account_meta_t * acc,
fd_pubkey_t const * pubkey,
ulong epoch ) {
/* Collect rent from an account. Returns the amount of rent collected. */
ulong
fd_runtime_collect_from_existing_account( fd_exec_slot_ctx_t const * slot_ctx,
fd_account_meta_t * acc,
fd_pubkey_t const * pubkey,
ulong epoch ) {
ulong collected_rent = 0UL;
#define NO_RENT_COLLECTION_NOW (-1)
#define EXEMPT (-2)
#define COLLECT_RENT (-3)
Expand Down Expand Up @@ -3287,17 +3307,18 @@ fd_runtime_collect_from_existing_account( fd_exec_slot_ctx_t * slot_ctx,
case COLLECT_RENT:
if( FD_UNLIKELY( (ulong)rent_due>=acc->info.lamports ) ) {
/* Reclaim account */
slot_ctx->slot_bank.collected_rent += (ulong)acc->info.lamports;
collected_rent += (ulong)acc->info.lamports;
acc->info.lamports = 0UL;
acc->dlen = 0UL;
fd_memset( acc->info.owner, 0, sizeof(acc->info.owner) );
} else {
slot_ctx->slot_bank.collected_rent += (ulong)rent_due;
collected_rent += (ulong)rent_due;
acc->info.lamports -= (ulong)rent_due;
acc->info.rent_epoch = epoch+1UL;
}
}

return collected_rent;

#undef NO_RENT_COLLECTION_NOW
#undef EXEMPT
Expand All @@ -3308,24 +3329,23 @@ fd_runtime_collect_from_existing_account( fd_exec_slot_ctx_t * slot_ctx,
Although the Solana runtime prevents the creation of new accounts
that are subject to rent, some older accounts are still undergo the
rent collection process. Updates the account's 'rent_epoch' if
needed. Returns 1 if the account was changed, and 0 if it is
unchanged. */
needed. Returns the amount of rent collected. */
/* https://github.com/anza-xyz/agave/blob/v2.0.10/svm/src/account_loader.rs#L71-96 */
int
fd_runtime_collect_rent_from_account( fd_exec_slot_ctx_t * slot_ctx,
fd_account_meta_t * acc,
fd_pubkey_t const * key,
ulong epoch ) {
ulong
fd_runtime_collect_rent_from_account( fd_exec_slot_ctx_t const * slot_ctx,
fd_account_meta_t * acc,
fd_pubkey_t const * key,
ulong epoch ) {

if( !FD_FEATURE_ACTIVE( slot_ctx, disable_rent_fees_collection ) ) {
fd_runtime_collect_from_existing_account( slot_ctx, acc, key, epoch );
return fd_runtime_collect_from_existing_account( slot_ctx, acc, key, epoch );
} else {
if( FD_UNLIKELY( acc->info.rent_epoch!=FD_RENT_EXEMPT_RENT_EPOCH &&
fd_runtime_get_rent_due( slot_ctx, acc, epoch )==FD_RENT_EXEMPT ) ) {
acc->info.rent_epoch = ULONG_MAX;
}
}
return FD_RUNTIME_EXECUTE_SUCCESS;
return 0UL;
}

static void
Expand Down Expand Up @@ -3377,7 +3397,7 @@ fd_runtime_collect_rent_for_slot( fd_exec_slot_ctx_t * slot_ctx, ulong off, ulon
}

/* Actually invoke rent collection */
fd_runtime_collect_rent_from_account( slot_ctx, rec->meta, key, epoch );
slot_ctx->slot_bank.collected_rent += fd_runtime_collect_rent_from_account( slot_ctx, rec->meta, key, epoch );
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/flamenco/runtime/fd_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ fd_runtime_block_execute_finalize_tpool( fd_exec_slot_ctx_t * slot_ctx,
fd_block_info_t const * block_info,
fd_tpool_t * tpool );

int
fd_runtime_collect_rent_from_account( fd_exec_slot_ctx_t * slot_ctx,
fd_account_meta_t * acc,
fd_pubkey_t const * key,
ulong epoch );
ulong
fd_runtime_collect_rent_from_account( fd_exec_slot_ctx_t const * slot_ctx,
fd_account_meta_t * acc,
fd_pubkey_t const * key,
ulong epoch );

void
fd_runtime_execute_txn( fd_execute_txn_task_info_t * task_info );
Expand Down
6 changes: 3 additions & 3 deletions src/flamenco/runtime/program/fd_bpf_program_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ fd_bpf_check_and_create_bpf_program_cache_entry( fd_exec_slot_ctx_t * slot_ctx,
}

int
fd_bpf_load_cache_entry( fd_exec_slot_ctx_t * slot_ctx,
fd_bpf_load_cache_entry( fd_exec_slot_ctx_t const * slot_ctx,
fd_pubkey_t const * program_pubkey,
fd_sbpf_validated_program_t ** valid_prog ) {
fd_funk_t * funk = slot_ctx->acc_mgr->funk;
Expand Down Expand Up @@ -465,8 +465,8 @@ fd_bpf_add_to_program_blacklist( fd_exec_slot_ctx_t * slot_ctx,
}

int
fd_bpf_is_in_program_blacklist( fd_exec_slot_ctx_t * slot_ctx,
fd_pubkey_t const * program_pubkey ) {
fd_bpf_is_in_program_blacklist( fd_exec_slot_ctx_t const * slot_ctx,
fd_pubkey_t const * program_pubkey ) {

for( uint i=0U; i<slot_ctx->program_blacklist_cnt; i++ ) {
if( FD_UNLIKELY( !memcmp( &slot_ctx->program_blacklist[i], program_pubkey, sizeof(fd_pubkey_t) ) ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/program/fd_bpf_program_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fd_bpf_scan_and_create_bpf_program_cache_entry_tpool( fd_exec_slot_ctx_t * slot_
int update_program_blacklist );

int
fd_bpf_load_cache_entry( fd_exec_slot_ctx_t * slot_ctx,
fd_bpf_load_cache_entry( fd_exec_slot_ctx_t const * slot_ctx,
fd_pubkey_t const * program_pubkey,
fd_sbpf_validated_program_t ** valid_prog );

Expand All @@ -87,7 +87,7 @@ fd_bpf_add_to_program_blacklist( fd_exec_slot_ctx_t * slot_ctx,
fd_pubkey_t const * program_pubkey );

int
fd_bpf_is_in_program_blacklist( fd_exec_slot_ctx_t * slot_ctx,
fd_bpf_is_in_program_blacklist( fd_exec_slot_ctx_t const * slot_ctx,
fd_pubkey_t const * program_pubkey );

FD_PROTOTYPES_END
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/program/fd_stake_program.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ set_state( fd_exec_instr_ctx_t const * ctx,

// https://github.com/anza-xyz/agave/blob/c8685ce0e1bb9b26014f1024de2cd2b8c308cbde/programs/stake/src/lib.rs#L29
static inline ulong
get_minimum_delegation( fd_exec_slot_ctx_t * slot_ctx /* feature set */ ) {
get_minimum_delegation( fd_exec_slot_ctx_t const * slot_ctx /* feature set */ ) {
return fd_ulong_if( FD_FEATURE_ACTIVE( slot_ctx, stake_raise_minimum_delegation_to_1_sol ),
MINIMUM_DELEGATION_SOL * LAMPORTS_PER_SOL,
1 );
Expand Down Expand Up @@ -215,7 +215,7 @@ typedef struct validated_delegated_info validated_delegated_info_t;
static int
validate_delegated_amount( fd_borrowed_account_t * account,
fd_stake_meta_t const * meta,
fd_exec_slot_ctx_t * slot_ctx,
fd_exec_slot_ctx_t const * slot_ctx,
validated_delegated_info_t * out,
uint * custom_err ) {
ulong stake_amount = fd_ulong_sat_sub( account->const_meta->info.lamports, meta->rent_exempt_reserve );
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/sysvar/fd_sysvar_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ write_clock( fd_exec_slot_ctx_t * slot_ctx,


fd_sol_sysvar_clock_t *
fd_sysvar_clock_read( fd_sol_sysvar_clock_t * result,
fd_exec_slot_ctx_t * slot_ctx ) {
fd_sysvar_clock_read( fd_sol_sysvar_clock_t * result,
fd_exec_slot_ctx_t const * slot_ctx ) {
fd_sol_sysvar_clock_t const * ret = fd_sysvar_cache_clock( slot_ctx->sysvar_cache );
if( NULL != ret ) {
fd_memcpy(result, ret, sizeof(fd_sol_sysvar_clock_t));
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/sysvar/fd_sysvar_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ fd_sysvar_clock_update( fd_exec_slot_ctx_t * slot_ctx );
/* Reads the current value of the clock sysvar */

fd_sol_sysvar_clock_t *
fd_sysvar_clock_read( fd_sol_sysvar_clock_t * result,
fd_exec_slot_ctx_t * slot_ctx );
fd_sysvar_clock_read( fd_sol_sysvar_clock_t * result,
fd_exec_slot_ctx_t const * slot_ctx );

/* fd_slot_cnt_2day returns the number of slots in two days.
Used in rent collection. */
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ write_epoch_schedule( fd_exec_slot_ctx_t * slot_ctx,
}

fd_epoch_schedule_t *
fd_sysvar_epoch_schedule_read( fd_epoch_schedule_t * result,
fd_exec_slot_ctx_t * slot_ctx ) {
fd_sysvar_epoch_schedule_read( fd_epoch_schedule_t * result,
fd_exec_slot_ctx_t const * slot_ctx ) {
fd_epoch_schedule_t const * ret = fd_sysvar_cache_epoch_schedule( slot_ctx->sysvar_cache );
if( FD_UNLIKELY( NULL != ret ) ) {
fd_memcpy(result, ret, sizeof(fd_epoch_schedule_t));
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fd_sysvar_epoch_schedule_init( fd_exec_slot_ctx_t * slot_ctx );

fd_epoch_schedule_t *
fd_sysvar_epoch_schedule_read( fd_epoch_schedule_t * result,
fd_exec_slot_ctx_t * slot_ctx );
fd_exec_slot_ctx_t const * slot_ctx );

/* fd_epoch_schedule_derive derives an epoch schedule config from the
given parameters. New epoch schedule configurations should only be
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/sysvar/fd_sysvar_fees.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ write_fees( fd_exec_slot_ctx_t* slot_ctx, fd_sysvar_fees_t* fees ) {
}

fd_sysvar_fees_t *
fd_sysvar_fees_read( fd_sysvar_fees_t * result,
fd_exec_slot_ctx_t * slot_ctx ) {
fd_sysvar_fees_read( fd_sysvar_fees_t * result,
fd_exec_slot_ctx_t const * slot_ctx ) {
fd_sysvar_fees_t const * ret = fd_sysvar_cache_fees( slot_ctx->sysvar_cache );
if( FD_UNLIKELY( NULL != ret ) ) {
fd_memcpy(result, ret, sizeof(fd_sysvar_fees_t));
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/sysvar/fd_sysvar_fees.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ fd_sysvar_fees_init( fd_exec_slot_ctx_t * slot_ctx );

/* Reads the current value of the fees sysvar */
fd_sysvar_fees_t *
fd_sysvar_fees_read( fd_sysvar_fees_t * result,
fd_exec_slot_ctx_t * slot_ctx );
fd_sysvar_fees_read( fd_sysvar_fees_t * result,
fd_exec_slot_ctx_t const * slot_ctx );

void
fd_sysvar_fees_new_derived( fd_exec_slot_ctx_t * slot_ctx,
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/sysvar/fd_sysvar_rent.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define ACCOUNT_STORAGE_OVERHEAD (128)

fd_rent_t *
fd_sysvar_rent_read( fd_rent_t * result,
fd_exec_slot_ctx_t * slot_ctx ) {
fd_sysvar_rent_read( fd_rent_t * result,
fd_exec_slot_ctx_t const * slot_ctx ) {

fd_rent_t const * ret = fd_sysvar_cache_rent( slot_ctx->sysvar_cache );
if( FD_UNLIKELY( NULL != ret ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/sysvar/fd_sysvar_rent.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ fd_sysvar_rent_init( fd_exec_slot_ctx_t * slot_ctx );
Returns result on success, NULL otherwise. */

fd_rent_t *
fd_sysvar_rent_read( fd_rent_t * result,
fd_exec_slot_ctx_t * slot_ctx );
fd_sysvar_rent_read( fd_rent_t * result,
fd_exec_slot_ctx_t const * slot_ctx );

/* fd_rent_exempt_minimum_balance returns the minimum balance needed
for an account with the given data_len to be rent exempt. rent
Expand Down
Loading

0 comments on commit 030763a

Please sign in to comment.