@@ -462,7 +462,7 @@ load_transaction_account( fd_runtime_t * runtime,
462462 fd_txn_account_t * acct ,
463463 uchar is_writable ,
464464 uchar unknown_acc ,
465- ulong txn_idx ) {
465+ ulong acc_idx ) {
466466
467467 /* Handling the sysvar instructions account explictly.
468468 https://github.com/anza-xyz/agave/blob/v2.3.1/svm/src/account_loader.rs#L817-L824 */
@@ -471,7 +471,7 @@ load_transaction_account( fd_runtime_t * runtime,
471471 constructed by the SVM and modified within each transaction's
472472 instruction execution only, so it incurs a loaded size cost
473473 of 0. */
474- fd_sysvar_instructions_serialize_account ( txn_in , txn_out , (fd_instr_info_t const * )runtime -> instr .infos , TXN ( txn_in -> txn )-> instr_cnt , txn_idx );
474+ fd_sysvar_instructions_serialize_account ( txn_in , txn_out , (fd_instr_info_t const * )runtime -> instr .infos , TXN ( txn_in -> txn )-> instr_cnt , acc_idx );
475475 return 0UL ;
476476 }
477477
@@ -491,6 +491,7 @@ load_transaction_account( fd_runtime_t * runtime,
491491 /* https://github.com/anza-xyz/agave/blob/v2.3.1/svm/src/account_loader.rs#L828-L835 */
492492 if ( is_writable ) {
493493 acct -> starting_lamports = fd_txn_account_get_lamports ( acct ); /* TODO: why do we do this everywhere? */
494+ txn_out -> accounts .starting_lamports [ acc_idx ] = txn_out -> accounts .metas [ acc_idx ]-> lamports ;
494495 }
495496 return fd_ulong_sat_add ( base_account_size , fd_txn_account_get_data_len ( acct ) );
496497 }
@@ -1421,12 +1422,12 @@ fd_execute_instr( fd_runtime_t * runtime,
14211422}
14221423
14231424void
1424- fd_executor_reclaim_account ( fd_txn_account_t * account ,
1425+ fd_executor_reclaim_account ( fd_account_meta_t * meta ,
14251426 ulong slot ) {
1426- fd_txn_account_set_slot ( account , slot ) ;
1427- if ( FD_UNLIKELY ( fd_txn_account_get_lamports ( account ) == 0UL ) ) {
1428- fd_txn_account_set_data_len ( account , 0UL ) ;
1429- fd_txn_account_clear_owner ( account );
1427+ meta -> slot = slot ;
1428+ if ( FD_UNLIKELY ( meta -> lamports == 0UL ) ) {
1429+ meta -> dlen = 0UL ;
1430+ fd_memset ( meta -> owner , 0 , sizeof ( fd_pubkey_t ) );
14301431 }
14311432}
14321433
@@ -1702,28 +1703,12 @@ fd_executor_txn_check( fd_bank_t * bank,
17021703
17031704 /* https://github.com/anza-xyz/agave/blob/b2c388d6cbff9b765d574bbb83a4378a1fc8af32/svm/src/account_rent_state.rs#L50 */
17041705 if ( before_uninitialized || before_rent_exempt ) {
1705- FD_LOG_DEBUG (( "Rent exempt error for %s Curr len %lu Starting len %lu Curr lamports %lu Starting lamports %lu Curr exempt %lu Starting exempt %lu" ,
1706- FD_BASE58_ENC_32_ALLOCA ( b -> pubkey -> uc ),
1707- fd_txn_account_get_data_len ( b ),
1708- b -> starting_dlen ,
1709- fd_txn_account_get_lamports ( b ),
1710- b -> starting_lamports ,
1711- fd_rent_exempt_minimum_balance ( rent , fd_txn_account_get_data_len ( b ) ),
1712- fd_rent_exempt_minimum_balance ( rent , b -> starting_dlen ) ));
17131706 /* https://github.com/anza-xyz/agave/blob/b2c388d6cbff9b765d574bbb83a4378a1fc8af32/svm/src/account_rent_state.rs#L104 */
17141707 return FD_RUNTIME_TXN_ERR_INSUFFICIENT_FUNDS_FOR_RENT ;
17151708 /* https://github.com/anza-xyz/agave/blob/b2c388d6cbff9b765d574bbb83a4378a1fc8af32/svm/src/account_rent_state.rs#L56 */
17161709 } else if ( (fd_txn_account_get_data_len ( b ) == b -> starting_dlen ) && fd_txn_account_get_lamports ( b ) <= b -> starting_lamports ) {
17171710 // no-op
17181711 } else {
1719- FD_LOG_DEBUG (( "Rent exempt error for %s Curr len %lu Starting len %lu Curr lamports %lu Starting lamports %lu Curr exempt %lu Starting exempt %lu" ,
1720- FD_BASE58_ENC_32_ALLOCA ( b -> pubkey -> uc ),
1721- fd_txn_account_get_data_len ( b ),
1722- b -> starting_dlen ,
1723- fd_txn_account_get_lamports ( b ),
1724- b -> starting_lamports ,
1725- fd_rent_exempt_minimum_balance ( rent , fd_txn_account_get_data_len ( b ) ),
1726- fd_rent_exempt_minimum_balance ( rent , b -> starting_dlen ) ));
17271712 /* https://github.com/anza-xyz/agave/blob/b2c388d6cbff9b765d574bbb83a4378a1fc8af32/svm/src/account_rent_state.rs#L104 */
17281713 return FD_RUNTIME_TXN_ERR_INSUFFICIENT_FUNDS_FOR_RENT ;
17291714 }
0 commit comments