Skip to content

Commit

Permalink
vm v2: add feature gates
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ece committed Nov 29, 2024
1 parent 2bc30f0 commit acef6e9
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 19 deletions.
5 changes: 4 additions & 1 deletion src/ballet/sbpf/fd_sbpf_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ _fd_int_store_if_negative( int * p,
static int
fd_sbpf_check_ehdr( fd_elf64_ehdr const * ehdr,
ulong elf_sz,
uint min_version,
uint max_version ) {

/* Validate ELF magic */
Expand All @@ -114,6 +115,7 @@ fd_sbpf_check_ehdr( fd_elf64_ehdr const * ehdr,
& ( ehdr->e_phentsize==sizeof(fd_elf64_phdr) )
& ( ehdr->e_shentsize==sizeof(fd_elf64_shdr) )
& ( ehdr->e_shstrndx < ehdr->e_shnum )
& ( ehdr->e_flags >= min_version )
& ( max_version
? ( ehdr->e_flags <= max_version )
: ( ehdr->e_flags != FD_ELF_EF_SBPF_V2 )
Expand Down Expand Up @@ -482,6 +484,7 @@ fd_sbpf_elf_peek( fd_sbpf_elf_info_t * info,
void const * bin,
ulong elf_sz,
int elf_deploy_checks,
uint sbpf_min_version,
uint sbpf_max_version ) {

/* ELFs must have a file header */
Expand Down Expand Up @@ -515,7 +518,7 @@ fd_sbpf_elf_peek( fd_sbpf_elf_info_t * info,
int err;

/* Validate file header */
if( FD_UNLIKELY( (err=fd_sbpf_check_ehdr( &elf->ehdr, elf_sz, sbpf_max_version ))!=0 ) )
if( FD_UNLIKELY( (err=fd_sbpf_check_ehdr( &elf->ehdr, elf_sz, sbpf_min_version, sbpf_max_version ))!=0 ) )
return NULL;

/* Program headers */
Expand Down
6 changes: 3 additions & 3 deletions src/ballet/sbpf/fd_sbpf_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define FD_SBPF_V1 (1UL)
#define FD_SBPF_V2 (2UL)
#define FD_SBPF_V3 (3UL)
#define FD_SBPF_MAX_VERSION FD_SBPF_V0

/* Program struct *****************************************************/

Expand Down Expand Up @@ -159,14 +158,15 @@ FD_PROTOTYPES_BEGIN
impossible to retroactively enforce these checks on already deployed programs,
a guard flag is used to enable these checks only when deploying programs.
sbpf_max_version: determine the max SBPF version allowed, version
is retrieved from the ELF header. See SIMD-0161. */
sbpf_min_version, sbpf_max_version: determine the min, max SBPF version
allowed, version is retrieved from the ELF header. See SIMD-0161. */

fd_sbpf_elf_info_t *
fd_sbpf_elf_peek( fd_sbpf_elf_info_t * info,
void const * bin,
ulong bin_sz,
int elf_deploy_checks,
uint sbpf_min_version,
uint sbpf_max_version );

/* fd_sbpf_program_{align,footprint} return the alignment and size
Expand Down
2 changes: 1 addition & 1 deletion src/ballet/sbpf/fuzz_sbpf_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LLVMFuzzerTestOneInput( uchar const * data,
ulong size ) {

fd_sbpf_elf_info_t info;
if( FD_UNLIKELY( !fd_sbpf_elf_peek( &info, data, size, 0, FD_SBPF_MAX_VERSION ) ) )
if( FD_UNLIKELY( !fd_sbpf_elf_peek( &info, data, size, 0, FD_SBPF_V0, FD_SBPF_V3 ) ) )
return -1;

/* Allocate objects */
Expand Down
31 changes: 25 additions & 6 deletions src/ballet/sbpf/test_sbpf_elf_peek.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,48 @@ LOAD_ELF( hello_solana_program_old_sbpf_v2 )
void test_sbpf_version_default( void ) {
fd_sbpf_elf_info_t info;

uint min_version = FD_SBPF_V0;
uint max_version = FD_SBPF_V0;

fd_sbpf_elf_peek( &info, hello_solana_program_elf, hello_solana_program_elf_sz, /* deploy checks */ 1, max_version );
fd_sbpf_elf_peek( &info, hello_solana_program_elf, hello_solana_program_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( info.sbpf_version==FD_SBPF_V0, "hello_solana_program v0" );

fd_sbpf_elf_peek( &info, hello_solana_program_sbpf_v2_elf, hello_solana_program_sbpf_v2_elf_sz, /* deploy checks */ 1, max_version );
fd_sbpf_elf_peek( &info, hello_solana_program_sbpf_v2_elf, hello_solana_program_sbpf_v2_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( info.sbpf_version==FD_SBPF_V0, "hello_solana_program v2 accepted as v0" );

fd_sbpf_elf_info_t * res = fd_sbpf_elf_peek( &info, hello_solana_program_old_sbpf_v2_elf, hello_solana_program_old_sbpf_v2_elf_sz, /* deploy checks */ 1, max_version );
fd_sbpf_elf_info_t * res = fd_sbpf_elf_peek( &info, hello_solana_program_old_sbpf_v2_elf, hello_solana_program_old_sbpf_v2_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( res==NULL, "hello_solana_program (old) v2 unsupported" );
}

void test_sbpf_version_from_elf_header( void ) {
fd_sbpf_elf_info_t info;

uint min_version = FD_SBPF_V0;
uint max_version = FD_SBPF_V2;

fd_sbpf_elf_peek( &info, hello_solana_program_elf, hello_solana_program_elf_sz, /* deploy checks */ 1, max_version );
fd_sbpf_elf_peek( &info, hello_solana_program_elf, hello_solana_program_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( info.sbpf_version==FD_SBPF_V0, "hello_solana_program v0" );

fd_sbpf_elf_peek( &info, hello_solana_program_sbpf_v2_elf, hello_solana_program_sbpf_v2_elf_sz, /* deploy checks */ 1, max_version );
fd_sbpf_elf_peek( &info, hello_solana_program_sbpf_v2_elf, hello_solana_program_sbpf_v2_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( info.sbpf_version==FD_SBPF_V2, "hello_solana_program v2" );

fd_sbpf_elf_info_t * res = fd_sbpf_elf_peek( &info, hello_solana_program_old_sbpf_v2_elf, hello_solana_program_old_sbpf_v2_elf_sz, /* deploy checks */ 1, max_version );
fd_sbpf_elf_info_t * res = fd_sbpf_elf_peek( &info, hello_solana_program_old_sbpf_v2_elf, hello_solana_program_old_sbpf_v2_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( res==NULL, "hello_solana_program (old) v2 unsupported" );
}

void test_sbpf_version_from_elf_header_with_min( void ) {
fd_sbpf_elf_info_t info;

uint min_version = FD_SBPF_V2;
uint max_version = FD_SBPF_V2;

fd_sbpf_elf_info_t * res = fd_sbpf_elf_peek( &info, hello_solana_program_elf, hello_solana_program_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( res==NULL, "hello_solana_program v0" );

fd_sbpf_elf_peek( &info, hello_solana_program_sbpf_v2_elf, hello_solana_program_sbpf_v2_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( info.sbpf_version==FD_SBPF_V2, "hello_solana_program v2" );

res = fd_sbpf_elf_peek( &info, hello_solana_program_old_sbpf_v2_elf, hello_solana_program_old_sbpf_v2_elf_sz, /* deploy checks */ 1, min_version, max_version );
FD_TEST_CUSTOM( res==NULL, "hello_solana_program (old) v2 unsupported" );
}

Expand All @@ -46,6 +64,7 @@ main( int argc,
// testing here
test_sbpf_version_default();
test_sbpf_version_from_elf_header();
test_sbpf_version_from_elf_header_with_min();

fd_halt();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/ballet/sbpf/test_sbpf_load_prog.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ main( int argc,
/* Extract ELF info */

fd_sbpf_elf_info_t elf_info;
if( FD_UNLIKELY( !fd_sbpf_elf_peek( &elf_info, bin_buf, bin_sz, /* deploy checks */ 1, FD_SBPF_MAX_VERSION ) ) )
if( FD_UNLIKELY( !fd_sbpf_elf_peek( &elf_info, bin_buf, bin_sz, /* deploy checks */ 1, FD_SBPF_V0, FD_SBPF_V3 ) ) )
FD_LOG_ERR(( "FAIL: %s", fd_sbpf_strerror() ));

/* Allocate rodata segment */
Expand Down
2 changes: 1 addition & 1 deletion src/ballet/sbpf/test_sbpf_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void test_duplicate_entrypoint_entry( void ) {
fd_valloc_t valloc = fd_scratch_virtual();
fd_sbpf_elf_info_t info;

fd_sbpf_elf_peek( &info, duplicate_entrypoint_entry_elf, duplicate_entrypoint_entry_elf_sz, /* deploy checks */ 1, FD_SBPF_MAX_VERSION );
fd_sbpf_elf_peek( &info, duplicate_entrypoint_entry_elf, duplicate_entrypoint_entry_elf_sz, /* deploy checks */ 1, FD_SBPF_V0, FD_SBPF_V3 );

void* rodata = fd_valloc_malloc( valloc, FD_SBPF_PROG_RODATA_ALIGN, info.rodata_footprint );
FD_TEST( rodata );
Expand Down
40 changes: 40 additions & 0 deletions src/flamenco/features/fd_features_generated.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,36 @@ fd_feature_id_t const ids[] = {
.name = "get_sysvar_syscall_enabled",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = offsetof(fd_features_t, disable_sbpf_v0_execution)>>3,
.id = {"\x07\xcd\x8f\x9c\x60\x1f\xb5\x1d\xe6\xc6\x4a\x0c\x80\xee\x74\x45\xb1\x33\x0c\x00\xc8\x85\x66\xfd\xbf\x9c\x04\xb1\x80\x00\x00\x00"},
/* XTestFeature1111111111111111111111111111111 */
.name = "disable_sbpf_v0_execution",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = offsetof(fd_features_t, reenable_sbpf_v0_execution)>>3,
.id = {"\x06\xd3\xed\xd5\x9d\x7c\x93\xe5\xc4\xb1\xe9\xad\x79\x2d\x34\x27\xa1\xc3\x2f\xac\xb9\xbc\x05\x2d\xe0\x6c\x4b\x91\x80\x00\x00\x00"},
/* TestFeature21111111111111111111111111111111 */
.name = "reenable_sbpf_v0_execution",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = offsetof(fd_features_t, enable_sbpf_v1_deployment_and_execution)>>3,
.id = {"\xff\xf3\x40\x2b\x9c\xcb\xc2\xef\x87\x25\xc8\xa9\xa3\x0d\x78\x88\xc0\xd9\xaf\xad\x60\x5e\x1a\xdf\xe8\x84\x65\xac\x59\xd5\xe4\xd5"},
/* JE86WkYvTrzW8HgNmrHY7dFYpCmSptUpKupbo2AdQ9cG */
.name = "enable_sbpf_v1_deployment_and_execution",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = offsetof(fd_features_t, enable_sbpf_v2_deployment_and_execution)>>3,
.id = {"\xd1\x6a\x9a\x26\x8a\x6a\x8e\x40\xcc\xea\xc9\x39\xd6\x21\x78\x58\x7e\x9e\x51\x6c\x8c\xab\x5a\xec\x85\xb1\x18\x7f\xa6\xd2\xb5\xdc"},
/* F6UVKh1ujTEFK3en2SyAL3cdVnqko1FVEXWhmdLRu6WP */
.name = "enable_sbpf_v2_deployment_and_execution",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = offsetof(fd_features_t, enable_sbpf_v3_deployment_and_execution)>>3,
.id = {"\xa5\x5e\x2c\x94\xda\x8b\xc0\xbe\x92\x50\x5b\xcc\xed\xd1\xab\x88\x9c\xed\xbd\xa6\xc9\x36\xa1\xf2\x60\x13\x3e\x95\xba\x9e\x4f\xf8"},
/* C8XZNs1bfzaiT3YDeXZJ7G5swQWQv7tVzDnCxtHvnSpw */
.name = "enable_sbpf_v3_deployment_and_execution",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = ULONG_MAX }
};

Expand Down Expand Up @@ -1457,6 +1487,11 @@ fd_feature_id_query( ulong prefix ) {
case 0x81fcbfa0d0f6b105: return &ids[ 202 ];
case 0x2c38e34ff071060d: return &ids[ 203 ];
case 0x829062f252ef5ba8: return &ids[ 204 ];
case 0x1db51f609c8fcd07: return &ids[ 205 ];
case 0xe5937c9dd5edd306: return &ids[ 206 ];
case 0xefc2cb9c2b40f3ff: return &ids[ 207 ];
case 0x408e6a8a269a6ad1: return &ids[ 208 ];
case 0xbec08bda942c5ea5: return &ids[ 209 ];
default: break;
}

Expand Down Expand Up @@ -1670,5 +1705,10 @@ FD_STATIC_ASSERT( offsetof( fd_features_t, deprecate_legacy_vote_ixs
FD_STATIC_ASSERT( offsetof( fd_features_t, partitioned_epoch_rewards_superfeature )>>3==202UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, enable_secp256r1_precompile )>>3==203UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, get_sysvar_syscall_enabled )>>3==204UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, disable_sbpf_v0_execution )>>3==205UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, reenable_sbpf_v0_execution )>>3==206UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, enable_sbpf_v1_deployment_and_execution )>>3==207UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, enable_sbpf_v2_deployment_and_execution )>>3==208UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, enable_sbpf_v3_deployment_and_execution )>>3==209UL, layout );

FD_STATIC_ASSERT( sizeof( fd_features_t )>>3==FD_FEATURE_ID_CNT, layout );
7 changes: 6 additions & 1 deletion src/flamenco/features/fd_features_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/* FEATURE_ID_CNT is the number of features in ids */

#define FD_FEATURE_ID_CNT (205UL)
#define FD_FEATURE_ID_CNT (210UL)

union fd_features {

Expand Down Expand Up @@ -218,6 +218,11 @@ union fd_features {
/* 0x81fcbfa0d0f6b105 */ ulong partitioned_epoch_rewards_superfeature;
/* 0x2c38e34ff071060d */ ulong enable_secp256r1_precompile;
/* 0x829062f252ef5ba8 */ ulong get_sysvar_syscall_enabled;
/* 0x1db51f609c8fcd07 */ ulong disable_sbpf_v0_execution;
/* 0xe5937c9dd5edd306 */ ulong reenable_sbpf_v0_execution;
/* 0xefc2cb9c2b40f3ff */ ulong enable_sbpf_v1_deployment_and_execution;
/* 0x408e6a8a269a6ad1 */ ulong enable_sbpf_v2_deployment_and_execution;
/* 0xbec08bda942c5ea5 */ ulong enable_sbpf_v3_deployment_and_execution;
};

};
7 changes: 6 additions & 1 deletion src/flamenco/features/feature_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,10 @@
{"name":"deprecate_legacy_vote_ixs","pubkey":"depVvnQ2UysGrhwdiwU42tCadZL8GcBb1i2GYhMopQv"},
{"name":"partitioned_epoch_rewards_superfeature","pubkey":"PERzQrt5gBD1XEe2c9XdFWqwgHY3mr7cYWbm5V772V8"},
{"name": "enable_secp256r1_precompile","pubkey":"sr11RdZWgbHTHxSroPALe6zgaT5A1K9LcE4nfsZS4gi"},
{"name": "get_sysvar_syscall_enabled", "pubkey": "CLCoTADvV64PSrnR6QXty6Fwrt9Xc6EdxSJE4wLRePjq"}
{"name": "get_sysvar_syscall_enabled", "pubkey": "CLCoTADvV64PSrnR6QXty6Fwrt9Xc6EdxSJE4wLRePjq"},
{"name": "disable_sbpf_v0_execution", "pubkey": "XTestFeature1111111111111111111111111111111","comment":"IMPORTANT: NEED REKEY"},
{"name": "reenable_sbpf_v0_execution", "pubkey": "TestFeature21111111111111111111111111111111","comment":"for test only"},
{"name": "enable_sbpf_v1_deployment_and_execution", "pubkey": "JE86WkYvTrzW8HgNmrHY7dFYpCmSptUpKupbo2AdQ9cG"},
{"name": "enable_sbpf_v2_deployment_and_execution", "pubkey": "F6UVKh1ujTEFK3en2SyAL3cdVnqko1FVEXWhmdLRu6WP"},
{"name": "enable_sbpf_v3_deployment_and_execution", "pubkey": "C8XZNs1bfzaiT3YDeXZJ7G5swQWQv7tVzDnCxtHvnSpw"}
]
4 changes: 3 additions & 1 deletion src/flamenco/runtime/program/fd_bpf_loader_program.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ deploy_program( fd_exec_instr_ctx_t * instr_ctx,

/* Load executable */
fd_sbpf_elf_info_t _elf_info[ 1UL ];
fd_sbpf_elf_info_t * elf_info = fd_sbpf_elf_peek( _elf_info, programdata, programdata_size, deploy_mode, FD_SBPF_MAX_VERSION );
uint min_sbpf_version, max_sbpf_version;
fd_bpf_get_sbpf_versions( &min_sbpf_version, &max_sbpf_version, instr_ctx->slot_ctx );
fd_sbpf_elf_info_t * elf_info = fd_sbpf_elf_peek( _elf_info, programdata, programdata_size, deploy_mode, min_sbpf_version, max_sbpf_version );
if( FD_UNLIKELY( !elf_info ) ) {
//TODO: actual log, this is a custom Firedancer msg
fd_log_collector_msg_literal( instr_ctx, "Failed to load or verify Elf" );
Expand Down
27 changes: 26 additions & 1 deletion src/flamenco/runtime/program/fd_bpf_program_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,29 @@ fd_bpf_get_executable_program_content_for_v1_v2_loaders( fd_borrowed_account_t *
return 0;
}

void
fd_bpf_get_sbpf_versions( uint * sbpf_min_version,
uint * sbpf_max_version,
fd_exec_slot_ctx_t const * slot_ctx ) {
int disable_v0 = FD_FEATURE_ACTIVE( slot_ctx, disable_sbpf_v0_execution );
int reenable_v0 = FD_FEATURE_ACTIVE( slot_ctx, reenable_sbpf_v0_execution );
int enable_v0 = !disable_v0 || reenable_v0;
int enable_v1 = FD_FEATURE_ACTIVE( slot_ctx, enable_sbpf_v1_deployment_and_execution );
int enable_v2 = FD_FEATURE_ACTIVE( slot_ctx, enable_sbpf_v2_deployment_and_execution );
int enable_v3 = FD_FEATURE_ACTIVE( slot_ctx, enable_sbpf_v3_deployment_and_execution );

*sbpf_min_version = enable_v0 ? FD_SBPF_V0 : FD_SBPF_V3;
if( enable_v3 ) {
*sbpf_max_version = FD_SBPF_V3;
} else if( enable_v2 ) {
*sbpf_max_version = FD_SBPF_V2;
} else if( enable_v1 ) {
*sbpf_max_version = FD_SBPF_V1;
} else {
*sbpf_max_version = FD_SBPF_V0;
}
}

int
fd_bpf_create_bpf_program_cache_entry( fd_exec_slot_ctx_t * slot_ctx,
fd_borrowed_account_t * program_acc ) {
Expand Down Expand Up @@ -134,7 +157,9 @@ fd_bpf_create_bpf_program_cache_entry( fd_exec_slot_ctx_t * slot_ctx,
}

fd_sbpf_elf_info_t elf_info = {0};
if( fd_sbpf_elf_peek( &elf_info, program_data, program_data_len, /* deploy checks */ 0, FD_SBPF_MAX_VERSION ) == NULL ) {
uint min_sbpf_version, max_sbpf_version;
fd_bpf_get_sbpf_versions( &min_sbpf_version, &max_sbpf_version, slot_ctx );
if( fd_sbpf_elf_peek( &elf_info, program_data, program_data_len, /* deploy checks */ 0, min_sbpf_version, max_sbpf_version ) == NULL ) {
FD_LOG_DEBUG(( "fd_sbpf_elf_peek() failed: %s", fd_sbpf_strerror() ));
return FD_EXECUTOR_INSTR_ERR_INVALID_ACC_DATA;
}
Expand Down
5 changes: 5 additions & 0 deletions src/flamenco/runtime/program/fd_bpf_program_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ fd_bpf_load_cache_entry( fd_exec_slot_ctx_t const * slot_ctx,
fd_pubkey_t const * program_pubkey,
fd_sbpf_validated_program_t ** valid_prog );

void
fd_bpf_get_sbpf_versions( uint * sbpf_min_version,
uint * sbpf_max_version,
fd_exec_slot_ctx_t const * slot_ctx );

FD_PROTOTYPES_END

#endif /* HEADER_fd_src_flamenco_runtime_program_fd_bpf_program_util_h */
2 changes: 1 addition & 1 deletion src/flamenco/runtime/tests/fd_exec_instr_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ fd_sbpf_program_load_test_run( FD_PARAM_UNUSED fd_exec_instr_test_runner_t * run

do{

if( FD_UNLIKELY( !fd_sbpf_elf_peek( &info, _bin, elf_sz, input->deploy_checks, FD_SBPF_MAX_VERSION ) ) ) {
if( FD_UNLIKELY( !fd_sbpf_elf_peek( &info, _bin, elf_sz, input->deploy_checks, FD_SBPF_V0, FD_SBPF_V3 ) ) ) {
/* return incomplete effects on execution failures */
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/vm/fd_vm_tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fd_vm_tool_prog_create( fd_vm_tool_prog_t * tool_prog,
/* Extract ELF info */

fd_sbpf_elf_info_t elf_info;
FD_TEST( fd_sbpf_elf_peek( &elf_info, bin_buf, bin_sz, /* deploy checks */ 0, FD_SBPF_MAX_VERSION ) );
FD_TEST( fd_sbpf_elf_peek( &elf_info, bin_buf, bin_sz, /* deploy checks */ 0, FD_SBPF_V0, FD_SBPF_V3 ) );

/* Allocate rodata segment */

Expand Down

0 comments on commit acef6e9

Please sign in to comment.