Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/flamenco/runtime/context/fd_exec_txn_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/fd_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 );
}

Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/runtime/tests/fd_txn_harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
Loading