@@ -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
}
@@ -2321,7 +2325,7 @@ fd_new_target_program_account( fd_exec_slot_ctx_t * slot_ctx,
2321
2325
};
2322
2326
2323
2327
/* https://github.com/anza-xyz/agave/blob/v2.1.0/runtime/src/bank/builtins/core_bpf_migration/mod.rs#L89-L90 */
2324
- fd_rent_t const * rent = fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache );
2328
+ fd_rent_t const * rent = fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache , slot_ctx -> runtime_wksp );
2325
2329
if ( FD_UNLIKELY ( rent == NULL ) ) {
2326
2330
return -1 ;
2327
2331
}
@@ -2394,7 +2398,7 @@ fd_new_target_program_data_account( fd_exec_slot_ctx_t * slot_ctx,
2394
2398
}
2395
2399
2396
2400
/* https://github.com/anza-xyz/agave/blob/v2.1.0/runtime/src/bank/builtins/core_bpf_migration/mod.rs#L127-L132 */
2397
- const fd_rent_t * rent = fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache );
2401
+ const fd_rent_t * rent = fd_sysvar_cache_rent ( slot_ctx -> sysvar_cache , slot_ctx -> runtime_wksp );
2398
2402
if ( FD_UNLIKELY ( rent == NULL ) ) {
2399
2403
return -1 ;
2400
2404
}
@@ -2839,6 +2843,7 @@ fd_runtime_process_new_epoch( fd_exec_slot_ctx_t * slot_ctx,
2839
2843
int is_some = fd_new_warmup_cooldown_rate_epoch ( slot_ctx -> slot_bank .slot ,
2840
2844
slot_ctx -> sysvar_cache ,
2841
2845
& slot_ctx -> epoch_ctx -> features ,
2846
+ slot_ctx -> runtime_wksp ,
2842
2847
new_rate_activation_epoch ,
2843
2848
_err );
2844
2849
if ( FD_UNLIKELY ( !is_some ) ) {
@@ -2871,7 +2876,7 @@ fd_runtime_process_new_epoch( fd_exec_slot_ctx_t * slot_ctx,
2871
2876
2872
2877
/* Refresh vote accounts in stakes cache using updated stake weights, and merges slot bank vote accounts with the epoch bank vote accounts.
2873
2878
https://github.com/anza-xyz/agave/blob/v2.1.6/runtime/src/stakes.rs#L363-L370 */
2874
- fd_stake_history_t const * history = fd_sysvar_cache_stake_history ( slot_ctx -> sysvar_cache );
2879
+ fd_stake_history_t const * history = fd_sysvar_cache_stake_history ( slot_ctx -> sysvar_cache , slot_ctx -> runtime_wksp );
2875
2880
if ( FD_UNLIKELY ( !history ) ) {
2876
2881
FD_LOG_ERR (( "StakeHistory sysvar is missing from sysvar cache" ));
2877
2882
}
0 commit comments