Skip to content

Commit 265553b

Browse files
wip
1 parent 34ad731 commit 265553b

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

src/flamenco/runtime/context/fd_exec_txn_ctx.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,21 @@ struct fd_exec_txn_ctx {
146146

147147
fd_log_collector_t log_collector; /* Log collector instance */
148148

149-
/* Execution error and type, to match Agave. */
149+
/********************************************************************/
150+
151+
int can_land;
152+
/* If a transaction is fees only, it can land and a fee is paid,
153+
but the tgansaction will not be executed. */
154+
int fees_only;
155+
156+
int txn_err;
157+
/* These will only be set if the txn_err is set to
158+
FD_RUNTIME_TXN_ERR_INSTRUCTION_ERROR (-7). */
150159
int exec_err;
151160
int exec_err_kind;
161+
int exec_err_idx;
162+
163+
/********************************************************************/
152164

153165
/* The current instruction index being executed */
154166
int current_instr_idx;

src/flamenco/runtime/fd_runtime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ fd_runtime_pre_execute_check( fd_exec_txn_ctx_t * txn_ctx ) {
663663
/* Regardless of whether transaction accounts were loaded successfully, the transaction is
664664
included in the block and transaction fees are collected.
665665
https://github.com/anza-xyz/agave/blob/v2.1.6/svm/src/transaction_processor.rs#L341-L357 */
666-
txn_ctx->flags |= FD_TXN_P_FLAGS_FEES_ONLY;
666+
txn_ctx->fees_only = 1;
667667

668668
/* If the transaction fails to load, the "rollback" accounts will include one of the following:
669669
1. Nonce account only
@@ -1074,7 +1074,7 @@ fd_runtime_prepare_and_execute_txn( fd_banks_t * banks,
10741074
/* Execute the transaction. Note that fees-only transactions are still
10751075
marked as "executed". */
10761076
txn_ctx->flags |= FD_TXN_P_FLAGS_EXECUTE_SUCCESS;
1077-
if( FD_LIKELY( !( txn_ctx->flags & FD_TXN_P_FLAGS_FEES_ONLY ) ) ) {
1077+
if( FD_LIKELY( !txn_ctx->fees_only ) ) {
10781078
exec_res = fd_execute_txn( txn_ctx );
10791079
}
10801080

src/flamenco/runtime/tests/fd_txn_harness.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ fd_solfuzz_pb_txn_run( fd_solfuzz_runner_t * runner,
431431

432432
if( txn_result->sanitization_error ) {
433433
/* Collect fees for transactions that failed to load */
434-
if( txn_ctx->flags & FD_TXN_P_FLAGS_FEES_ONLY ) {
434+
if( txn_ctx->fees_only ) {
435435
txn_result->has_fee_details = true;
436436
txn_result->fee_details.prioritization_fee = txn_ctx->priority_fee;
437437
txn_result->fee_details.transaction_fee = txn_ctx->execution_fee;
@@ -502,7 +502,7 @@ fd_solfuzz_pb_txn_run( fd_solfuzz_runner_t * runner,
502502
/* If the transaction is a fees-only transaction, we have to create rollback accounts to iterate over and save. */
503503
fd_txn_account_t * accounts_to_save = txn_ctx->accounts;
504504
ulong accounts_cnt = txn_ctx->accounts_cnt;
505-
if( txn_ctx->flags & FD_TXN_P_FLAGS_FEES_ONLY ) {
505+
if( txn_ctx->fees_only ) {
506506
accounts_to_save = fd_spad_alloc( runner->spad, alignof(fd_txn_account_t), sizeof(fd_txn_account_t) * 2 );
507507
accounts_cnt = 0UL;
508508

0 commit comments

Comments
 (0)