@@ -279,9 +279,10 @@ fd_hash_bank( fd_exec_slot_ctx_t * slot_ctx,
279
279
280
280
// https://github.com/anza-xyz/agave/blob/766cd682423b8049ddeac3c0ec6cebe0a1356e9e/runtime/src/bank.rs#L5250
281
281
if ( FD_FEATURE_ACTIVE ( slot_ctx -> slot , slot_ctx -> epoch_ctx -> features , accounts_lt_hash ) ) {
282
+ fd_slot_lthash_t * slot_lthash = fd_bank_mgr_slot_lthash_query ( slot_ctx -> bank_mgr );
282
283
fd_sha256_init ( & sha );
283
284
fd_sha256_append ( & sha , (uchar const * ) & hash -> hash , sizeof ( fd_hash_t ) );
284
- fd_sha256_append ( & sha , (uchar const * ) & slot_ctx -> slot_bank . lthash . lthash , sizeof ( slot_ctx -> slot_bank . lthash . lthash ) );
285
+ fd_sha256_append ( & sha , (uchar const * ) slot_lthash , sizeof ( fd_slot_lthash_t ) );
285
286
fd_sha256_fini ( & sha , hash -> hash );
286
287
} else {
287
288
if (fd_should_include_epoch_accounts_hash (slot_ctx )) {
@@ -297,7 +298,9 @@ fd_hash_bank( fd_exec_slot_ctx_t * slot_ctx,
297
298
298
299
if ( FD_FEATURE_ACTIVE ( slot_ctx -> slot , slot_ctx -> epoch_ctx -> features , accounts_lt_hash ) ) {
299
300
lthash = (uchar * )fd_alloca_check ( 1UL , 32UL );
300
- fd_lthash_hash ((fd_lthash_value_t * ) slot_ctx -> slot_bank .lthash .lthash , lthash );
301
+ fd_slot_lthash_t * slot_lthash = fd_bank_mgr_slot_lthash_modify ( slot_ctx -> bank_mgr );
302
+ fd_lthash_hash ((fd_lthash_value_t * ) slot_lthash , lthash );
303
+ fd_bank_mgr_slot_lthash_save ( slot_ctx -> bank_mgr );
301
304
}
302
305
303
306
fd_solcap_write_bank_preimage (
@@ -310,6 +313,7 @@ fd_hash_bank( fd_exec_slot_ctx_t * slot_ctx,
310
313
signature_cnt );
311
314
}
312
315
316
+ fd_slot_lthash_t * slot_lthash = fd_bank_mgr_slot_lthash_query ( slot_ctx -> bank_mgr );
313
317
if ( FD_FEATURE_ACTIVE ( slot_ctx -> slot , slot_ctx -> epoch_ctx -> features , remove_accounts_delta_hash ) ) {
314
318
FD_LOG_NOTICE (( "\n\n[Replay]\n"
315
319
"slot: %lu\n"
@@ -321,7 +325,7 @@ fd_hash_bank( fd_exec_slot_ctx_t * slot_ctx,
321
325
slot_ctx -> slot ,
322
326
FD_BASE58_ENC_32_ALLOCA ( hash -> hash ),
323
327
FD_BASE58_ENC_32_ALLOCA ( slot_ctx -> slot_bank .prev_banks_hash .hash ),
324
- FD_LTHASH_ENC_32_ALLOCA ( (fd_lthash_value_t * ) slot_ctx -> slot_bank . lthash . lthash ),
328
+ FD_LTHASH_ENC_32_ALLOCA ( (fd_lthash_value_t * ) slot_lthash ),
325
329
signature_cnt ,
326
330
FD_BASE58_ENC_32_ALLOCA ( poh -> hash ) ));
327
331
} else {
@@ -337,7 +341,7 @@ fd_hash_bank( fd_exec_slot_ctx_t * slot_ctx,
337
341
FD_BASE58_ENC_32_ALLOCA ( hash -> hash ),
338
342
FD_BASE58_ENC_32_ALLOCA ( slot_ctx -> slot_bank .prev_banks_hash .hash ),
339
343
FD_BASE58_ENC_32_ALLOCA ( slot_ctx -> account_delta_hash .hash ),
340
- FD_LTHASH_ENC_32_ALLOCA ( (fd_lthash_value_t * ) slot_ctx -> slot_bank . lthash . lthash ),
344
+ FD_LTHASH_ENC_32_ALLOCA ( (fd_lthash_value_t * ) slot_lthash ),
341
345
signature_cnt ,
342
346
FD_BASE58_ENC_32_ALLOCA ( poh -> hash ) ));
343
347
}
@@ -521,7 +525,8 @@ fd_update_hash_bank_exec_hash( fd_exec_slot_ctx_t * slot_ctx,
521
525
fd_funk_txn_t * txn = slot_ctx -> funk_txn ;
522
526
523
527
// Apply the lthash changes to the bank lthash
524
- fd_lthash_value_t * lt_hash = (fd_lthash_value_t * )fd_type_pun ( slot_ctx -> slot_bank .lthash .lthash );
528
+ fd_slot_lthash_t * slot_lthash = fd_bank_mgr_slot_lthash_query ( slot_ctx -> bank_mgr );
529
+ fd_lthash_value_t * lt_hash = (fd_lthash_value_t * )fd_type_pun ( slot_lthash );
525
530
for ( ulong i = 0 ; i < lt_hashes_cnt ; i ++ ) {
526
531
fd_lthash_add ( lt_hash , & lt_hashes [i ] );
527
532
}
@@ -1314,7 +1319,6 @@ fd_snapshot_service_inc_hash( fd_hash_t * accounts_hash,
1314
1319
void
1315
1320
fd_accounts_check_lthash ( fd_funk_t * funk ,
1316
1321
fd_funk_txn_t * funk_txn ,
1317
- fd_slot_bank_t * slot_bank ,
1318
1322
fd_spad_t * runtime_spad ,
1319
1323
fd_features_t * features ) {
1320
1324
@@ -1400,8 +1404,11 @@ fd_accounts_check_lthash( fd_funk_t * funk,
1400
1404
}
1401
1405
}
1402
1406
1403
- // Compare the accumulator to the slot
1404
- fd_lthash_value_t * acc = (fd_lthash_value_t * )fd_type_pun_const ( slot_bank -> lthash .lthash );
1407
+ // Compare the accumulator to the slot lthash
1408
+
1409
+ FD_BANK_MGR_DECL ( bank_mgr , funk , funk_txn );
1410
+ fd_slot_lthash_t * slot_lthash = fd_bank_mgr_slot_lthash_query ( bank_mgr );
1411
+ fd_lthash_value_t * acc = (fd_lthash_value_t * )fd_type_pun_const ( slot_lthash );
1405
1412
if ( memcmp ( acc , & acc_lthash , sizeof ( fd_lthash_value_t ) ) == 0 ) {
1406
1413
FD_LOG_NOTICE (("accounts_lthash %s == %s" , FD_LTHASH_ENC_32_ALLOCA (acc ), FD_LTHASH_ENC_32_ALLOCA (& acc_lthash )));
1407
1414
} else {
0 commit comments