diff --git a/src/flamenco/runtime/context/fd_exec_txn_ctx.h b/src/flamenco/runtime/context/fd_exec_txn_ctx.h index d4560469b1..1af772eea1 100644 --- a/src/flamenco/runtime/context/fd_exec_txn_ctx.h +++ b/src/flamenco/runtime/context/fd_exec_txn_ctx.h @@ -146,9 +146,21 @@ struct fd_exec_txn_ctx { fd_log_collector_t log_collector; /* Log collector instance */ - /* Execution error and type, to match Agave. */ + /********************************************************************/ + + int can_land; + /* If a transaction is fees only, it can land and a fee is paid, + but the tgansaction will not be executed. */ + int fees_only; + + int txn_err; + /* These will only be set if the txn_err is set to + FD_RUNTIME_TXN_ERR_INSTRUCTION_ERROR (-7). */ int exec_err; int exec_err_kind; + int exec_err_idx; + + /********************************************************************/ /* The current instruction index being executed */ int current_instr_idx; diff --git a/src/flamenco/runtime/fd_runtime.c b/src/flamenco/runtime/fd_runtime.c index 013e7f41e2..9638dc5ec3 100644 --- a/src/flamenco/runtime/fd_runtime.c +++ b/src/flamenco/runtime/fd_runtime.c @@ -663,7 +663,7 @@ fd_runtime_pre_execute_check( fd_exec_txn_ctx_t * txn_ctx ) { /* Regardless of whether transaction accounts were loaded successfully, the transaction is included in the block and transaction fees are collected. https://github.com/anza-xyz/agave/blob/v2.1.6/svm/src/transaction_processor.rs#L341-L357 */ - txn_ctx->flags |= FD_TXN_P_FLAGS_FEES_ONLY; + txn_ctx->fees_only = 1; /* If the transaction fails to load, the "rollback" accounts will include one of the following: 1. Nonce account only @@ -1074,7 +1074,7 @@ fd_runtime_prepare_and_execute_txn( fd_banks_t * banks, /* Execute the transaction. Note that fees-only transactions are still marked as "executed". */ txn_ctx->flags |= FD_TXN_P_FLAGS_EXECUTE_SUCCESS; - if( FD_LIKELY( !( txn_ctx->flags & FD_TXN_P_FLAGS_FEES_ONLY ) ) ) { + if( FD_LIKELY( !txn_ctx->fees_only ) ) { exec_res = fd_execute_txn( txn_ctx ); } diff --git a/src/flamenco/runtime/tests/fd_txn_harness.c b/src/flamenco/runtime/tests/fd_txn_harness.c index fac0070f26..61ca3661d7 100644 --- a/src/flamenco/runtime/tests/fd_txn_harness.c +++ b/src/flamenco/runtime/tests/fd_txn_harness.c @@ -431,7 +431,7 @@ fd_solfuzz_pb_txn_run( fd_solfuzz_runner_t * runner, if( txn_result->sanitization_error ) { /* Collect fees for transactions that failed to load */ - if( txn_ctx->flags & FD_TXN_P_FLAGS_FEES_ONLY ) { + if( txn_ctx->fees_only ) { txn_result->has_fee_details = true; txn_result->fee_details.prioritization_fee = txn_ctx->priority_fee; txn_result->fee_details.transaction_fee = txn_ctx->execution_fee; @@ -502,7 +502,7 @@ fd_solfuzz_pb_txn_run( fd_solfuzz_runner_t * runner, /* If the transaction is a fees-only transaction, we have to create rollback accounts to iterate over and save. */ fd_txn_account_t * accounts_to_save = txn_ctx->accounts; ulong accounts_cnt = txn_ctx->accounts_cnt; - if( txn_ctx->flags & FD_TXN_P_FLAGS_FEES_ONLY ) { + if( txn_ctx->fees_only ) { accounts_to_save = fd_spad_alloc( runner->spad, alignof(fd_txn_account_t), sizeof(fd_txn_account_t) * 2 ); accounts_cnt = 0UL;