Skip to content

Commit af9eb20

Browse files
wip
1 parent c6779f4 commit af9eb20

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/flamenco/runtime/fd_executor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ fd_executor_setup_executable_account( fd_runtime_t * runtime,
15621562
account will not exist within the executable accounts list. */
15631563
fd_pubkey_t * programdata_acc = &program_loader_state->inner.program.programdata_address;
15641564
fd_funk_txn_xid_t xid = { .ul = { fd_bank_slot_get( bank ), bank->idx } };
1565-
if( FD_LIKELY( fd_txn_account_init_from_funk_readonly( &runtime->executable.accounts[ *executable_idx ],
1565+
if( FD_LIKELY( fd_txn_account_init_from_funk_readonly( &runtime->accounts.executables[ *executable_idx ],
15661566
programdata_acc,
15671567
runtime->funk,
15681568
&xid )==0 ) ) {
@@ -1601,7 +1601,7 @@ fd_executor_setup_accounts_for_txn( fd_runtime_t * runtime,
16011601
# endif
16021602

16031603
txn_out->accounts.nonce_idx_in_txn = ULONG_MAX;
1604-
runtime->executable.cnt = executable_idx;
1604+
runtime->accounts.executable_cnt = executable_idx;
16051605

16061606
/* Set up instr infos from the txn descriptor. No Agave equivalent to this function. */
16071607
fd_executor_setup_instr_infos_from_txn_instrs( runtime, bank, txn_in, txn_out );

src/flamenco/runtime/fd_runtime.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ fd_runtime_prepare_and_execute_txn( fd_runtime_t * runtime,
13341334
memset( txn_out->details.return_data.program_id.key, 0, sizeof(fd_pubkey_t) );
13351335
fd_compute_budget_details_new( &txn_out->details.compute_budget );
13361336

1337-
runtime->executable.cnt = 0UL;
1337+
runtime->accounts.executable_cnt = 0UL;
13381338
runtime->log.enable_log_collector = 0;
13391339
runtime->instr.info_cnt = 0UL;
13401340
runtime->instr.trace_length = 0UL;
@@ -1794,9 +1794,9 @@ fd_runtime_get_executable_account( fd_runtime_t * runtime,
17941794
return FD_ACC_MGR_SUCCESS;
17951795
}
17961796

1797-
for( ushort i=0; i<runtime->executable.cnt; i++ ) {
1798-
if( memcmp( pubkey->uc, runtime->executable.accounts[i].pubkey->uc, sizeof(fd_pubkey_t) )==0 ) {
1799-
fd_txn_account_t * txn_account = &runtime->executable.accounts[i];
1797+
for( ushort i=0; i<runtime->accounts.executable_cnt; i++ ) {
1798+
if( memcmp( pubkey->uc, runtime->accounts.executables[i].pubkey->uc, sizeof(fd_pubkey_t) )==0 ) {
1799+
fd_txn_account_t * txn_account = &runtime->accounts.executables[i];
18001800
*account = txn_account;
18011801

18021802
if( FD_LIKELY( condition != NULL ) ) {

src/flamenco/runtime/fd_runtime.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ struct fd_runtime {
127127
} stake_program;
128128

129129
struct {
130-
ulong cnt; /* Number of BPF upgradeable loader accounts. */
131-
fd_txn_account_t accounts[ MAX_TX_ACCOUNT_LOCKS ]; /* Array of BPF upgradeable loader program data accounts */
132-
} executable;
130+
ulong executable_cnt; /* Number of BPF upgradeable loader accounts. */
131+
fd_txn_account_t executables[ MAX_TX_ACCOUNT_LOCKS ]; /* Array of BPF upgradeable loader program data accounts */
132+
} accounts;
133133
};
134134
typedef struct fd_runtime fd_runtime_t;
135135

src/flamenco/runtime/tests/fd_dump_pb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ create_instr_context_protobuf_from_instructions( fd_exec_test_instr_context_t *
901901

902902
/* Accounts */
903903
instr_context->accounts_count = (pb_size_t) txn_out->accounts.accounts_cnt;
904-
instr_context->accounts = fd_spad_alloc( spad, alignof(fd_exec_test_acct_state_t), (instr_context->accounts_count + num_sysvar_entries + runtime->executable.cnt) * sizeof(fd_exec_test_acct_state_t));
904+
instr_context->accounts = fd_spad_alloc( spad, alignof(fd_exec_test_acct_state_t), (instr_context->accounts_count + num_sysvar_entries + runtime->accounts.executable_cnt) * sizeof(fd_exec_test_acct_state_t));
905905
for( ulong i = 0; i < txn_out->accounts.accounts_cnt; i++ ) {
906906
// Copy account information over
907907
fd_txn_account_t const * txn_account = &txn_out->accounts.accounts[i];
@@ -933,16 +933,16 @@ create_instr_context_protobuf_from_instructions( fd_exec_test_instr_context_t *
933933
}
934934

935935
/* Add executable accounts */
936-
for( ulong i = 0; i < runtime->executable.cnt; i++ ) {
936+
for( ulong i = 0; i < runtime->accounts.executable_cnt; i++ ) {
937937
fd_txn_account_t txn_account[1];
938-
int ret = fd_txn_account_init_from_funk_readonly( txn_account, runtime->executable.accounts[i].pubkey, runtime->funk, &xid );
938+
int ret = fd_txn_account_init_from_funk_readonly( txn_account, runtime->accounts.executables[i].pubkey, runtime->funk, &xid );
939939
if( ret != FD_ACC_MGR_SUCCESS ) {
940940
continue;
941941
}
942942
// Make sure the account doesn't exist in the output accounts yet
943943
bool account_exists = false;
944944
for( ulong j = 0; j < instr_context->accounts_count; j++ ) {
945-
if( 0 == memcmp( instr_context->accounts[j].address, runtime->executable.accounts[i].pubkey->uc, sizeof(fd_pubkey_t) ) ) {
945+
if( 0 == memcmp( instr_context->accounts[j].address, runtime->accounts.executables[i].pubkey->uc, sizeof(fd_pubkey_t) ) ) {
946946
account_exists = true;
947947
break;
948948
}

src/flamenco/runtime/tests/fd_instr_harness.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fd_solfuzz_pb_instr_ctx_create( fd_solfuzz_runner_t * runner,
104104
fd_compute_budget_details_new( &txn_out->details.compute_budget );
105105
runtime->instr.stack_sz = 0;
106106
txn_out->accounts.accounts_cnt = 0UL;
107-
runtime->executable.cnt = 0UL;
107+
runtime->accounts.executable_cnt = 0UL;
108108

109109
txn_out->details.programs_to_reverify_cnt = 0UL;
110110
txn_out->details.loaded_accounts_data_size = 0UL;
@@ -243,13 +243,13 @@ fd_solfuzz_pb_instr_ctx_create( fd_solfuzz_runner_t * runner,
243243
}
244244

245245
fd_pubkey_t * programdata_acc = &program_loader_state->inner.program.programdata_address;
246-
if( FD_UNLIKELY( fd_txn_account_init_from_funk_readonly( &runtime->executable.accounts[runtime->executable.cnt],
246+
if( FD_UNLIKELY( fd_txn_account_init_from_funk_readonly( &runtime->accounts.executables[runtime->accounts.executable_cnt],
247247
programdata_acc,
248248
runtime->funk,
249249
xid ) ) ) {
250250
continue;
251251
}
252-
runtime->executable.cnt++;
252+
runtime->accounts.executable_cnt++;
253253
}
254254
}
255255

0 commit comments

Comments
 (0)