Skip to content

Commit a1c1638

Browse files
riptlripatel-fd
authored andcommitted
runtime: remove fd_directly_invoke_loader_v3_deploy
1 parent 3c288f2 commit a1c1638

File tree

3 files changed

+1
-102
lines changed

3 files changed

+1
-102
lines changed

src/flamenco/runtime/fd_core_bpf_migration.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,7 @@ migrate_builtin_to_core_bpf1( fd_core_bpf_migration_config_t const * config,
372372
}
373373

374374
assert( new_target_program_data->data_sz>=PROGRAMDATA_METADATA_SIZE );
375-
if( FD_UNLIKELY( !fd_directly_invoke_loader_v3_deploy(
376-
bank,
377-
funk,
378-
funk->shmem,
379-
&target->program_account->addr,
380-
new_target_program_data->data +PROGRAMDATA_METADATA_SIZE,
381-
new_target_program_data->data_sz-PROGRAMDATA_METADATA_SIZE ) ) ) {
382-
return;
383-
}
375+
/* FIXME call fd_directly_invoke_loader_v3_deploy */
384376

385377
ulong lamports_to_burn;
386378
if( FD_UNLIKELY( __builtin_uaddl_overflow(

src/flamenco/runtime/program/fd_bpf_loader_program.c

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,74 +2569,3 @@ fd_bpf_loader_program_execute( fd_exec_instr_ctx_t * ctx ) {
25692569

25702570
return fd_bpf_execute( ctx, cache_entry, is_deprecated );
25712571
}
2572-
2573-
2574-
/* Public APIs */
2575-
2576-
int
2577-
fd_directly_invoke_loader_v3_deploy( fd_bank_t * bank,
2578-
fd_funk_t * funk,
2579-
void * accdb_shfunk,
2580-
fd_pubkey_t const * program_key,
2581-
uchar const * elf,
2582-
ulong elf_sz ) {
2583-
FD_LOG_ERR(( "fd_directly_invoke_loader_v3_deploy is not implemented" ));
2584-
2585-
(void)bank;
2586-
(void)funk;
2587-
(void)accdb_shfunk;
2588-
(void)program_key;
2589-
(void)elf;
2590-
(void)elf_sz;
2591-
2592-
// /* Set up a dummy instr and txn context.
2593-
// FIXME: Memory for a txn context needs to be allocated */
2594-
// fd_exec_txn_ctx_t * txn_ctx = fd_exec_txn_ctx_join( fd_exec_txn_ctx_new( NULL ) );
2595-
2596-
// if( FD_UNLIKELY( !fd_funk_join( funk, accdb_shfunk ) ) ) {
2597-
// FD_LOG_CRIT(( "fd_funk_join(accdb) failed" ));
2598-
// }
2599-
// txn_ctx->bank_hash_cmp = NULL;
2600-
// txn_ctx->log.enable_exec_recording = !!(bank->flags & FD_BANK_FLAGS_EXEC_RECORDING);
2601-
// txn_ctx->bank = bank;
2602-
2603-
// fd_txn_out_t txn_out;
2604-
// fd_compute_budget_details_new( &txn_out.details.compute_budget );
2605-
// txn_out.accounts.accounts_cnt = 0UL;
2606-
// txn_out.accounts.executable_cnt = 0UL;
2607-
2608-
// txn_out.details.programs_to_reverify_cnt = 0UL;
2609-
// txn_out.details.loaded_accounts_data_size = 0UL;
2610-
// txn_out.details.loaded_accounts_data_size_cost = 0UL;
2611-
// txn_out.details.accounts_resize_delta = 0UL;
2612-
2613-
// memset( txn_out.details.return_data.program_id.key, 0, sizeof(fd_pubkey_t) );
2614-
// txn_out.details.return_data.len = 0;
2615-
2616-
// txn_ctx->log.capture_ctx = NULL;
2617-
2618-
// txn_ctx->instr.info_cnt = 0UL;
2619-
// txn_ctx->instr.trace_length = 0UL;
2620-
2621-
// txn_out.err.exec_err = 0;
2622-
// txn_out.err.exec_err_kind = FD_EXECUTOR_ERR_KIND_NONE;
2623-
// txn_ctx->instr.current_idx = 0;
2624-
2625-
// txn_ctx->instr.stack_sz = 1;
2626-
// fd_exec_instr_ctx_t * instr_ctx = &txn_ctx->instr.stack[0];
2627-
// *instr_ctx = (fd_exec_instr_ctx_t) {
2628-
// .instr = NULL,
2629-
// .txn_ctx = txn_ctx,
2630-
// .txn_out = &txn_out,
2631-
// };
2632-
2633-
/* Important note: this function is called at the epoch boundary and
2634-
does not do anything with the `programs_to_reverify` field in the
2635-
transaction context. This is fine though because when this function
2636-
is called, the program will not exist in the cache yet (because it
2637-
does not exist on-chain as a BPF program yet). There is no queueing
2638-
needed because the next time the program is invoked, the program
2639-
cache updating logic will see that the cache entry is missing and
2640-
will insert it then. */
2641-
// return fd_deploy_program( instr_ctx, program_key, elf, elf_sz );
2642-
}

src/flamenco/runtime/program/fd_bpf_loader_program.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,6 @@ fd_bpf_execute( fd_exec_instr_ctx_t * instr_ctx,
7676
int
7777
fd_bpf_loader_program_execute( fd_exec_instr_ctx_t * instr_ctx );
7878

79-
/* Public APIs */
80-
81-
/* This function is called from `fd_runtime.c` and only performs the ELF
82-
and VM validation checks necessary to deploy a program, specifically
83-
for the core native program BPF migration. Since this call is done at
84-
the epoch boundary every time a new BPF core migration feature is
85-
activated, we need to mock up a transaction and instruction context
86-
for execution. We do not do any funk operations here - instead, the
87-
BPF cache entry will be created at the end of the block. Because of
88-
this, our logic is slightly different than Agave's. See the
89-
documentation for our `fd_deploy_program` for more information.
90-
91-
https://github.com/anza-xyz/agave/blob/v2.1.0/runtime/src/bank/builtins/core_bpf_migration/mod.rs#L155-L233 */
92-
93-
int
94-
fd_directly_invoke_loader_v3_deploy( fd_bank_t * bank,
95-
fd_funk_t * funk,
96-
void * accdb_shfunk,
97-
fd_pubkey_t const * program_key,
98-
uchar const * elf,
99-
ulong elf_sz );
100-
10179
FD_PROTOTYPES_END
10280

10381
#endif /* HEADER_fd_src_flamenco_runtime_program_fd_bpf_loader_program_h */

0 commit comments

Comments
 (0)