Skip to content

Commit

Permalink
flamenco, feature: direct mapping rekey
Browse files Browse the repository at this point in the history
  • Loading branch information
mjain-jump committed Dec 19, 2024
1 parent e947a13 commit dece678
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
8 changes: 3 additions & 5 deletions src/flamenco/features/fd_features_generated.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,8 @@ fd_feature_id_t const ids[] = {
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

{ .index = offsetof(fd_features_t, bpf_account_data_direct_mapping)>>3,
.id = {"\xca\xd6\x68\xb3\x88\x01\x19\x3f\x7e\xd4\xde\x26\xdc\x1c\x53\x2b\xf9\x20\x07\x6e\x3c\xe0\xd5\x2a\x8d\x88\x8b\x25\xda\xb6\x88\xd2"},
/* EenyoWx9UMXYKpR8mW5Jmfmy2fRjzUtM7NduYMY8bx33 */
.id = {"\xe3\x5a\x16\xee\xe9\x8e\x13\xd7\x1e\x4e\x93\xe2\x30\x83\x0d\x5e\x21\x50\xef\x16\x78\x38\x38\xfe\x63\xae\xba\xaa\x3d\x20\x2c\xf0"},
/* GJVDwRkUPNdk9QaK4VsU4g1N41QNxhy1hevjf8kz45Mq */
.name = "bpf_account_data_direct_mapping",
.cleaned_up = {UINT_MAX, UINT_MAX, UINT_MAX} },

Expand Down Expand Up @@ -1401,7 +1401,6 @@ fd_feature_id_query( ulong prefix ) {
case 0x073a0a7d3f570b55: return &ids[ 82 ];
case 0x4d6ae02c256bdf10: return &ids[ 83 ];
case 0x5bf898a97b29c67f: return &ids[ 84 ];
case 0x2e2d4501d149cd2c: return &ids[ 84 ];
case 0xe8f10f26141749dd: return &ids[ 85 ];
case 0xe02ac5f848d395d8: return &ids[ 86 ];
case 0x7b285d0430faf2fc: return &ids[ 87 ];
Expand Down Expand Up @@ -1464,7 +1463,7 @@ fd_feature_id_query( ulong prefix ) {
case 0x8ff9cf8537529ed8: return &ids[ 144 ];
case 0xd6120d1b80de5fea: return &ids[ 145 ];
case 0xca9ab2701c9aa81b: return &ids[ 146 ];
case 0x3f190188b368d6ca: return &ids[ 147 ];
case 0xd7138ee9ee165ae3: return &ids[ 147 ];
case 0x55d3a0c392cf63e0: return &ids[ 148 ];
case 0x0e7aa95037c5daac: return &ids[ 149 ];
case 0xe2d13039d5f9c6a6: return &ids[ 150 ];
Expand All @@ -1481,7 +1480,6 @@ fd_feature_id_query( ulong prefix ) {
case 0x81b8fd99bea25f9b: return &ids[ 161 ];
case 0x3cbf822ccb2eebd4: return &ids[ 162 ];
case 0xe9d32123513c4d0d: return &ids[ 163 ];
case 0x86fa44f01141c71a: return &ids[ 163 ];
case 0x64205286d7935342: return &ids[ 164 ];
case 0x97f912be04ecd673: return &ids[ 165 ];
case 0x4b241cb4c6f3b3b2: return &ids[ 166 ];
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/features/fd_features_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ union fd_features {
/* 0x8ff9cf8537529ed8 */ ulong prevent_rent_paying_rent_recipients;
/* 0xd6120d1b80de5fea */ ulong delay_visibility_of_program_deployment;
/* 0xca9ab2701c9aa81b */ ulong apply_cost_tracker_during_replay;
/* 0x3f190188b368d6ca */ ulong bpf_account_data_direct_mapping;
/* 0xd7138ee9ee165ae3 */ ulong bpf_account_data_direct_mapping;
/* 0x55d3a0c392cf63e0 */ ulong add_set_tx_loaded_accounts_data_size_instruction;
/* 0x0e7aa95037c5daac */ ulong switch_to_new_elf_parser;
/* 0xe2d13039d5f9c6a6 */ ulong round_up_heap_size;
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/features/feature_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
{"name":"prevent_rent_paying_rent_recipients","pubkey": "Fab5oP3DmsLYCiQZXdjyqT3ukFFPrsmqhXU4WU1AWVVF","cleaned_up":[1,18,0]},
{"name":"delay_visibility_of_program_deployment","pubkey": "GmuBvtFb2aHfSfMXpuFeWZGHyDeCLPS79s48fmCWCfM5","cleaned_up":[1,18,0]},
{"name":"apply_cost_tracker_during_replay","pubkey": "2ry7ygxiYURULZCrypHhveanvP5tzZ4toRwVp89oCNSj"},
{"name":"bpf_account_data_direct_mapping","pubkey": "EenyoWx9UMXYKpR8mW5Jmfmy2fRjzUtM7NduYMY8bx33"},
{"name":"bpf_account_data_direct_mapping","pubkey": "GJVDwRkUPNdk9QaK4VsU4g1N41QNxhy1hevjf8kz45Mq","old": "EenyoWx9UMXYKpR8mW5Jmfmy2fRjzUtM7NduYMY8bx33"},
{"name":"add_set_tx_loaded_accounts_data_size_instruction","pubkey": "G6vbf1UBok8MWb8m25ex86aoQHeKTzDKzuZADHkShqm6","cleaned_up":[1,18,0]},
{"name":"switch_to_new_elf_parser","pubkey": "Cdkc8PPTeTNUPoZEfCY5AyetUrEdkZtNPMgz58nqyaHD"},
{"name":"round_up_heap_size","pubkey": "CE2et8pqgyQMP2mQRg3CgvX8nJBKUArMu3wfiQiQKY1y","cleaned_up":[1,18,0]},
Expand Down
4 changes: 0 additions & 4 deletions src/flamenco/features/gen_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ def generate(feature_map_path, header_path, body_path):
)
fd_features_t_params.append(f" /* {short_id} */ ulong {x['name']};")
rmap[x["pubkey"]] = x["name"]
if "old" in x:
rmap[x["old"]] = x["name"]
fd_features_t_params = "\n".join(fd_features_t_params)

# Write header file.
Expand Down Expand Up @@ -101,8 +99,6 @@ def pubkey_to_c_array(pubkey):
file=body)
for i, x in enumerate(fm):
print(f''' case {"0x%016x" % struct.unpack("<Q", fd58.dec32(x["pubkey"].encode('ascii'))[:8])}: return &ids[{"% 4d" % (i)} ];''', file=body)
if "old" in x:
print(f''' case {"0x%016x" % struct.unpack("<Q", fd58.dec32(x["old"].encode('ascii'))[:8])}: return &ids[{"% 4d" % (i)} ];''', file=body)
print(
f""" default: break;
}}
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/runtime/tests/run_ledger_tests_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ src/flamenco/runtime/tests/run_ledger_test.sh -l v203-bpf-loader -s snapshot-40-
src/flamenco/runtime/tests/run_ledger_test.sh -l v203-move-stake -s snapshot-4467-5yzwTpG83nRbokX2iKNYPCPod6fJu3aE8pBEE4SyqLCb.tar.zst -p 50 -y 16 -m 5000000 -e 4470 -o 7bTK6Jis8Xpfrs8ZoUfiMDPazTcdPcTWheZFJTA5Z6X4 -c 2.0.3
src/flamenco/runtime/tests/run_ledger_test.sh -l v203-move-lamports -s snapshot-650-Q8pVZ4jfmzpAGwAytPs4PJXmb4iaBXwVhvVjc8AaAXh.tar.zst -p 50 -y 16 -m 5000000 -e 655 -o 7bTK6Jis8Xpfrs8ZoUfiMDPazTcdPcTWheZFJTA5Z6X4 -c 2.0.3
src/flamenco/runtime/tests/run_ledger_test.sh -l testnet-283927487 -s snapshot-283927486-7gCbg5g4BnD9SkQUjpHvhepWsQTpo2WaZaA5bhcNBMhG.tar.zst -p 50 -y 16 -m 5000000 -e 283927497 -c 2.0.0
src/flamenco/runtime/tests/run_ledger_test.sh -l mainnet-254462437-dm -s snapshot-254462437-9HqBi19BJJRZfHeBS3ZpkeP9B5SAxBxz6Kwug29yLHac.tar.zst -p 50 -y 30 -m 20000000 -e 254462836 -c 1.19.0 -o EenyoWx9UMXYKpR8mW5Jmfmy2fRjzUtM7NduYMY8bx33
src/flamenco/runtime/tests/run_ledger_test.sh -l mainnet-254462437-dm -s snapshot-254462437-9HqBi19BJJRZfHeBS3ZpkeP9B5SAxBxz6Kwug29yLHac.tar.zst -p 50 -y 30 -m 20000000 -e 254462836 -c 1.19.0 -o GJVDwRkUPNdk9QaK4VsU4g1N41QNxhy1hevjf8kz45Mq
src/flamenco/runtime/tests/run_ledger_test.sh -l mainnet-281375356 -s snapshot-281375353-Bg81vkkW8K3UtrQoEn3wLsEpYwoHRQSihW4t5PiF1bBD.tar.zst -p 50 -y 16 -m 5000000 -e 281375359 -c 1.19.0
src/flamenco/runtime/tests/run_ledger_test.sh -l mainnet-282232100 -s snapshot-282232097-5ChH2XwaWrYaMvkemMQZmhMxabSNvXLKz3mZSCwhaW5W.tar.zst -p 50 -y 16 -m 5000000 -e 282232101 -c 1.19.0
src/flamenco/runtime/tests/run_ledger_test.sh -l mainnet-586-partitioned-epoch-rewards -s snapshot-253151900-HVhfam8TtRFVwFto5fWkhgR4mbBJmUxcnxeKZoW5MrSD.tar.zst -p 50 -y 16 -m 5000000 -e 253152100 -c 2.0.3 -o 9bn2vTJUsUcnpiZWbu2woSKtTGW3ErZC9ERv88SDqQjK
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/vm/syscall/test_vm_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ static inline void set_memory_region( uchar * mem, ulong sz ) { for( ulong i=0UL
static void
test_vm_syscall_toggle_direct_mapping( fd_vm_t * vm_ctx, int enable ) {
ulong slot = enable ? 0UL : FD_FEATURE_DISABLED;
char const * one_offs[] = { "EenyoWx9UMXYKpR8mW5Jmfmy2fRjzUtM7NduYMY8bx33" };
char const * one_offs[] = { "GJVDwRkUPNdk9QaK4VsU4g1N41QNxhy1hevjf8kz45Mq" };
fd_features_enable_one_offs( (fd_features_t*)&vm_ctx->instr_ctx->epoch_ctx->features, one_offs, 1U, slot );
vm_ctx->direct_mapping = enable;
}
Expand Down

0 comments on commit dece678

Please sign in to comment.