dummy prover

This commit is contained in:
Petar Radovic 2025-04-22 16:39:50 +02:00
parent 06fe6e0822
commit e46e675a0d
4 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,6 @@
[package]
name = "evm-prover"
edition = { workspace = true }
[dependencies]
clap = { version = "4.5", features = ["derive"] }

View File

@ -0,0 +1,6 @@
run bin +ARGS:
RUST_LOG=info ./zeth-{{bin}} {{ARGS}}
ethereum +ARGS: (run "ethereum" ARGS)

View File

@ -0,0 +1,54 @@
use clap::Parser;
use std::process::Command;
#[derive(Parser, Debug)]
#[clap(author, version, about = "Ethereum Proof Generation Tool")]
struct Args {
#[clap(long, default_value = "http://localhost:8546")]
rpc: String,
#[clap(long, default_value = "5")]
block_number: u64,
#[clap(long, default_value = "10")]
batch_size: u64,
}
fn run_ethereum_prove(rpc: &str, block_number: u64, batch_size: u64) -> Result<(), String> {
println!(
"Running Ethereum prove for blocks {}-{}",
block_number,
block_number + batch_size - 1
);
let output = Command::new("just")
.args([
"ethereum",
"prove",
&format!("--rpc={}", rpc),
&format!("--block-number={}", block_number),
&format!("--block-count={}", batch_size),
])
.output()
.map_err(|e| format!("Failed to execute just ethereum prove: {}", e))?;
if !output.status.success() {
return Err(format!(
"ethereum prove command failed with status: {}\nStderr: {}",
output.status,
String::from_utf8_lossy(&output.stderr)
));
}
println!("Successfully processed batch");
Ok(())
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = Args::parse();
println!("Starting Ethereum prover...");
run_ethereum_prove(&args.rpc, args.block_number, args.batch_size)?;
Ok(())
}

Binary file not shown.