|
@@ -19,8 +19,8 @@ use {
|
|
|
compute_budget::ComputeBudget,
|
|
compute_budget::ComputeBudget,
|
|
|
invoke_context::InvokeContext,
|
|
invoke_context::InvokeContext,
|
|
|
loaded_programs::{
|
|
loaded_programs::{
|
|
|
- ForkGraph, LoadProgramMetrics, LoadedProgram, LoadedProgramMatchCriteria,
|
|
|
|
|
- LoadedProgramOwner, LoadedProgramType, LoadedProgramsForTxBatch, ProgramCache,
|
|
|
|
|
|
|
+ ForkGraph, LoadProgramMetrics, ProgramCache, ProgramCacheEntry, ProgramCacheEntryOwner,
|
|
|
|
|
+ ProgramCacheEntryType, ProgramCacheForTxBatch, ProgramCacheMatchCriteria,
|
|
|
ProgramRuntimeEnvironment, DELAY_VISIBILITY_SLOT_OFFSET,
|
|
ProgramRuntimeEnvironment, DELAY_VISIBILITY_SLOT_OFFSET,
|
|
|
},
|
|
},
|
|
|
log_collector::LogCollector,
|
|
log_collector::LogCollector,
|
|
@@ -105,8 +105,8 @@ pub trait TransactionProcessingCallback {
|
|
|
Ok(())
|
|
Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- fn get_program_match_criteria(&self, _program: &Pubkey) -> LoadedProgramMatchCriteria {
|
|
|
|
|
- LoadedProgramMatchCriteria::NoCriteria
|
|
|
|
|
|
|
+ fn get_program_match_criteria(&self, _program: &Pubkey) -> ProgramCacheMatchCriteria {
|
|
|
|
|
+ ProgramCacheMatchCriteria::NoCriteria
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fn add_builtin_account(&self, _name: &str, _program_id: &Pubkey) {}
|
|
fn add_builtin_account(&self, _name: &str, _program_id: &Pubkey) {}
|
|
@@ -114,7 +114,7 @@ pub trait TransactionProcessingCallback {
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
#[derive(Debug)]
|
|
|
enum ProgramAccountLoadResult {
|
|
enum ProgramAccountLoadResult {
|
|
|
- InvalidAccountData(LoadedProgramOwner),
|
|
|
|
|
|
|
+ InvalidAccountData(ProgramCacheEntryOwner),
|
|
|
ProgramOfLoaderV1(AccountSharedData),
|
|
ProgramOfLoaderV1(AccountSharedData),
|
|
|
ProgramOfLoaderV2(AccountSharedData),
|
|
ProgramOfLoaderV2(AccountSharedData),
|
|
|
ProgramOfLoaderV3(AccountSharedData, AccountSharedData, Slot),
|
|
ProgramOfLoaderV3(AccountSharedData, AccountSharedData, Slot),
|
|
@@ -403,7 +403,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
pubkey: &Pubkey,
|
|
pubkey: &Pubkey,
|
|
|
reload: bool,
|
|
reload: bool,
|
|
|
effective_epoch: Epoch,
|
|
effective_epoch: Epoch,
|
|
|
- ) -> Option<Arc<LoadedProgram>> {
|
|
|
|
|
|
|
+ ) -> Option<Arc<ProgramCacheEntry>> {
|
|
|
let program_cache = self.program_cache.read().unwrap();
|
|
let program_cache = self.program_cache.read().unwrap();
|
|
|
let environments = program_cache.get_environments_for_epoch(effective_epoch);
|
|
let environments = program_cache.get_environments_for_epoch(effective_epoch);
|
|
|
let mut load_program_metrics = LoadProgramMetrics {
|
|
let mut load_program_metrics = LoadProgramMetrics {
|
|
@@ -413,7 +413,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
|
|
|
|
|
let mut loaded_program = match self.load_program_accounts(callbacks, pubkey)? {
|
|
let mut loaded_program = match self.load_program_accounts(callbacks, pubkey)? {
|
|
|
ProgramAccountLoadResult::InvalidAccountData(owner) => Ok(
|
|
ProgramAccountLoadResult::InvalidAccountData(owner) => Ok(
|
|
|
- LoadedProgram::new_tombstone(self.slot, owner, LoadedProgramType::Closed),
|
|
|
|
|
|
|
+ ProgramCacheEntry::new_tombstone(self.slot, owner, ProgramCacheEntryType::Closed),
|
|
|
),
|
|
),
|
|
|
|
|
|
|
|
ProgramAccountLoadResult::ProgramOfLoaderV1(program_account) => {
|
|
ProgramAccountLoadResult::ProgramOfLoaderV1(program_account) => {
|
|
@@ -426,7 +426,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
environments.program_runtime_v1.clone(),
|
|
environments.program_runtime_v1.clone(),
|
|
|
reload,
|
|
reload,
|
|
|
)
|
|
)
|
|
|
- .map_err(|_| (0, LoadedProgramOwner::LoaderV1))
|
|
|
|
|
|
|
+ .map_err(|_| (0, ProgramCacheEntryOwner::LoaderV1))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ProgramAccountLoadResult::ProgramOfLoaderV2(program_account) => {
|
|
ProgramAccountLoadResult::ProgramOfLoaderV2(program_account) => {
|
|
@@ -439,7 +439,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
environments.program_runtime_v1.clone(),
|
|
environments.program_runtime_v1.clone(),
|
|
|
reload,
|
|
reload,
|
|
|
)
|
|
)
|
|
|
- .map_err(|_| (0, LoadedProgramOwner::LoaderV2))
|
|
|
|
|
|
|
+ .map_err(|_| (0, ProgramCacheEntryOwner::LoaderV2))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ProgramAccountLoadResult::ProgramOfLoaderV3(
|
|
ProgramAccountLoadResult::ProgramOfLoaderV3(
|
|
@@ -464,7 +464,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
reload,
|
|
reload,
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
- .map_err(|_| (slot, LoadedProgramOwner::LoaderV3)),
|
|
|
|
|
|
|
+ .map_err(|_| (slot, ProgramCacheEntryOwner::LoaderV3)),
|
|
|
|
|
|
|
|
ProgramAccountLoadResult::ProgramOfLoaderV4(program_account, slot) => program_account
|
|
ProgramAccountLoadResult::ProgramOfLoaderV4(program_account, slot) => program_account
|
|
|
.data()
|
|
.data()
|
|
@@ -481,15 +481,19 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
reload,
|
|
reload,
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
- .map_err(|_| (slot, LoadedProgramOwner::LoaderV4)),
|
|
|
|
|
|
|
+ .map_err(|_| (slot, ProgramCacheEntryOwner::LoaderV4)),
|
|
|
}
|
|
}
|
|
|
.unwrap_or_else(|(slot, owner)| {
|
|
.unwrap_or_else(|(slot, owner)| {
|
|
|
- let env = if let LoadedProgramOwner::LoaderV4 = &owner {
|
|
|
|
|
|
|
+ let env = if let ProgramCacheEntryOwner::LoaderV4 = &owner {
|
|
|
environments.program_runtime_v2.clone()
|
|
environments.program_runtime_v2.clone()
|
|
|
} else {
|
|
} else {
|
|
|
environments.program_runtime_v1.clone()
|
|
environments.program_runtime_v1.clone()
|
|
|
};
|
|
};
|
|
|
- LoadedProgram::new_tombstone(slot, owner, LoadedProgramType::FailedVerification(env))
|
|
|
|
|
|
|
+ ProgramCacheEntry::new_tombstone(
|
|
|
|
|
+ slot,
|
|
|
|
|
+ owner,
|
|
|
|
|
+ ProgramCacheEntryType::FailedVerification(env),
|
|
|
|
|
+ )
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
let mut timings = ExecuteDetailsTimings::default();
|
|
let mut timings = ExecuteDetailsTimings::default();
|
|
@@ -518,8 +522,8 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
callback: &CB,
|
|
callback: &CB,
|
|
|
program_accounts_map: &HashMap<Pubkey, u64>,
|
|
program_accounts_map: &HashMap<Pubkey, u64>,
|
|
|
limit_to_load_programs: bool,
|
|
limit_to_load_programs: bool,
|
|
|
- ) -> LoadedProgramsForTxBatch {
|
|
|
|
|
- let mut missing_programs: Vec<(Pubkey, (LoadedProgramMatchCriteria, u64))> =
|
|
|
|
|
|
|
+ ) -> ProgramCacheForTxBatch {
|
|
|
|
|
+ let mut missing_programs: Vec<(Pubkey, (ProgramCacheMatchCriteria, u64))> =
|
|
|
program_accounts_map
|
|
program_accounts_map
|
|
|
.iter()
|
|
.iter()
|
|
|
.map(|(pubkey, count)| {
|
|
.map(|(pubkey, count)| {
|
|
@@ -539,7 +543,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
// Initialize our local cache.
|
|
// Initialize our local cache.
|
|
|
let is_first_round = loaded_programs_for_txs.is_none();
|
|
let is_first_round = loaded_programs_for_txs.is_none();
|
|
|
if is_first_round {
|
|
if is_first_round {
|
|
|
- loaded_programs_for_txs = Some(LoadedProgramsForTxBatch::new_from_cache(
|
|
|
|
|
|
|
+ loaded_programs_for_txs = Some(ProgramCacheForTxBatch::new_from_cache(
|
|
|
self.slot,
|
|
self.slot,
|
|
|
self.epoch,
|
|
self.epoch,
|
|
|
&program_cache,
|
|
&program_cache,
|
|
@@ -553,7 +557,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
// This branch is taken when there is an error in assigning a program to a
|
|
// This branch is taken when there is an error in assigning a program to a
|
|
|
// cache slot. It is not possible to mock this error for SVM unit
|
|
// cache slot. It is not possible to mock this error for SVM unit
|
|
|
// tests purposes.
|
|
// tests purposes.
|
|
|
- let mut ret = LoadedProgramsForTxBatch::new_from_cache(
|
|
|
|
|
|
|
+ let mut ret = ProgramCacheForTxBatch::new_from_cache(
|
|
|
self.slot,
|
|
self.slot,
|
|
|
self.epoch,
|
|
self.epoch,
|
|
|
&program_cache,
|
|
&program_cache,
|
|
@@ -611,7 +615,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
timings: &mut ExecuteTimings,
|
|
timings: &mut ExecuteTimings,
|
|
|
error_counters: &mut TransactionErrorMetrics,
|
|
error_counters: &mut TransactionErrorMetrics,
|
|
|
log_messages_bytes_limit: Option<usize>,
|
|
log_messages_bytes_limit: Option<usize>,
|
|
|
- programs_loaded_for_tx_batch: &LoadedProgramsForTxBatch,
|
|
|
|
|
|
|
+ programs_loaded_for_tx_batch: &ProgramCacheForTxBatch,
|
|
|
) -> TransactionExecutionResult {
|
|
) -> TransactionExecutionResult {
|
|
|
let transaction_accounts = std::mem::take(&mut loaded_transaction.accounts);
|
|
let transaction_accounts = std::mem::take(&mut loaded_transaction.accounts);
|
|
|
|
|
|
|
@@ -660,7 +664,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
callback.get_last_blockhash_and_lamports_per_signature();
|
|
callback.get_last_blockhash_and_lamports_per_signature();
|
|
|
|
|
|
|
|
let mut executed_units = 0u64;
|
|
let mut executed_units = 0u64;
|
|
|
- let mut programs_modified_by_tx = LoadedProgramsForTxBatch::new(
|
|
|
|
|
|
|
+ let mut programs_modified_by_tx = ProgramCacheForTxBatch::new(
|
|
|
self.slot,
|
|
self.slot,
|
|
|
programs_loaded_for_tx_batch.environments.clone(),
|
|
programs_loaded_for_tx_batch.environments.clone(),
|
|
|
programs_loaded_for_tx_batch.upcoming_environments.clone(),
|
|
programs_loaded_for_tx_batch.upcoming_environments.clone(),
|
|
@@ -832,11 +836,11 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
deployment_slot: Slot,
|
|
deployment_slot: Slot,
|
|
|
program_runtime_environment: ProgramRuntimeEnvironment,
|
|
program_runtime_environment: ProgramRuntimeEnvironment,
|
|
|
reloading: bool,
|
|
reloading: bool,
|
|
|
- ) -> std::result::Result<LoadedProgram, Box<dyn std::error::Error>> {
|
|
|
|
|
|
|
+ ) -> std::result::Result<ProgramCacheEntry, Box<dyn std::error::Error>> {
|
|
|
if reloading {
|
|
if reloading {
|
|
|
// Safety: this is safe because the program is being reloaded in the cache.
|
|
// Safety: this is safe because the program is being reloaded in the cache.
|
|
|
unsafe {
|
|
unsafe {
|
|
|
- LoadedProgram::reload(
|
|
|
|
|
|
|
+ ProgramCacheEntry::reload(
|
|
|
loader_key,
|
|
loader_key,
|
|
|
program_runtime_environment.clone(),
|
|
program_runtime_environment.clone(),
|
|
|
deployment_slot,
|
|
deployment_slot,
|
|
@@ -847,7 +851,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- LoadedProgram::new(
|
|
|
|
|
|
|
+ ProgramCacheEntry::new(
|
|
|
loader_key,
|
|
loader_key,
|
|
|
program_runtime_environment.clone(),
|
|
program_runtime_environment.clone(),
|
|
|
deployment_slot,
|
|
deployment_slot,
|
|
@@ -875,7 +879,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
})
|
|
})
|
|
|
.map(|slot| ProgramAccountLoadResult::ProgramOfLoaderV4(program_account, slot))
|
|
.map(|slot| ProgramAccountLoadResult::ProgramOfLoaderV4(program_account, slot))
|
|
|
.unwrap_or(ProgramAccountLoadResult::InvalidAccountData(
|
|
.unwrap_or(ProgramAccountLoadResult::InvalidAccountData(
|
|
|
- LoadedProgramOwner::LoaderV4,
|
|
|
|
|
|
|
+ ProgramCacheEntryOwner::LoaderV4,
|
|
|
)),
|
|
)),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -909,7 +913,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Some(ProgramAccountLoadResult::InvalidAccountData(
|
|
Some(ProgramAccountLoadResult::InvalidAccountData(
|
|
|
- LoadedProgramOwner::LoaderV3,
|
|
|
|
|
|
|
+ ProgramCacheEntryOwner::LoaderV3,
|
|
|
))
|
|
))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -992,7 +996,7 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
|
|
|
callbacks: &CB,
|
|
callbacks: &CB,
|
|
|
program_id: Pubkey,
|
|
program_id: Pubkey,
|
|
|
name: &str,
|
|
name: &str,
|
|
|
- builtin: LoadedProgram,
|
|
|
|
|
|
|
+ builtin: ProgramCacheEntry,
|
|
|
) {
|
|
) {
|
|
|
debug!("Adding program {} under {:?}", name, program_id);
|
|
debug!("Adding program {} under {:?}", name, program_id);
|
|
|
callbacks.add_builtin_account(name, &program_id);
|
|
callbacks.add_builtin_account(name, &program_id);
|
|
@@ -1374,10 +1378,10 @@ mod tests {
|
|
|
|
|
|
|
|
let result = batch_processor.load_program_with_pubkey(&mock_bank, &key, false, 20);
|
|
let result = batch_processor.load_program_with_pubkey(&mock_bank, &key, false, 20);
|
|
|
|
|
|
|
|
- let loaded_program = LoadedProgram::new_tombstone(
|
|
|
|
|
|
|
+ let loaded_program = ProgramCacheEntry::new_tombstone(
|
|
|
0,
|
|
0,
|
|
|
- LoadedProgramOwner::LoaderV4,
|
|
|
|
|
- LoadedProgramType::FailedVerification(
|
|
|
|
|
|
|
+ ProgramCacheEntryOwner::LoaderV4,
|
|
|
|
|
+ ProgramCacheEntryType::FailedVerification(
|
|
|
batch_processor
|
|
batch_processor
|
|
|
.program_cache
|
|
.program_cache
|
|
|
.read()
|
|
.read()
|
|
@@ -1404,10 +1408,10 @@ mod tests {
|
|
|
|
|
|
|
|
// This should return an error
|
|
// This should return an error
|
|
|
let result = batch_processor.load_program_with_pubkey(&mock_bank, &key, false, 20);
|
|
let result = batch_processor.load_program_with_pubkey(&mock_bank, &key, false, 20);
|
|
|
- let loaded_program = LoadedProgram::new_tombstone(
|
|
|
|
|
|
|
+ let loaded_program = ProgramCacheEntry::new_tombstone(
|
|
|
0,
|
|
0,
|
|
|
- LoadedProgramOwner::LoaderV2,
|
|
|
|
|
- LoadedProgramType::FailedVerification(
|
|
|
|
|
|
|
+ ProgramCacheEntryOwner::LoaderV2,
|
|
|
|
|
+ ProgramCacheEntryType::FailedVerification(
|
|
|
batch_processor
|
|
batch_processor
|
|
|
.program_cache
|
|
.program_cache
|
|
|
.read()
|
|
.read()
|
|
@@ -1475,10 +1479,10 @@ mod tests {
|
|
|
|
|
|
|
|
// This should return an error
|
|
// This should return an error
|
|
|
let result = batch_processor.load_program_with_pubkey(&mock_bank, &key1, false, 0);
|
|
let result = batch_processor.load_program_with_pubkey(&mock_bank, &key1, false, 0);
|
|
|
- let loaded_program = LoadedProgram::new_tombstone(
|
|
|
|
|
|
|
+ let loaded_program = ProgramCacheEntry::new_tombstone(
|
|
|
0,
|
|
0,
|
|
|
- LoadedProgramOwner::LoaderV3,
|
|
|
|
|
- LoadedProgramType::FailedVerification(
|
|
|
|
|
|
|
+ ProgramCacheEntryOwner::LoaderV3,
|
|
|
|
|
+ ProgramCacheEntryType::FailedVerification(
|
|
|
batch_processor
|
|
batch_processor
|
|
|
.program_cache
|
|
.program_cache
|
|
|
.read()
|
|
.read()
|
|
@@ -1552,10 +1556,10 @@ mod tests {
|
|
|
.insert(key, account_data.clone());
|
|
.insert(key, account_data.clone());
|
|
|
|
|
|
|
|
let result = batch_processor.load_program_with_pubkey(&mock_bank, &key, false, 0);
|
|
let result = batch_processor.load_program_with_pubkey(&mock_bank, &key, false, 0);
|
|
|
- let loaded_program = LoadedProgram::new_tombstone(
|
|
|
|
|
|
|
+ let loaded_program = ProgramCacheEntry::new_tombstone(
|
|
|
0,
|
|
0,
|
|
|
- LoadedProgramOwner::LoaderV4,
|
|
|
|
|
- LoadedProgramType::FailedVerification(
|
|
|
|
|
|
|
+ ProgramCacheEntryOwner::LoaderV4,
|
|
|
|
|
+ ProgramCacheEntryType::FailedVerification(
|
|
|
batch_processor
|
|
batch_processor
|
|
|
.program_cache
|
|
.program_cache
|
|
|
.read()
|
|
.read()
|
|
@@ -1749,7 +1753,7 @@ mod tests {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
let sanitized_message = new_unchecked_sanitized_message(message);
|
|
let sanitized_message = new_unchecked_sanitized_message(message);
|
|
|
- let loaded_programs = LoadedProgramsForTxBatch::default();
|
|
|
|
|
|
|
+ let loaded_programs = ProgramCacheForTxBatch::default();
|
|
|
let mock_bank = MockBankCallback::default();
|
|
let mock_bank = MockBankCallback::default();
|
|
|
let batch_processor = TransactionBatchProcessor::<TestForkGraph>::default();
|
|
let batch_processor = TransactionBatchProcessor::<TestForkGraph>::default();
|
|
|
|
|
|
|
@@ -1873,7 +1877,7 @@ mod tests {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
let sanitized_message = new_unchecked_sanitized_message(message);
|
|
let sanitized_message = new_unchecked_sanitized_message(message);
|
|
|
- let loaded_programs = LoadedProgramsForTxBatch::default();
|
|
|
|
|
|
|
+ let loaded_programs = ProgramCacheForTxBatch::default();
|
|
|
let mock_bank = MockBankCallback::default();
|
|
let mock_bank = MockBankCallback::default();
|
|
|
let batch_processor = TransactionBatchProcessor::<TestForkGraph>::default();
|
|
let batch_processor = TransactionBatchProcessor::<TestForkGraph>::default();
|
|
|
|
|
|
|
@@ -1957,7 +1961,7 @@ mod tests {
|
|
|
let program = result.find(&key).unwrap();
|
|
let program = result.find(&key).unwrap();
|
|
|
assert!(matches!(
|
|
assert!(matches!(
|
|
|
program.program,
|
|
program.program,
|
|
|
- LoadedProgramType::FailedVerification(_)
|
|
|
|
|
|
|
+ ProgramCacheEntryType::FailedVerification(_)
|
|
|
));
|
|
));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2408,7 +2412,7 @@ mod tests {
|
|
|
|
|
|
|
|
let key = Pubkey::new_unique();
|
|
let key = Pubkey::new_unique();
|
|
|
let name = "a_builtin_name";
|
|
let name = "a_builtin_name";
|
|
|
- let program = LoadedProgram::new_builtin(
|
|
|
|
|
|
|
+ let program = ProgramCacheEntry::new_builtin(
|
|
|
0,
|
|
0,
|
|
|
name.len(),
|
|
name.len(),
|
|
|
|_invoke_context, _param0, _param1, _param2, _param3, _param4| {},
|
|
|_invoke_context, _param0, _param1, _param2, _param3, _param4| {},
|
|
@@ -2421,20 +2425,20 @@ mod tests {
|
|
|
name.as_bytes()
|
|
name.as_bytes()
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- let mut loaded_programs_for_tx_batch = LoadedProgramsForTxBatch::new_from_cache(
|
|
|
|
|
|
|
+ let mut loaded_programs_for_tx_batch = ProgramCacheForTxBatch::new_from_cache(
|
|
|
0,
|
|
0,
|
|
|
0,
|
|
0,
|
|
|
&batch_processor.program_cache.read().unwrap(),
|
|
&batch_processor.program_cache.read().unwrap(),
|
|
|
);
|
|
);
|
|
|
batch_processor.program_cache.write().unwrap().extract(
|
|
batch_processor.program_cache.write().unwrap().extract(
|
|
|
- &mut vec![(key, (LoadedProgramMatchCriteria::NoCriteria, 1))],
|
|
|
|
|
|
|
+ &mut vec![(key, (ProgramCacheMatchCriteria::NoCriteria, 1))],
|
|
|
&mut loaded_programs_for_tx_batch,
|
|
&mut loaded_programs_for_tx_batch,
|
|
|
true,
|
|
true,
|
|
|
);
|
|
);
|
|
|
let entry = loaded_programs_for_tx_batch.find(&key).unwrap();
|
|
let entry = loaded_programs_for_tx_batch.find(&key).unwrap();
|
|
|
|
|
|
|
|
- // Repeating code because LoadedProgram does not implement clone.
|
|
|
|
|
- let program = LoadedProgram::new_builtin(
|
|
|
|
|
|
|
+ // Repeating code because ProgramCacheEntry does not implement clone.
|
|
|
|
|
+ let program = ProgramCacheEntry::new_builtin(
|
|
|
0,
|
|
0,
|
|
|
name.len(),
|
|
name.len(),
|
|
|
|_invoke_context, _param0, _param1, _param2, _param3, _param4| {},
|
|
|_invoke_context, _param0, _param1, _param2, _param3, _param4| {},
|