Skip to content

Commit

Permalink
fix: cleanup cli argumetns
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko committed Oct 3, 2024
1 parent 208385e commit 8a74979
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion zero/src/bin/leader/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub(crate) enum Command {
#[arg(long, short = 't', default_value = "jerigon")]
rpc_type: RpcType,
/// The source of jumpdest tables.
#[arg(short = 'j', long, default_value_ifs = [("rpc_type", "jerigon", "server-fetched-structlogs"), ("rpc_type", "native", "server-fetched-structlogs")], required = false)]
#[arg(short = 'j', long, default_value_ifs = [("rpc_type", "jerigon", "client-fetched-structlogs"), ("rpc_type", "native", "client-fetched-structlogs")], required = false)]
jumpdest_src: JumpdestSrc,
/// The block interval for which to generate a proof.
#[arg(long, short = 'i')]
Expand Down
2 changes: 1 addition & 1 deletion zero/src/bin/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct RpcToolConfig {
#[arg(short = 't', long, default_value = "jerigon")]
rpc_type: RpcType,
/// The source of jumpdest tables.
#[arg(short = 'j', long, default_value_ifs = [("rpc_type", "jerigon", "server-fetched-structlogs"), ("rpc_type", "native", "server-fetched-structlogs")], required = false)]
#[arg(short = 'j', long, default_value_ifs = [("rpc_type", "jerigon", "client-fetched-structlogs"), ("rpc_type", "native", "client-fetched-structlogs")], required = false)]
jumpdest_src: JumpdestSrc,
/// Backoff in milliseconds for retry requests.
#[arg(long, default_value_t = 0)]
Expand Down
7 changes: 2 additions & 5 deletions zero/src/rpc/jerigon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use alloy::{
rpc::types::{eth::BlockId, Block, BlockTransactionsKind},
transports::Transport,
};
use anyhow::{bail, Context as _};
use anyhow::Context as _;
use compat::Compat;
use evm_arithmetization::{jumpdest::JumpDestTableWitness, CodeDb};
use serde::Deserialize;
Expand Down Expand Up @@ -64,7 +64,7 @@ where
let block_jumpdest_table_witnesses: Vec<Option<(JumpDestTableWitness, CodeDb)>> =
match jumpdest_src {
JumpdestSrc::ProverSimulation => Vec::new(),
JumpdestSrc::ServerFetchedStructlogs => {
JumpdestSrc::ClientFetchedStructlogs => {
process_transactions(
&block,
cached_provider.get_provider().await?.deref(),
Expand All @@ -73,9 +73,6 @@ where
.await?
}
JumpdestSrc::Serverside => todo!(),
JumpdestSrc::ClientFetchedStructlogs => {
bail!("client per transaction structlogs fetching is not supported for jerigon RPC type");
}
};

let mut code_db = CodeDb::default();
Expand Down
3 changes: 1 addition & 2 deletions zero/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ pub enum RpcType {
pub enum JumpdestSrc {
ProverSimulation,
ClientFetchedStructlogs,
ServerFetchedStructlogs, // later
Serverside, // later
Serverside, // later
}

/// Obtain the prover input for one block
Expand Down
7 changes: 1 addition & 6 deletions zero/src/rpc/native/txn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,14 @@ where

let block_structlogs = match jumpdest_src {
JumpdestSrc::ProverSimulation => vec![None; block_prestate_trace.len()],
JumpdestSrc::ServerFetchedStructlogs => {
JumpdestSrc::ClientFetchedStructlogs => {
get_block_normalized_structlogs(provider, &BlockNumberOrTag::from(block.header.number))
.await?
.into_iter()
.map(|tx_struct_log| Some(tx_struct_log.1))
.collect()
}
JumpdestSrc::Serverside => todo!(),
JumpdestSrc::ClientFetchedStructlogs => {
bail!(
"client per transaction structlogs fetching is not supported for native RPC type"
);
}
};

block
Expand Down

0 comments on commit 8a74979

Please sign in to comment.