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: 2 additions & 0 deletions src/app/shared_dev/commands/configure/genesis.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ default_enable_features( fd_features_t * features ) {
features->enable_big_mod_exp_syscall = 0UL;
features->enable_alt_bn128_compression_syscall = 0UL;
features->update_hashes_per_tick2 = 0UL;
features->account_data_direct_mapping = 0UL;
features->stricter_abi_and_runtime_constraints = 0UL;
features->bpf_account_data_direct_mapping = 0UL;
features->relax_authority_signer_check_for_lookup_table_creation = 0UL;
features->update_hashes_per_tick6 = 0UL;
Expand Down
19 changes: 18 additions & 1 deletion src/flamenco/features/fd_features_generated.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,8 @@ fd_feature_id_t const ids[] = {
.id = {"\x90\x9d\x8a\x1a\x1b\xdb\xb4\x28\xec\x2a\x7c\xf2\xbc\x76\xaf\x8c\x72\x9e\xbb\xa0\x6f\xee\x98\xa4\x77\xdd\xe8\xc5\x08\x1b\x7f\x53"},
/* AjX3A4Nv2rzUuATEUWLP4rrBaBropyUnHxEvFDj1dKbx */
.name = "bpf_account_data_direct_mapping",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX},
.reverted = 1 },

{ .index = offsetof(fd_features_t, add_set_tx_loaded_accounts_data_size_instruction)>>3,
.id = {"\xe0\x63\xcf\x92\xc3\xa0\xd3\x55\x49\xd0\x52\xb1\x0c\xaf\xf1\x3f\x56\xfa\x06\x11\x1c\x63\x6f\x69\x75\x42\xd1\x31\x2a\x1e\xe2\x6d"},
Expand Down Expand Up @@ -1666,6 +1667,18 @@ fd_feature_id_t const ids[] = {
.name = "raise_account_cu_limit",
.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 */
.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 */
.name = "account_data_direct_mapping",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = ULONG_MAX }
};
/* TODO replace this with fd_map_perfect */
Expand Down Expand Up @@ -1915,6 +1928,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 ];
default: break;
}
return NULL;
Expand Down Expand Up @@ -2163,4 +2178,6 @@ FD_STATIC_ASSERT( offsetof( fd_features_t, require_static_nonce_account
FD_STATIC_ASSERT( offsetof( fd_features_t, enable_vote_address_leader_schedule )>>3==240UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, enshrine_slashing_program )>>3==241UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, raise_account_cu_limit )>>3==242UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, stricter_abi_and_runtime_constraints )>>3==243UL, layout );
FD_STATIC_ASSERT( offsetof( fd_features_t, account_data_direct_mapping )>>3==244UL, layout );
FD_STATIC_ASSERT( sizeof( fd_features_t )>>3==FD_FEATURE_ID_CNT, layout );
4 changes: 3 additions & 1 deletion src/flamenco/features/fd_features_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#endif

/* FEATURE_ID_CNT is the number of features in ids */
#define FD_FEATURE_ID_CNT (243UL)
#define FD_FEATURE_ID_CNT (245UL)
union fd_features {
ulong f[ FD_FEATURE_ID_CNT ];
struct {
Expand Down Expand Up @@ -255,5 +255,7 @@ 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;
};
};
6 changes: 4 additions & 2 deletions src/flamenco/features/feature_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
{"name":"delay_visibility_of_program_deployment","pubkey": "GmuBvtFb2aHfSfMXpuFeWZGHyDeCLPS79s48fmCWCfM5","cleaned_up":[1,18,0],"hardcode_for_fuzzing":1},
{"name":"apply_cost_tracker_during_replay","pubkey": "2ry7ygxiYURULZCrypHhveanvP5tzZ4toRwVp89oCNSj","cleaned_up":[2,3,0],"hardcode_for_fuzzing":1},
{"name":"deplete_cu_meter_on_vm_failure","pubkey": "B7H2caeia4ZFcpE3QcgMqbiWiBtWrdBRBSJ1DY6Ktxbq","comment":"do not set hardcode_for_fuzzing for this - it significantly degrades vm fuzzing discovery"},
{"name":"bpf_account_data_direct_mapping","pubkey": "AjX3A4Nv2rzUuATEUWLP4rrBaBropyUnHxEvFDj1dKbx","old": "GJVDwRkUPNdk9QaK4VsU4g1N41QNxhy1hevjf8kz45Mq"},
{"name":"bpf_account_data_direct_mapping","pubkey": "AjX3A4Nv2rzUuATEUWLP4rrBaBropyUnHxEvFDj1dKbx","old": "GJVDwRkUPNdk9QaK4VsU4g1N41QNxhy1hevjf8kz45Mq","reverted":1},
{"name":"add_set_tx_loaded_accounts_data_size_instruction","pubkey": "G6vbf1UBok8MWb8m25ex86aoQHeKTzDKzuZADHkShqm6","cleaned_up":[1,18,0],"hardcode_for_fuzzing":1},
{"name":"switch_to_new_elf_parser","pubkey": "Cdkc8PPTeTNUPoZEfCY5AyetUrEdkZtNPMgz58nqyaHD","cleaned_up":[2,1,0],"hardcode_for_fuzzing":1},
{"name":"round_up_heap_size","pubkey": "CE2et8pqgyQMP2mQRg3CgvX8nJBKUArMu3wfiQiQKY1y","cleaned_up":[1,18,0],"hardcode_for_fuzzing":1},
Expand Down Expand Up @@ -241,5 +241,7 @@
{"name":"require_static_nonce_account","pubkey":"7VVhpg5oAjAmnmz1zCcSHb2Z9ecZB2FQqpnEwReka9Zm"},
{"name":"enable_vote_address_leader_schedule","pubkey":"5JsG4NWH8Jbrqdd8uL6BNwnyZK3dQSoieRXG5vmofj9y"},
{"name":"enshrine_slashing_program","pubkey":"sProgVaNWkYdP2eTRAy1CPrgb3b9p8yXCASrPEqo6VJ"},
{"name":"raise_account_cu_limit","pubkey":"htsptAwi2yRoZH83SKaUXykeZGtZHgxkS2QwW1pssR8"}
{"name":"raise_account_cu_limit","pubkey":"htsptAwi2yRoZH83SKaUXykeZGtZHgxkS2QwW1pssR8"},
{"name":"stricter_abi_and_runtime_constraints","pubkey":"CxeBn9PVeeXbmjbNwLv6U4C6svNxnC4JX6mfkvgeMocM"},
{"name":"account_data_direct_mapping","pubkey":"9s3RKimHWS44rJcJ9P1rwCmn2TvMqtZQBmz815ZUUHqJ"}
]
1 change: 1 addition & 0 deletions src/flamenco/progcache/fd_progcache_rec.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ fd_progcache_rec_new( void * mem,
NULL,
0,
FD_FEATURE_ACTIVE( load_slot, features, bpf_account_data_direct_mapping ),
FD_FEATURE_ACTIVE( load_slot, features, stricter_abi_and_runtime_constraints ),
0 );
if( FD_UNLIKELY( !vm ) ) FD_LOG_CRIT(( "fd_vm_init failed" ));

Expand Down
5 changes: 3 additions & 2 deletions src/flamenco/runtime/fd_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ FD_STATIC_ASSERT( (offsetof(fd_account_rec_t, data)%FD_ACCOUNT_REC_DATA_ALIGN )=
#define MAX_PERMITTED_DATA_INCREASE (10240UL) // 10KB
#define FD_BPF_ALIGN_OF_U128 (8UL )
FD_STATIC_ASSERT( FD_BPF_ALIGN_OF_U128==FD_ACCOUNT_REC_DATA_ALIGN, input_data_align );
#define FD_RUNTIME_INPUT_REGION_ALLOC_ALIGN_UP (16UL)
/* https://github.com/anza-xyz/sbpf/blob/v0.12.2/src/ebpf.rs#L37-L38 */
#define FD_RUNTIME_EBPF_HOST_ALIGN (16UL)

/******** These macros bound out memory footprint ********/

Expand Down Expand Up @@ -123,7 +124,7 @@ FD_STATIC_ASSERT( FD_BPF_ALIGN_OF_U128==FD_ACCOUNT_REC_DATA_ALIGN, input_data_al
sizeof(ulong) /* instr data len */ + \
/* No instr data */ \
sizeof(fd_pubkey_t)), /* program id */ \
FD_RUNTIME_INPUT_REGION_ALLOC_ALIGN_UP ) + FD_BPF_ALIGN_OF_U128)
FD_RUNTIME_EBPF_HOST_ALIGN ) + FD_BPF_ALIGN_OF_U128)

#define FD_RUNTIME_INPUT_REGION_TXN_FOOTPRINT(account_lock_limit, direct_mapping) \
((FD_MAX_INSTRUCTION_STACK_DEPTH*FD_RUNTIME_INPUT_REGION_INSN_FOOTPRINT(account_lock_limit, direct_mapping)) + \
Expand Down
Loading
Loading