@@ -273,7 +273,8 @@ fd_runtime_validate_fee_collector( fd_exec_slot_ctx_t const * slot_ctx,
273
273
We already know that the post deposit balance is >0 because we are paying a >0 amount.
274
274
So TLDR we just check if the account is rent exempt.
275
275
*/
276
- ulong minbal = fd_rent_exempt_minimum_balance ( fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache ), collector -> vt -> get_data_len ( collector ) );
276
+ ulong minbal = fd_rent_exempt_minimum_balance ( fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache , slot_ctx -> runtime_wksp ),
277
+ collector -> vt -> get_data_len ( collector ) );
277
278
if ( FD_UNLIKELY ( collector -> vt -> get_lamports ( collector ) + fee < minbal ) ) {
278
279
FD_BASE58_ENCODE_32_BYTES ( collector -> pubkey -> key , _out_key );
279
280
FD_LOG_WARNING (("cannot pay a rent paying account (%s)" , _out_key ));
@@ -467,7 +468,7 @@ fd_runtime_freeze( fd_exec_slot_ctx_t * slot_ctx, fd_spad_t * runtime_spad ) {
467
468
fd_sysvar_recent_hashes_update ( slot_ctx , runtime_spad );
468
469
469
470
if ( !FD_FEATURE_ACTIVE ( slot_ctx -> slot_bank .slot , slot_ctx -> epoch_ctx -> features , disable_fees_sysvar ) )
470
- fd_sysvar_fees_update (slot_ctx );
471
+ fd_sysvar_fees_update ( slot_ctx , runtime_spad );
471
472
472
473
ulong fees = 0UL ;
473
474
ulong burn = 0UL ;
@@ -531,6 +532,9 @@ fd_runtime_freeze( fd_exec_slot_ctx_t * slot_ctx, fd_spad_t * runtime_spad ) {
531
532
532
533
FD_LOG_DEBUG (( "fd_runtime_freeze: capitalization %lu " , slot_ctx -> slot_bank .capitalization ));
533
534
slot_ctx -> slot_bank .collected_rent = 0 ;
535
+
536
+ /* At this point we want to invalidate the sysvar cache entries. */
537
+ fd_sysvar_cache_invalidate ( slot_ctx -> sysvar_cache );
534
538
}
535
539
536
540
#define FD_RENT_EXEMPT (-1L)
@@ -990,13 +994,13 @@ fd_runtime_block_sysvar_update_pre_execute( fd_exec_slot_ctx_t * slot_ctx,
990
994
double clock_update_time_ms = (double )clock_update_time * 1e-6 ;
991
995
FD_LOG_INFO (( "clock updated - slot: %lu, elapsed: %6.6f ms" , slot_ctx -> slot_bank .slot , clock_update_time_ms ));
992
996
if ( !FD_FEATURE_ACTIVE ( slot_ctx -> slot_bank .slot , slot_ctx -> epoch_ctx -> features , disable_fees_sysvar ) ) {
993
- fd_sysvar_fees_update (slot_ctx );
997
+ fd_sysvar_fees_update ( slot_ctx , runtime_spad );
994
998
}
995
999
// It has to go into the current txn previous info but is not in slot 0
996
1000
if ( slot_ctx -> slot_bank .slot != 0 ) {
997
1001
fd_sysvar_slot_hashes_update ( slot_ctx , runtime_spad );
998
1002
}
999
- fd_sysvar_last_restart_slot_update ( slot_ctx );
1003
+ fd_sysvar_last_restart_slot_update ( slot_ctx , runtime_spad );
1000
1004
1001
1005
return 0 ;
1002
1006
}
@@ -2341,7 +2345,7 @@ fd_new_target_program_account( fd_exec_slot_ctx_t * slot_ctx,
2341
2345
};
2342
2346
2343
2347
/* https://github.com/anza-xyz/agave/blob/v2.1.0/runtime/src/bank/builtins/core_bpf_migration/mod.rs#L89-L90 */
2344
- fd_rent_t const * rent = fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache );
2348
+ fd_rent_t const * rent = fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache , slot_ctx -> runtime_wksp );
2345
2349
if ( FD_UNLIKELY ( rent == NULL ) ) {
2346
2350
return -1 ;
2347
2351
}
@@ -2414,7 +2418,7 @@ fd_new_target_program_data_account( fd_exec_slot_ctx_t * slot_ctx,
2414
2418
}
2415
2419
2416
2420
/* https://github.com/anza-xyz/agave/blob/v2.1.0/runtime/src/bank/builtins/core_bpf_migration/mod.rs#L127-L132 */
2417
- const fd_rent_t * rent = fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache );
2421
+ const fd_rent_t * rent = fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache , slot_ctx -> runtime_wksp );
2418
2422
if ( FD_UNLIKELY ( rent == NULL ) ) {
2419
2423
return -1 ;
2420
2424
}
@@ -2859,6 +2863,7 @@ fd_runtime_process_new_epoch( fd_exec_slot_ctx_t * slot_ctx,
2859
2863
int is_some = fd_new_warmup_cooldown_rate_epoch ( slot_ctx -> slot_bank .slot ,
2860
2864
slot_ctx -> sysvar_cache ,
2861
2865
& slot_ctx -> epoch_ctx -> features ,
2866
+ slot_ctx -> runtime_wksp ,
2862
2867
new_rate_activation_epoch ,
2863
2868
_err );
2864
2869
if ( FD_UNLIKELY ( !is_some ) ) {
@@ -2891,7 +2896,7 @@ fd_runtime_process_new_epoch( fd_exec_slot_ctx_t * slot_ctx,
2891
2896
2892
2897
/* Refresh vote accounts in stakes cache using updated stake weights, and merges slot bank vote accounts with the epoch bank vote accounts.
2893
2898
https://github.com/anza-xyz/agave/blob/v2.1.6/runtime/src/stakes.rs#L363-L370 */
2894
- fd_stake_history_t const * history = fd_sysvar_cache_stake_history ( slot_ctx -> sysvar_cache );
2899
+ fd_stake_history_t const * history = fd_sysvar_cache_stake_history ( slot_ctx -> sysvar_cache , slot_ctx -> runtime_wksp );
2895
2900
if ( FD_UNLIKELY ( !history ) ) {
2896
2901
FD_LOG_ERR (( "StakeHistory sysvar is missing from sysvar cache" ));
2897
2902
}
0 commit comments