Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 16 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.1.11"
version = "0.1.12"
edition = "2021"
description = "Surfpool is the best place to train before surfing Solana."
license = "Apache-2.0"
Expand All @@ -24,6 +24,7 @@ surfpool-core = { path = "crates/core", default-features = false }
surfpool-gql = { path = "crates/gql", default-features = false }
surfpool-subgraph = { path = "crates/subgraph", default-features = false }
surfpool-types = { path = "crates/types", default-features = false }
# litesvm = { path = "../litesvm/crates/litesvm", features = ["nodejs-internal"] }
litesvm = { version = "0.6.0", features = ["nodejs-internal"] }
solana-sdk = "2.2.1"
solana-program = "2.2.1"
Expand Down Expand Up @@ -62,9 +63,10 @@ solana-svm = "2.2.1"
solana-program-runtime = "2.2.1"
agave-geyser-plugin-interface = "2.2.1"
solana-streamer = "2.2.1"
spl-associated-token-account = "6.0.0"
ipc-channel = "0.19.0"
serde = "1.0.217"
serde_bytes = "0.11.17"
serde_with = "3"
serde_derive = "1.0.217" # must match the serde version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
serde_json = "1.0.135"
# txtx-addon-kit = { path = "../txtx/crates/txtx-addon-kit", features = ["wasm"]}
Expand All @@ -73,10 +75,10 @@ serde_json = "1.0.135"
# txtx-addon-network-svm-types = { package = "txtx-addon-network-svm-types", path = "../txtx/addons/svm/types" }
# txtx-gql = { path = "../txtx/crates/txtx-gql" }
# txtx-supervisor-ui = { path = "../txtx/crates/txtx-supervisor-ui", default-features = false, features = ["bin_build"] }
txtx-addon-kit = { version = "0.2.7", features = ["wasm"] }
txtx-core = { version = "0.2.8" }
txtx-addon-network-svm = { version = "0.1.12" }
txtx-addon-network-svm-types = { version = "0.1.1" }
txtx-addon-kit = { version = "0.2.9", features = ["wasm"] }
txtx-core = { version = "0.2.12" }
txtx-addon-network-svm = { version = "0.1.15" }
txtx-addon-network-svm-types = { version = "0.1.14" }
txtx-gql = { version = "0.2.5" }
txtx-supervisor-ui = { version = "0.1.3", default-features = false, features = ["crates_build"]}
bincode = "1.3.3"
Expand Down
8 changes: 4 additions & 4 deletions crates/cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl StartSimnet {
let mut airdrop_addresses = vec![];
let mut errors = vec![];
for address in self.airdrop_addresses.iter() {
match Pubkey::from_str(&address).map_err(|e| e.to_string()) {
match Pubkey::from_str(address).map_err(|e| e.to_string()) {
Ok(pubkey) => {
airdrop_addresses.push(pubkey);
}
Expand All @@ -148,7 +148,7 @@ impl StartSimnet {
format!(
"{}{}",
dirs::home_dir().unwrap().display(),
keypair_path[1..].to_string()
&keypair_path[1..]
)
} else {
keypair_path.clone()
Expand Down Expand Up @@ -183,7 +183,7 @@ impl StartSimnet {
remote_rpc_url: self.rpc_url.clone(),
slot_time: self.slot_time,
runloop_trigger_mode: surfpool_types::RunloopTriggerMode::Clock,
airdrop_addresses: airdrop_addresses,
airdrop_addresses,
airdrop_token_amount: self.airdrop_token_amount,
}
}
Expand All @@ -196,7 +196,7 @@ impl StartSimnet {
let mut plugin_config_path = self
.plugin_config_path
.iter()
.map(|f| PathBuf::from(f))
.map(PathBuf::from)
.collect::<Vec<_>>();

if plugin_config_path.is_empty() {
Expand Down
8 changes: 4 additions & 4 deletions crates/cli/src/cli/simnet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub async fn handle_start_simnet_command(cmd: &StartSimnet, ctx: &Context) -> Re
config.clone(),
subgraph_events_tx.clone(),
subgraph_commands_rx,
&ctx,
ctx,
)
.await
{
Expand Down Expand Up @@ -150,7 +150,7 @@ pub async fn handle_start_simnet_command(cmd: &StartSimnet, ctx: &Context) -> Re
.map_err(|e| format!("{}", e))?;
}
if let Some(explorer_handle) = explorer_handle {
let _ = explorer_handle.stop(true);
let _ = explorer_handle.stop(true).await;
}
Ok(())
}
Expand Down Expand Up @@ -324,15 +324,15 @@ async fn write_and_execute_iac(

let (progress_tx, progress_rx) = crossbeam::channel::unbounded();

if let Some((_framework, programs)) = deployment {
if let Some((framework, programs)) = deployment {
// Is infrastructure-as-code (IaC) already setup?
let base_location =
FileLocation::from_path_string(&cmd.manifest_path)?.get_parent_location()?;
let mut txtx_manifest_location = base_location.clone();
txtx_manifest_location.append_path("txtx.yml")?;
if !txtx_manifest_location.exists() {
// Scaffold IaC
scaffold_iac_layout(programs, &base_location)?;
scaffold_iac_layout(&framework, programs, &base_location)?;
}

let mut futures = vec![];
Expand Down
8 changes: 4 additions & 4 deletions crates/cli/src/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async fn post_graphql(
.ok_or(actix_web::error::ErrorInternalServerError(
"Missing expected schema",
))?;
graphql_handler(&schema, &context, req, payload).await
graphql_handler(schema, &context, req, payload).await
}

async fn get_graphql(
Expand All @@ -154,7 +154,7 @@ async fn get_graphql(
.ok_or(actix_web::error::ErrorInternalServerError(
"Missing expected schema",
))?;
graphql_handler(&schema, &context, req, payload).await
graphql_handler(schema, &context, req, payload).await
}

async fn subscriptions(
Expand Down Expand Up @@ -232,12 +232,12 @@ fn start_subgraph_runloop(
format!("{err_ctx}: Failed to acquire write lock on subgraph name lookup")
})?;
lookup.insert(
subgraph_uuid.clone(),
subgraph_uuid,
subgraph_name.to_case(Case::Camel),
);
entries_store.insert(
subgraph_name.to_case(Case::Camel),
(subgraph_uuid.clone(), vec![]),
(subgraph_uuid, vec![]),
);
let _ = sender.send("http://127.0.0.1:8900/gql/console".into());
}
Expand Down
42 changes: 18 additions & 24 deletions crates/cli/src/runbook/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ use crate::cli::ExecuteRunbook;
pub fn get_addon_by_namespace(namespace: &str) -> Option<Box<dyn Addon>> {
let available_addons: Vec<Box<dyn Addon>> =
vec![Box::new(StdAddon::new()), Box::new(SvmNetworkAddon::new())];
for addon in available_addons.into_iter() {
if namespace.starts_with(&format!("{}", addon.get_namespace())) {
return Some(addon);
}
}
None
available_addons
.into_iter()
.find(|addon| namespace.starts_with(&addon.get_namespace().to_string()))
}

pub fn load_workspace_manifest_from_manifest_path(
Expand Down Expand Up @@ -209,7 +206,7 @@ pub async fn execute_runbook(
.await?;

ctrlc::set_handler(move || {
let _ = kill_supervised_execution_tx.send(true).unwrap();
kill_supervised_execution_tx.send(true).unwrap();
})
.expect("Error setting Ctrl-C handler");

Expand Down Expand Up @@ -388,17 +385,14 @@ pub async fn configure_supervised_execution(
let _ = hiro_system_kit::thread_named("Kill Runloops Thread")
.spawn(move || {
let future = async {
match kill_loops_rx.recv() {
Ok(_) => {
let _ = block_tx.send(BlockEvent::Exit);
#[cfg(feature = "supervisor_ui")]
let _ = relayer_channel_tx.send(RelayerChannelEvent::Exit);
#[cfg(feature = "supervisor_ui")]
if let Some(handle) = web_ui_handle {
let _ = handle.stop(true).await;
}
if kill_loops_rx.recv().is_ok() {
let _ = block_tx.send(BlockEvent::Exit);
#[cfg(feature = "supervisor_ui")]
let _ = relayer_channel_tx.send(RelayerChannelEvent::Exit);
#[cfg(feature = "supervisor_ui")]
if let Some(handle) = web_ui_handle {
let _ = handle.stop(true).await;
}
Err(_) => {}
};
};

Expand Down Expand Up @@ -475,7 +469,7 @@ pub fn display_snapshot_diffing(
println!("\n{}", yellow!("Runbook Recovery Plan"));
println!("The previous runbook execution was interrupted before completion, causing the following actions to be aborted:");

for (_i, (change, _impacted)) in synthesized_changes.iter().enumerate() {
for (change, _impacted) in synthesized_changes.iter() {
match change {
SynthesizedChange::Edition(_, _) => {}
SynthesizedChange::FormerFailure(_construct_to_run, command_name) => {
Expand Down Expand Up @@ -512,8 +506,8 @@ fn log_actions_to_execute(
let _ = simnet_events_tx.send(SimnetEvent::info(msg));
let documentation_missing = black!("<description field empty>");
for (context, actions) in actions_to_execute.iter() {
let _ = simnet_events_tx.send(SimnetEvent::info(format!("{}", context)));
for (action_name, documentation) in actions.into_iter() {
let _ = simnet_events_tx.send(SimnetEvent::info(context.to_string()));
for (action_name, documentation) in actions.iter() {
let _ = simnet_events_tx.send(SimnetEvent::info(format!(
"- {}: {}",
action_name,
Expand Down Expand Up @@ -576,8 +570,8 @@ fn process_runbook_execution_output(
) {
if let Err(diags) = execution_result {
let _ = simnet_events_tx.send(SimnetEvent::warn("Runbook execution aborted"));
log_diagnostic_lines(diags, &simnet_events_tx);
write_runbook_transient_state(runbook, runbook_state_location, &simnet_events_tx);
log_diagnostic_lines(diags, simnet_events_tx);
write_runbook_transient_state(runbook, runbook_state_location, simnet_events_tx);
} else {
let runbook_outputs = runbook.collect_formatted_outputs();
if !runbook_outputs.is_empty() {
Expand All @@ -596,7 +590,7 @@ fn process_runbook_execution_output(
Ok(output_location) => {
let _ = simnet_events_tx.send(SimnetEvent::info(format!(
"Outputs written to {}",
output_location.to_string()
output_location
)));
}
Err(e) => {
Expand All @@ -617,6 +611,6 @@ fn process_runbook_execution_output(
));
}
}
write_runbook_state(runbook, runbook_state_location, &simnet_events_tx);
write_runbook_state(runbook, runbook_state_location, simnet_events_tx);
}
}
Loading