Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 committed Aug 11, 2023
1 parent 7284ad2 commit b8f0b92
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions cli/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {
clap::{App, AppSettings, Arg, ArgMatches, SubCommand},
log::*,
solana_account_decoder::{UiAccountEncoding, UiDataSliceConfig},
solana_bpf_loader_program::syscalls::create_program_runtime_v1_environment,
solana_bpf_loader_program::syscalls::create_program_runtime_environment_v1,
solana_clap_utils::{
self, hidden_unless_forced, input_parsers::*, input_validators::*, keypair::*,
},
Expand Down Expand Up @@ -2022,7 +2022,7 @@ fn read_and_verify_elf(program_location: &str) -> Result<Vec<u8>, Box<dyn std::e
.map_err(|err| format!("Unable to read program file: {err}"))?;

// Verify the program
let program_runtime_environment = create_program_runtime_v1_environment(
let program_runtime_environment = create_program_runtime_environment_v1(
&FeatureSet::all_enabled(),
&ComputeBudget::default(),
true,
Expand Down
4 changes: 2 additions & 2 deletions ledger-tool/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use {
serde_json::Result,
solana_bpf_loader_program::{
create_vm, load_program_from_bytes, serialization::serialize_parameters,
syscalls::create_program_runtime_v1_environment,
syscalls::create_program_runtime_environment_v1,
},
solana_clap_utils::input_parsers::pubkeys_of,
solana_ledger::{
Expand Down Expand Up @@ -346,7 +346,7 @@ fn load_program<'a>(
..LoadProgramMetrics::default()
};
let account_size = contents.len();
let program_runtime_environment = create_program_runtime_v1_environment(
let program_runtime_environment = create_program_runtime_environment_v1(
&invoke_context.feature_set,
invoke_context.get_compute_budget(),
false, /* deployment */
Expand Down
6 changes: 3 additions & 3 deletions programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use {
rc::Rc,
sync::{atomic::Ordering, Arc},
},
syscalls::create_program_runtime_v1_environment,
syscalls::create_program_runtime_environment_v1,
};

pub const DEFAULT_LOADER_COMPUTE_UNITS: u64 = 570;
Expand Down Expand Up @@ -116,7 +116,7 @@ macro_rules! deploy_program {
$account_size:expr, $slot:expr, $drop:expr, $new_programdata:expr $(,)?) => {{
let mut load_program_metrics = LoadProgramMetrics::default();
let mut register_syscalls_time = Measure::start("register_syscalls_time");
let program_runtime_environment = create_program_runtime_v1_environment(
let program_runtime_environment = create_program_runtime_environment_v1(
&$invoke_context.feature_set,
$invoke_context.get_compute_budget(),
true, /* deployment */
Expand Down Expand Up @@ -1654,7 +1654,7 @@ pub mod test_utils {

pub fn load_all_invoked_programs(invoke_context: &mut InvokeContext) {
let mut load_program_metrics = LoadProgramMetrics::default();
let program_runtime_environment = create_program_runtime_v1_environment(
let program_runtime_environment = create_program_runtime_environment_v1(
&invoke_context.feature_set,
invoke_context.get_compute_budget(),
false, /* deployment */
Expand Down
2 changes: 1 addition & 1 deletion programs/bpf_loader/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ macro_rules! register_feature_gated_function {
};
}

pub fn create_program_runtime_v1_environment<'a>(
pub fn create_program_runtime_environment_v1<'a>(
feature_set: &FeatureSet,
compute_budget: &ComputeBudget,
reject_deployment_of_broken_elfs: bool,
Expand Down
4 changes: 2 additions & 2 deletions programs/loader-v4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn get_state_mut(data: &mut [u8]) -> Result<&mut LoaderV4State, InstructionError
}
}

pub fn create_program_runtime_v2_environment<'a>(
pub fn create_program_runtime_environment_v2<'a>(
compute_budget: &ComputeBudget,
debugging_features: bool,
) -> BuiltinProgram<InvokeContext<'a>> {
Expand Down Expand Up @@ -118,7 +118,7 @@ pub fn load_program_from_account(
.ok_or(InstructionError::AccountDataTooSmall)?;
let loaded_program = LoadedProgram::new(
&loader_v4::id(),
Arc::new(create_program_runtime_v2_environment(
Arc::new(create_program_runtime_environment_v2(
compute_budget,
debugging_features,
)),
Expand Down
10 changes: 5 additions & 5 deletions programs/sbf/benches/bpf_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use {
byteorder::{ByteOrder, LittleEndian, WriteBytesExt},
solana_bpf_loader_program::{
create_vm, serialization::serialize_parameters,
syscalls::create_program_runtime_v1_environment,
syscalls::create_program_runtime_environment_v1,
},
solana_measure::measure::Measure,
solana_program_runtime::{compute_budget::ComputeBudget, invoke_context::InvokeContext},
Expand Down Expand Up @@ -90,7 +90,7 @@ macro_rules! with_mock_invoke_context {
fn bench_program_create_executable(bencher: &mut Bencher) {
let elf = load_program_from_file("bench_alu");

let program_runtime_environment = create_program_runtime_v1_environment(
let program_runtime_environment = create_program_runtime_environment_v1(
&FeatureSet::default(),
&ComputeBudget::default(),
true,
Expand Down Expand Up @@ -118,7 +118,7 @@ fn bench_program_alu(bencher: &mut Bencher) {
let elf = load_program_from_file("bench_alu");
with_mock_invoke_context!(invoke_context, bpf_loader::id(), 10000001);

let program_runtime_environment = create_program_runtime_v1_environment(
let program_runtime_environment = create_program_runtime_environment_v1(
&invoke_context.feature_set,
&ComputeBudget::default(),
true,
Expand Down Expand Up @@ -237,7 +237,7 @@ fn bench_create_vm(bencher: &mut Bencher) {
let direct_mapping = invoke_context
.feature_set
.is_active(&bpf_account_data_direct_mapping::id());
let program_runtime_environment = create_program_runtime_v1_environment(
let program_runtime_environment = create_program_runtime_environment_v1(
&invoke_context.feature_set,
&ComputeBudget::default(),
true,
Expand Down Expand Up @@ -299,7 +299,7 @@ fn bench_instruction_count_tuner(_bencher: &mut Bencher) {
)
.unwrap();

let program_runtime_environment = create_program_runtime_v1_environment(
let program_runtime_environment = create_program_runtime_environment_v1(
&invoke_context.feature_set,
&ComputeBudget::default(),
true,
Expand Down
8 changes: 4 additions & 4 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ use {
TransactionResults,
},
},
solana_bpf_loader_program::syscalls::create_program_runtime_v1_environment,
solana_bpf_loader_program::syscalls::create_program_runtime_environment_v1,
solana_cost_model::cost_tracker::CostTracker,
solana_measure::{measure, measure::Measure, measure_us},
solana_perf::perf_libs,
Expand Down Expand Up @@ -7996,7 +7996,7 @@ impl Bank {
.iter()
.any(|key| new_feature_activations.contains(key))
{
let program_runtime_environment_v1 = create_program_runtime_v1_environment(
let program_runtime_environment_v1 = create_program_runtime_environment_v1(
&self.feature_set,
&self.runtime_config.compute_budget.unwrap_or_default(),
false, /* deployment */
Expand All @@ -8011,9 +8011,9 @@ impl Bank {
Arc::new(program_runtime_environment_v1);
}
let program_runtime_environment_v2 =
solana_loader_v4_program::create_program_runtime_v2_environment(
solana_loader_v4_program::create_program_runtime_environment_v2(
&self.runtime_config.compute_budget.unwrap_or_default(),
false, /* deployment */
false, /* debugging_features */
);
if *loaded_programs_cache.program_runtime_environment_v2
!= program_runtime_environment_v2
Expand Down

0 comments on commit b8f0b92

Please sign in to comment.