diff --git a/server/src/cmd/run.rs b/server/src/cmd/run.rs index cb53f25b3fef..0ba53e9eabdf 100644 --- a/server/src/cmd/run.rs +++ b/server/src/cmd/run.rs @@ -78,15 +78,15 @@ pub struct RunArgs { } impl RunArgs { - pub const fn new(rpc_url: String, tx_hash: String) -> Self { + pub const fn new(rpc_url: String, tx_hash: String, quick: bool) -> Self { let rpc_opts = RpcOpts { url: Some(rpc_url), flashbots: false, jwt_secret: None }; - let evm_version = Some(EvmVersion::Istanbul); + let evm_version = Some(EvmVersion::London); Self { tx_hash, debug: false, trace_printer: false, - quick: false, + quick, verbose: false, label: Vec::new(), decode_internal: false, diff --git a/server/src/main.rs b/server/src/main.rs index 89fbbaae5ab0..08d40db840f1 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -5,9 +5,14 @@ use actix_web::{get, web, App, HttpResponse, HttpServer, Responder}; use cmd::{chain::ChainId, run::RunArgs}; use std::{thread, time::Duration}; -async fn run_cast_command(chain: ChainId, tx: String) -> Result { +async fn run_cast_command(chain: ChainId, tx: String, quick: u64) -> Result { let chain_info = chain.info(); - let args: RunArgs = RunArgs::new(chain_info.rpc_url.to_string(), tx); + let quickly_option = match quick { + 1 => true, + _ => false, + }; + + let args: RunArgs = RunArgs::new(chain_info.rpc_url.to_string(), tx, quickly_option); // Run on another thread let handle = thread::spawn(move || { tokio::runtime::Runtime::new().unwrap().block_on(async { args.run().await }) @@ -22,15 +27,15 @@ async fn run_cast_command(chain: ChainId, tx: String) -> Result } #[get("/run_cast/{chain_id}/{tx}")] -async fn cast_command_handler(path: web::Path<(u64, String)>) -> impl Responder { - let (chain_id, tx) = path.into_inner(); +async fn cast_command_handler(path: web::Path<(u64, String, u64)>) -> impl Responder { + let (chain_id, tx, quick) = path.into_inner(); let chain = match ChainId::from_id(chain_id) { Some(chain) => chain, None => ChainId::RoninMainnet, }; - match run_cast_command(chain, tx).await { + match run_cast_command(chain, tx, quick).await { Ok(output) => HttpResponse::Ok().content_type("text/plain").body(output), Err(e) => { println!("Error response: {}", e); @@ -45,7 +50,7 @@ async fn main() -> std::io::Result<()> { let cors = Cors::permissive(); App::new().wrap(cors).service(cast_command_handler) }) - .keep_alive(Duration::from_secs(600)) + .keep_alive(Duration::from_secs(900)) .bind("0.0.0.0:8080")? .workers(5) .run()