Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/test/test-vectors-commit-sha.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c8e3939ed100fda48240cc1b7a784e96415f5ffe
3bded3a6e883823f246ccdbe5b4e6ba49fbf26ed
10 changes: 2 additions & 8 deletions src/ballet/sbpf/fd_sbpf_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1466,14 +1466,8 @@ fd_sbpf_program_get_sbpf_version_or_err( void const * bin,
}
uint e_flags = FD_LOAD( uint, bin+E_FLAGS_OFFSET );

uint sbpf_version = 0U;
if( FD_UNLIKELY( config->sbpf_max_version==FD_SBPF_V0 ) ) {
/* https://github.com/anza-xyz/sbpf/blob/v0.12.2/src/elf.rs#L384-L388 */
sbpf_version = e_flags==E_FLAGS_SBPF_V2 ? FD_SBPF_RESERVED : FD_SBPF_V0;
} else {
/* https://github.com/anza-xyz/sbpf/blob/v0.12.2/src/elf.rs#L390-L396 */
sbpf_version = e_flags < FD_SBPF_VERSION_COUNT ? e_flags : FD_SBPF_RESERVED;
}
/* https://github.com/anza-xyz/sbpf/blob/v0.13.0/src/elf.rs#L382-L390 */
uint sbpf_version = ( e_flags < FD_SBPF_VERSION_COUNT ) ? e_flags : FD_SBPF_RESERVED;

/* https://github.com/anza-xyz/sbpf/blob/v0.12.2/src/elf.rs#L399-L401 */
if( FD_UNLIKELY( !( config->sbpf_min_version <= sbpf_version && sbpf_version <= config->sbpf_max_version ) ) ) {
Expand Down
15 changes: 8 additions & 7 deletions src/flamenco/features/fd_features_generated.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,8 @@ fd_feature_id_t const ids[] = {
.id = {"\x08\xe8\xaa\x2e\x13\xc5\xc5\x54\xe2\xc3\xb4\x0e\x26\xb4\x64\x3b\xc7\xcb\x89\x6c\xc0\x06\x05\xaa\x65\x7f\x3a\x3d\x30\xee\xf9\x05"},
/* bn2puAyxUx6JUabAxYdKdJ5QHbNNmKw8dCGuGCyRrFN */
.name = "fix_alt_bn128_multiplication_input_length",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },
.cleaned_up = {3, 1, 0},
.hardcode_for_fuzzing = 1 },

{ .index = offsetof(fd_features_t, lift_cpi_caller_restriction)>>3,
.id = {"\xf6\xd3\x41\xcb\x4b\xa2\x65\x9e\xac\xe7\x83\xef\x30\xe5\xfc\xc1\x9a\x94\x8b\x9b\x00\xba\x8a\xad\xf5\x2a\x6b\x9f\x65\x24\x5e\xc8"},
Expand Down Expand Up @@ -1668,14 +1669,14 @@ fd_feature_id_t const ids[] = {
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = offsetof(fd_features_t, stricter_abi_and_runtime_constraints)>>3,
.id = {"\xb1\xb1\x8b\xfe\x0c\x8c\xa8\x90\xaf\x61\x7d\x45\x2d\x08\xd5\x33\x88\xea\x0b\x0b\x87\x1f\xb6\x1c\x38\xc8\xeb\x19\x0f\xd7\x9f\x0a"},
/* CxeBn9PVeeXbmjbNwLv6U4C6svNxnC4JX6mfkvgeMocM */
.id = {"\x0c\xdc\xaa\x60\x4d\xd8\x04\x50\x19\x27\xdb\xa5\x2d\x2a\x39\xcf\x51\xdb\xc9\xae\xd8\x06\xc9\xda\x36\x46\xb8\xf2\x41\x40\x59\xed"},
/* sD3uVpaavUXQRvDXrMFCQ2CqLqnbz5mK8ttWNXbtD3r */
.name = "stricter_abi_and_runtime_constraints",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = offsetof(fd_features_t, account_data_direct_mapping)>>3,
.id = {"\x83\xaf\x45\x7d\x2d\x4b\x60\xe8\xb6\x8b\xde\xea\x1f\x99\x51\x97\x42\x3e\x2d\x9a\xd0\xe0\x8c\xa8\x44\x7f\x6a\xd4\x68\x43\x4e\x19"},
/* 9s3RKimHWS44rJcJ9P1rwCmn2TvMqtZQBmz815ZUUHqJ */
.id = {"\xb5\xfa\x43\x42\x67\x5e\x0c\x52\x3d\x10\xad\xbb\x78\x84\x1f\x16\x92\x1f\xf2\xb6\xe7\xcd\xe9\x60\x60\x84\x9a\xfd\x12\xb1\x01\x39"},
/* DFN8MyKpQqFW31qczcahgnnxcAHQc6P94wtTEX5EP1RA */
.name = "account_data_direct_mapping",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

Expand Down Expand Up @@ -1934,8 +1935,8 @@ fd_feature_id_query( ulong prefix ) {
case 0x3711b30f40730240: return &ids[ 240 ];
case 0xc1309d1b0ae3e80c: return &ids[ 241 ];
case 0x5c64cc1a9be3790a: return &ids[ 242 ];
case 0x90a88c0cfe8bb1b1: return &ids[ 243 ];
case 0xe8604b2d7d45af83: return &ids[ 244 ];
case 0x5004d84d60aadc0c: return &ids[ 243 ];
case 0x520c5e674243fab5: return &ids[ 244 ];
case 0xf08a42c3c040e908: return &ids[ 245 ];
default: break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/flamenco/features/fd_features_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ union fd_features {
/* 0x3711b30f40730240 */ ulong enable_vote_address_leader_schedule;
/* 0xc1309d1b0ae3e80c */ ulong enshrine_slashing_program;
/* 0x5c64cc1a9be3790a */ ulong raise_account_cu_limit;
/* 0x90a88c0cfe8bb1b1 */ ulong stricter_abi_and_runtime_constraints;
/* 0xe8604b2d7d45af83 */ ulong account_data_direct_mapping;
/* 0x5004d84d60aadc0c */ ulong stricter_abi_and_runtime_constraints;
/* 0x520c5e674243fab5 */ ulong account_data_direct_mapping;
/* 0xf08a42c3c040e908 */ ulong fix_alt_bn128_pairing_length_check;
};
};
6 changes: 3 additions & 3 deletions src/flamenco/features/feature_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
{"name":"enable_get_epoch_stake_syscall","pubkey":"FKe75t4LXxGaQnVHdUKM6DSFifVVraGZ8LyNo7oPwy1Z","old":"7mScTYkJXsbdrcwTQRs7oeCSXoJm4WjzBsRyf8bCU3Np"},
{"name":"disable_account_loader_special_case","pubkey":"EQUMpNFr7Nacb1sva56xn1aLfBxppEoSBH8RRVdkcD1x","cleaned_up":[2,2,0],"hardcode_for_fuzzing":1},
{"name":"remove_accounts_executable_flag_checks","pubkey":"FXs1zh47QbNnhXcnB6YiAQoJ4sGB91tKF3UFHLcKT7PM","old":"FfgtauHUWKeXTzjXkua9Px4tNGBFHKZ9WaigM5VbbzFx","hardcode_for_fuzzing":1},
{"name":"fix_alt_bn128_multiplication_input_length","pubkey":"bn2puAyxUx6JUabAxYdKdJ5QHbNNmKw8dCGuGCyRrFN"},
{"name":"fix_alt_bn128_multiplication_input_length","pubkey":"bn2puAyxUx6JUabAxYdKdJ5QHbNNmKw8dCGuGCyRrFN","cleaned_up":[3,1,0],"hardcode_for_fuzzing":1},
{"name":"lift_cpi_caller_restriction","pubkey":"HcW8ZjBezYYgvcbxNJwqv1t484Y2556qJsfNDWvJGZRH","reverted":1},
{"name":"accounts_lt_hash","pubkey":"LTHasHQX6661DaDD4S6A2TFi6QBuiwXKv66fB1obfHq","old":"LtHaSHHsUge7EWTPVrmpuexKz6uVHZXZL6cgJa7W7Zn","cleaned_up":[3,0,0],"hardcode_for_fuzzing":1},
{"name":"remove_accounts_delta_hash","pubkey":"LTdLt9Ycbyoipz5fLysCi1NnDnASsZfmJLJXts5ZxZz","cleaned_up":[3,0,0],"hardcode_for_fuzzing":1},
Expand All @@ -242,7 +242,7 @@
{"name":"enable_vote_address_leader_schedule","pubkey":"5JsG4NWH8Jbrqdd8uL6BNwnyZK3dQSoieRXG5vmofj9y"},
{"name":"enshrine_slashing_program","pubkey":"sProgVaNWkYdP2eTRAy1CPrgb3b9p8yXCASrPEqo6VJ"},
{"name":"raise_account_cu_limit","pubkey":"htsptAwi2yRoZH83SKaUXykeZGtZHgxkS2QwW1pssR8"},
{"name":"stricter_abi_and_runtime_constraints","pubkey":"CxeBn9PVeeXbmjbNwLv6U4C6svNxnC4JX6mfkvgeMocM"},
{"name":"account_data_direct_mapping","pubkey":"9s3RKimHWS44rJcJ9P1rwCmn2TvMqtZQBmz815ZUUHqJ"},
{"name":"stricter_abi_and_runtime_constraints","pubkey":"sD3uVpaavUXQRvDXrMFCQ2CqLqnbz5mK8ttWNXbtD3r","old":"CxeBn9PVeeXbmjbNwLv6U4C6svNxnC4JX6mfkvgeMocM"},
{"name":"account_data_direct_mapping","pubkey":"DFN8MyKpQqFW31qczcahgnnxcAHQc6P94wtTEX5EP1RA","old":"9s3RKimHWS44rJcJ9P1rwCmn2TvMqtZQBmz815ZUUHqJ"},
{"name":"fix_alt_bn128_pairing_length_check","pubkey":"bnYzodLwmybj7e1HAe98yZrdJTd7we69eMMLgCXqKZm"}
]
2 changes: 1 addition & 1 deletion src/flamenco/runtime/context/fd_exec_instr_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fd_exec_instr_ctx_try_borrow_instr_account_with_key( fd_exec_instr_ctx_t const *
/* Return a NotEnoughAccountKeys error if the account is not found
in the instruction context to match the error code returned by
fd_exec_instr_ctx_try_borrow_instr_account. */
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

int
Expand Down
6 changes: 3 additions & 3 deletions src/flamenco/runtime/context/fd_exec_instr_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ FD_PROTOTYPES_BEGIN

Assert that enough accounts were supplied to this instruction. Returns
FD_EXECUTOR_INSTR_SUCCESS if the number of accounts is as expected and
FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS otherwise.
FD_EXECUTOR_INSTR_ERR_MISSING_ACC otherwise.

https://github.com/anza-xyz/agave/blob/v2.1.14/sdk/src/transaction_context.rs#L490 */

Expand All @@ -50,7 +50,7 @@ fd_exec_instr_ctx_check_num_insn_accounts( fd_exec_instr_ctx_t const * ctx,
uint expected_accounts ) {

if( FD_UNLIKELY( ctx->instr->acct_cnt<expected_accounts ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}
return FD_EXECUTOR_INSTR_SUCCESS;
}
Expand Down Expand Up @@ -82,7 +82,7 @@ fd_exec_instr_ctx_get_index_of_instr_account_in_transaction( fd_exec_instr_ctx_t
/* Return a NotEnoughAccountKeys error if the idx is out of bounds.
https://github.com/anza-xyz/agave/blob/v2.1.14/sdk/src/transaction_context.rs#L559 */
if( FD_UNLIKELY( idx_in_instr>=ctx->instr->acct_cnt ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

*idx_in_txn = ctx->instr->accounts[ idx_in_instr ].index_in_transaction;
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/runtime/context/fd_exec_txn_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fd_exec_txn_ctx_get_key_of_account_at_index( fd_exec_txn_ctx_t * ctx,
/* Return a NotEnoughAccountKeys error if idx is out of bounds.
https://github.com/anza-xyz/agave/blob/v2.1.14/sdk/src/transaction_context.rs#L218 */
if( FD_UNLIKELY( idx>=ctx->accounts.accounts_cnt ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

*key = &ctx->accounts.account_keys[ idx ];
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/runtime/fd_executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ fd_txn_ctx_push( fd_exec_txn_ctx_t * txn_ctx,
fd_txn_account_t * sysvar_instructions_account = NULL;
err = fd_exec_txn_ctx_get_account_at_index( txn_ctx, (ushort)idx, &sysvar_instructions_account, NULL );
if( FD_UNLIKELY( err ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.2.12/transaction-context/src/lib.rs#L401-L402 */
Expand Down
24 changes: 12 additions & 12 deletions src/flamenco/runtime/program/fd_bpf_loader_program.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
/* https://github.com/anza-xyz/agave/blob/574bae8fefc0ed256b55340b9d87b7689bcdf222/programs/bpf_loader/src/lib.rs#L476-L493 */
case fd_bpf_upgradeable_loader_program_instruction_enum_initialize_buffer: {
if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 2U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.4/programs/bpf_loader/src/lib.rs#L479 */
Expand Down Expand Up @@ -966,7 +966,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
/* https://github.com/anza-xyz/agave/blob/574bae8fefc0ed256b55340b9d87b7689bcdf222/programs/bpf_loader/src/lib.rs#L494-L525 */
case fd_bpf_upgradeable_loader_program_instruction_enum_write: {
if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 2U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.4/programs/bpf_loader/src/lib.rs#L497 */
Expand Down Expand Up @@ -1026,7 +1026,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
case fd_bpf_upgradeable_loader_program_instruction_enum_deploy_with_max_data_len: {
/* https://github.com/anza-xyz/agave/blob/574bae8fefc0ed256b55340b9d87b7689bcdf222/programs/bpf_loader/src/lib.rs#L527-L541 */
if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 4U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.4/programs/bpf_loader/src/lib.rs#L529-L534 */
Expand Down Expand Up @@ -1063,7 +1063,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {

/* https://github.com/anza-xyz/agave/blob/v2.1.14/programs/bpf_loader/src/lib.rs#L538 */
if( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 8U ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.14/programs/bpf_loader/src/lib.rs#L539-L541 */
Expand Down Expand Up @@ -1366,7 +1366,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
case fd_bpf_upgradeable_loader_program_instruction_enum_upgrade: {
/* https://github.com/anza-xyz/agave/blob/574bae8fefc0ed256b55340b9d87b7689bcdf222/programs/bpf_loader/src/lib.rs#L704-L714 */
if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 3U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.14/programs/bpf_loader/src/lib.rs#L706-L708 */
Expand All @@ -1389,7 +1389,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
}

if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 7U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.14/programs/bpf_loader/src/lib.rs#L713-L715 */
Expand Down Expand Up @@ -1650,7 +1650,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
case fd_bpf_upgradeable_loader_program_instruction_enum_set_authority: {
int err;
if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 2U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.4/programs/bpf_loader/src/lib.rs#L896-L897 */
Expand Down Expand Up @@ -1757,7 +1757,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
}

if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 3U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.4/programs/bpf_loader/src/lib.rs#L968-L969 */
Expand Down Expand Up @@ -1855,7 +1855,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
int err;
/* https://github.com/anza-xyz/agave/blob/574bae8fefc0ed256b55340b9d87b7689bcdf222/programs/bpf_loader/src/lib.rs#L1032-L1046 */
if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 2U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* It's safe to directly access the instruction accounts because we already checked for two
Expand Down Expand Up @@ -1909,7 +1909,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
fd_borrowed_account_drop( &close_account );

if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 3U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

fd_bpf_upgradeable_loader_state_buffer_t * state_buf = &close_account_state->inner.buffer;
Expand All @@ -1927,7 +1927,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {
} else if( fd_bpf_upgradeable_loader_state_is_program_data( close_account_state ) ) {
int err;
if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 4U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.1.4/programs/bpf_loader/src/lib.rs#L1074 */
Expand Down Expand Up @@ -2037,7 +2037,7 @@ process_loader_upgradeable_instruction( fd_exec_instr_ctx_t * instr_ctx ) {

/* https://github.com/anza-xyz/agave/blob/v2.2.6/programs/bpf_loader/src/lib.rs#L1346 */
if( FD_UNLIKELY( fd_exec_instr_ctx_check_num_insn_accounts( instr_ctx, 3U ) ) ) {
return FD_EXECUTOR_INSTR_ERR_NOT_ENOUGH_ACC_KEYS;
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

/* https://github.com/anza-xyz/agave/blob/v2.2.6/programs/bpf_loader/src/lib.rs#L1347-L1349 */
Expand Down
Loading
Loading