Skip to content

Commit 6eda349

Browse files
Lichtsoksn6
authored andcommitted
Feature - Stricter ABI and runtime constraints (#7113)
* Renames bpf_account_data_direct_mapping => stricter_abi_and_runtime_constraints. * Adds InvokeContext::account_data_direct_mapping. * Separates stricter_abi_and_runtime_constraints from account_data_direct_mapping. * Rekeys stricter_abi_and_runtime_constraints. * Adjusts test_serialize_parameters_with_many_accounts().
1 parent 3bc385f commit 6eda349

File tree

16 files changed

+478
-296
lines changed

16 files changed

+478
-296
lines changed

feature-set/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ impl FeatureSet {
106106
.is_active(&move_precompile_verification_to_svm::id()),
107107
remove_accounts_executable_flag_checks: self
108108
.is_active(&remove_accounts_executable_flag_checks::id()),
109-
bpf_account_data_direct_mapping: self.is_active(&bpf_account_data_direct_mapping::id()),
109+
stricter_abi_and_runtime_constraints: self
110+
.is_active(&stricter_abi_and_runtime_constraints::id()),
110111
enable_bpf_loader_set_authority_checked_ix: self
111112
.is_active(&enable_bpf_loader_set_authority_checked_ix::id()),
112113
enable_loader_v4: self.is_active(&enable_loader_v4::id()),
@@ -752,8 +753,8 @@ pub mod apply_cost_tracker_during_replay {
752753
solana_pubkey::declare_id!("2ry7ygxiYURULZCrypHhveanvP5tzZ4toRwVp89oCNSj");
753754
}
754755

755-
pub mod bpf_account_data_direct_mapping {
756-
solana_pubkey::declare_id!("1ncomp1ete111111111111111111111111111111111");
756+
pub mod stricter_abi_and_runtime_constraints {
757+
solana_pubkey::declare_id!("C37iaPi6VE4CZDueU1vL8y6pGp5i8amAbEsF31xzz723");
757758
}
758759

759760
pub mod add_set_tx_loaded_accounts_data_size_instruction {
@@ -1279,7 +1280,7 @@ pub static FEATURE_NAMES: LazyLock<AHashMap<Pubkey, &'static str>> = LazyLock::n
12791280
(clean_up_delegation_errors::id(), "Return InsufficientDelegation instead of InsufficientFunds or InsufficientStake where applicable #31206"),
12801281
(vote_state_add_vote_latency::id(), "replace Lockout with LandedVote (including vote latency) in vote state #31264"),
12811282
(checked_arithmetic_in_fee_validation::id(), "checked arithmetic in fee validation #31273"),
1282-
(bpf_account_data_direct_mapping::id(), "use memory regions to map account data into the rbpf vm instead of copying the data"),
1283+
(stricter_abi_and_runtime_constraints::id(), "use memory regions to map account data into the rbpf vm instead of copying the data"),
12831284
(last_restart_slot_sysvar::id(), "enable new sysvar last_restart_slot"),
12841285
(reduce_stake_warmup_cooldown::id(), "reduce stake warmup cooldown from 25% to 9%"),
12851286
(revise_turbine_epoch_stakes::id(), "revise turbine epoch stakes"),

ledger-tool/src/program.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ pub fn program(ledger_path: &Path, matches: &ArgMatches<'_>) {
535535
.transaction_context
536536
.get_current_instruction_context()
537537
.unwrap(),
538-
false, // direct_mapping
538+
false, // stricter_abi_and_runtime_constraints
539+
false, // account_data_direct_mapping
539540
true, // for mask_out_rent_epoch_in_vm_serialization
540541
)
541542
.unwrap();

program-runtime/src/invoke_context.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ pub struct InvokeContext<'a> {
202202
pub timings: ExecuteDetailsTimings,
203203
pub syscall_context: Vec<Option<SyscallContext>>,
204204
traces: Vec<Vec<[u64; 12]>>,
205+
/// Stops copying account data if stricter_abi_and_runtime_constraints is enabled
206+
pub account_data_direct_mapping: bool,
205207
}
206208

207209
impl<'a> InvokeContext<'a> {
@@ -226,6 +228,7 @@ impl<'a> InvokeContext<'a> {
226228
timings: ExecuteDetailsTimings::default(),
227229
syscall_context: Vec::new(),
228230
traces: Vec::new(),
231+
account_data_direct_mapping: false,
229232
}
230233
}
231234

0 commit comments

Comments
 (0)