diff --git a/rpc-client-api/src/config.rs b/rpc-client-api/src/config.rs
index 05e97b9594..dbefc95137 100644
--- a/rpc-client-api/src/config.rs
+++ b/rpc-client-api/src/config.rs
@@ -49,8 +49,14 @@ pub struct RpcSimulateTransactionConfig {
#[derive(Serialize, Deserialize, Clone, Copy, Debug, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub enum SimulationSlotConfig {
+ /// Simulate on top of bank with the provided commitment.
Commitment(CommitmentConfig),
+
+ /// Simulate on the provided slot's bank.
Slot(Slot),
+
+ /// Simulates on top of the RPC's highest slot's bank i.e. the working bank.
+ Tip,
}
impl Default for SimulationSlotConfig {
diff --git a/rpc-client/src/nonblocking/rpc_client.rs b/rpc-client/src/nonblocking/rpc_client.rs
index f8201e4215..bb1c7fa21e 100644
--- a/rpc-client/src/nonblocking/rpc_client.rs
+++ b/rpc-client/src/nonblocking/rpc_client.rs
@@ -5446,6 +5446,7 @@ impl RpcClient {
T: serde::de::DeserializeOwned,
{
let response = self.sender.send_batch(requests_and_params).await?;
+ debug!("response: {:?}", response);
serde_json::from_value(response).map_err(|err| ClientError {
request: None,
diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs
index 605240a572..63a8e2afe5 100644
--- a/rpc/src/rpc.rs
+++ b/rpc/src/rpc.rs
@@ -4036,6 +4036,7 @@ pub mod rpc_full {
SimulationSlotConfig::Slot(slot) => meta.bank_from_slot(slot).ok_or_else(|| {
Error::invalid_params(format!("bank not found for the provided slot: {}", slot))
}),
+ SimulationSlotConfig::Tip => Ok(meta.bank_forks.read().unwrap().working_bank()),
}?;
// TODO: Come back to this and allow unfrozen bank as long as the parent is frozen.
diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs
index 22e016a1e0..2742b3f1cc 100644
--- a/runtime/src/bank.rs
+++ b/runtime/src/bank.rs
@@ -3851,24 +3851,9 @@ impl Bank {
pre_execution_accounts_requested: Vec