Skip to content

Commit b670714

Browse files
wip
1 parent 402d543 commit b670714

File tree

4 files changed

+43
-32
lines changed

4 files changed

+43
-32
lines changed

src/flamenco/runtime/context/fd_exec_txn_ctx.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -144,31 +144,6 @@ fd_exec_txn_ctx_get_key_of_account_at_index( fd_exec_txn_ctx_t * ctx,
144144
return FD_EXECUTOR_INSTR_SUCCESS;
145145
}
146146

147-
void
148-
fd_exec_txn_ctx_setup_basic( fd_exec_txn_ctx_t * ctx ) {
149-
fd_compute_budget_details_new( &ctx->details.compute_budget );
150-
ctx->instr.stack_sz = 0;
151-
ctx->accounts.accounts_cnt = 0UL;
152-
ctx->accounts.executable_cnt = 0UL;
153-
ctx->prog_cache.programs_to_reverify_cnt = 0UL;
154-
155-
ctx->details.loaded_accounts_data_size = 0UL;
156-
ctx->details.loaded_accounts_data_size_cost = 0UL;
157-
ctx->details.accounts_resize_delta = 0UL;
158-
159-
memset( ctx->details.return_data.program_id.key, 0, sizeof(fd_pubkey_t) );
160-
ctx->details.return_data.len = 0;
161-
162-
ctx->log.capture_ctx = NULL;
163-
164-
ctx->instr.info_cnt = 0UL;
165-
ctx->instr.trace_length = 0UL;
166-
167-
ctx->err.exec_err = 0;
168-
ctx->err.exec_err_kind = FD_EXECUTOR_ERR_KIND_NONE;
169-
ctx->instr.current_idx = 0;
170-
}
171-
172147
void
173148
fd_exec_txn_ctx_teardown( fd_exec_txn_ctx_t * ctx ) {
174149
(void)ctx;

src/flamenco/runtime/context/fd_exec_txn_ctx.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ fd_exec_txn_ctx_leave( fd_exec_txn_ctx_t * ctx );
208208
void *
209209
fd_exec_txn_ctx_delete( void * mem );
210210

211-
/* Sets up a basic transaction ctx without a txn descriptor or txn raw. Useful
212-
for mocking transaction context objects for instructions. */
213-
void
214-
fd_exec_txn_ctx_setup_basic( fd_exec_txn_ctx_t * ctx );
215-
216211
void
217212
fd_exec_txn_ctx_teardown( fd_exec_txn_ctx_t * txn_ctx );
218213

src/flamenco/runtime/program/fd_bpf_loader_program.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,27 @@ fd_directly_invoke_loader_v3_deploy( fd_bank_t * bank,
26292629
NULL,
26302630
0UL );
26312631

2632-
fd_exec_txn_ctx_setup_basic( txn_ctx );
2632+
fd_compute_budget_details_new( &txn_ctx->details.compute_budget );
2633+
txn_ctx->accounts.accounts_cnt = 0UL;
2634+
txn_ctx->accounts.executable_cnt = 0UL;
2635+
txn_ctx->prog_cache.programs_to_reverify_cnt = 0UL;
2636+
2637+
txn_ctx->details.loaded_accounts_data_size = 0UL;
2638+
txn_ctx->details.loaded_accounts_data_size_cost = 0UL;
2639+
txn_ctx->details.accounts_resize_delta = 0UL;
2640+
2641+
memset( txn_ctx->details.return_data.program_id.key, 0, sizeof(fd_pubkey_t) );
2642+
txn_ctx->details.return_data.len = 0;
2643+
2644+
txn_ctx->log.capture_ctx = NULL;
2645+
2646+
txn_ctx->instr.info_cnt = 0UL;
2647+
txn_ctx->instr.trace_length = 0UL;
2648+
2649+
txn_ctx->err.exec_err = 0;
2650+
txn_ctx->err.exec_err_kind = FD_EXECUTOR_ERR_KIND_NONE;
2651+
txn_ctx->instr.current_idx = 0;
2652+
26332653
txn_ctx->instr.stack_sz = 1;
26342654
fd_exec_instr_ctx_t * instr_ctx = &txn_ctx->instr.stack[0];
26352655
*instr_ctx = (fd_exec_instr_ctx_t) {

src/flamenco/runtime/tests/fd_instr_harness.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,28 @@ fd_solfuzz_pb_instr_ctx_create( fd_solfuzz_runner_t * runner,
9090
NULL,
9191
progcache_scratch,
9292
FD_PROGCACHE_SCRATCH_FOOTPRINT );
93-
fd_exec_txn_ctx_setup_basic( txn_ctx );
93+
94+
fd_compute_budget_details_new( &txn_ctx->details.compute_budget );
95+
txn_ctx->instr.stack_sz = 0;
96+
txn_ctx->accounts.accounts_cnt = 0UL;
97+
txn_ctx->accounts.executable_cnt = 0UL;
98+
txn_ctx->prog_cache.programs_to_reverify_cnt = 0UL;
99+
100+
txn_ctx->details.loaded_accounts_data_size = 0UL;
101+
txn_ctx->details.loaded_accounts_data_size_cost = 0UL;
102+
txn_ctx->details.accounts_resize_delta = 0UL;
103+
104+
memset( txn_ctx->details.return_data.program_id.key, 0, sizeof(fd_pubkey_t) );
105+
txn_ctx->details.return_data.len = 0;
106+
107+
txn_ctx->log.capture_ctx = NULL;
108+
109+
txn_ctx->instr.info_cnt = 0UL;
110+
txn_ctx->instr.trace_length = 0UL;
111+
112+
txn_ctx->err.exec_err = 0;
113+
txn_ctx->err.exec_err_kind = FD_EXECUTOR_ERR_KIND_NONE;
114+
txn_ctx->instr.current_idx = 0;
94115

95116
txn_ctx->txn = *txn;
96117
txn_ctx->details.compute_budget.compute_unit_limit = test_ctx->cu_avail;

0 commit comments

Comments
 (0)