diff --git a/program-runtime/src/invoke_context.rs b/program-runtime/src/invoke_context.rs index af5e0c688411b6..49cd757daf27c8 100644 --- a/program-runtime/src/invoke_context.rs +++ b/program-runtime/src/invoke_context.rs @@ -169,6 +169,7 @@ pub struct InvokeContext<'a> { pub programs_loaded_for_tx_batch: &'a ProgramCacheForTxBatch, pub programs_modified_by_tx: &'a mut ProgramCacheForTxBatch, pub feature_set: Arc, + pub get_epoch_stake_callback: &'a dyn Fn(&'a Pubkey) -> u64, pub timings: ExecuteDetailsTimings, pub blockhash: Hash, pub lamports_per_signature: u64, @@ -186,6 +187,7 @@ impl<'a> InvokeContext<'a> { programs_loaded_for_tx_batch: &'a ProgramCacheForTxBatch, programs_modified_by_tx: &'a mut ProgramCacheForTxBatch, feature_set: Arc, + get_epoch_stake_callback: &'a dyn Fn(&'a Pubkey) -> u64, blockhash: Hash, lamports_per_signature: u64, ) -> Self { @@ -199,6 +201,7 @@ impl<'a> InvokeContext<'a> { programs_loaded_for_tx_batch, programs_modified_by_tx, feature_set, + get_epoch_stake_callback, timings: ExecuteDetailsTimings::default(), blockhash, lamports_per_signature, @@ -685,6 +688,7 @@ macro_rules! with_mock_invoke_context { &programs_loaded_for_tx_batch, &mut programs_modified_by_tx, Arc::new(FeatureSet::all_enabled()), + &|_| 0, Hash::default(), 0, ); diff --git a/runtime/src/bank/builtins/core_bpf_migration/mod.rs b/runtime/src/bank/builtins/core_bpf_migration/mod.rs index 384778b6ed99a9..182d39809ecdfe 100644 --- a/runtime/src/bank/builtins/core_bpf_migration/mod.rs +++ b/runtime/src/bank/builtins/core_bpf_migration/mod.rs @@ -195,6 +195,7 @@ impl Bank { &programs_loaded, &mut programs_modified, self.feature_set.clone(), + &|_| 0, Hash::default(), 0, ); diff --git a/svm/src/message_processor.rs b/svm/src/message_processor.rs index 15de67d20486bb..65f2de59a2f672 100644 --- a/svm/src/message_processor.rs +++ b/svm/src/message_processor.rs @@ -280,6 +280,7 @@ mod tests { &programs_loaded_for_tx_batch, &mut programs_modified_by_tx, Arc::new(FeatureSet::all_enabled()), + &|_| 0, Hash::default(), 0, ); @@ -331,6 +332,7 @@ mod tests { &programs_loaded_for_tx_batch, &mut programs_modified_by_tx, Arc::new(FeatureSet::all_enabled()), + &|_| 0, Hash::default(), 0, ); @@ -372,6 +374,7 @@ mod tests { &programs_loaded_for_tx_batch, &mut programs_modified_by_tx, Arc::new(FeatureSet::all_enabled()), + &|_| 0, Hash::default(), 0, ); @@ -504,6 +507,7 @@ mod tests { &programs_loaded_for_tx_batch, &mut programs_modified_by_tx, Arc::new(FeatureSet::all_enabled()), + &|_| 0, Hash::default(), 0, ); @@ -540,6 +544,7 @@ mod tests { &programs_loaded_for_tx_batch, &mut programs_modified_by_tx, Arc::new(FeatureSet::all_enabled()), + &|_| 0, Hash::default(), 0, ); @@ -573,6 +578,7 @@ mod tests { &programs_loaded_for_tx_batch, &mut programs_modified_by_tx, Arc::new(FeatureSet::all_enabled()), + &|_| 0, Hash::default(), 0, ); @@ -667,6 +673,7 @@ mod tests { &programs_loaded_for_tx_batch, &mut programs_modified_by_tx, Arc::new(FeatureSet::all_enabled()), + &|_| 0, Hash::default(), 0, ); diff --git a/svm/src/transaction_processor.rs b/svm/src/transaction_processor.rs index 6e292d6b5806e8..74be921e35f602 100644 --- a/svm/src/transaction_processor.rs +++ b/svm/src/transaction_processor.rs @@ -673,6 +673,7 @@ impl TransactionBatchProcessor { programs_loaded_for_tx_batch.latest_root_epoch, ); let sysvar_cache = &self.sysvar_cache.read().unwrap(); + let epoch_stake_callback = |pubkey| callback.get_epoch_stake(pubkey); let mut invoke_context = InvokeContext::new( &mut transaction_context, @@ -682,6 +683,7 @@ impl TransactionBatchProcessor { programs_loaded_for_tx_batch, &mut programs_modified_by_tx, callback.get_feature_set(), + &epoch_stake_callback, blockhash, lamports_per_signature, );