Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko committed Jun 5, 2024
1 parent fc17dbb commit 2a81ffe
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 1,448 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,16 @@ A few other notes:

### Generating Witnesses Only

If you want to test a block without the high CPU & memory requirements that come with creating a full proof, you can instead generate only the witness using `tools/debug_block.sh`:
If you want to test a block without the high CPU & memory requirements that come with creating a full proof, you can instead generate only the witness using `tools/prove_blocks.sh` in the `test_only` mode:

```sh
./debug_block.sh <BLOCK_NUMBER> <FULL_NODE_ENDPOINT>
./prove_blocks.sh <START_BLOCK> <END_BLOCK> <FULL_NODE_ENDPOINT> <IGNORE_PREVIOUS_PROOFS> test_only
```

Filled in:

```sh
./debug_block.sh 18299898 http://34.89.57.138:8545
./prove_blocks.sh 18299898 18299899 http://34.89.57.138:8545 true test_only
```

Finally, note that both of these testing scripts force proof generation to be sequential by allowing only one worker. Because of this, this is not a realistic representation of performance but makes the debugging logs much easier to follow.
Expand Down
3 changes: 1 addition & 2 deletions common/src/block_interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use alloy::primitives::B256;
use alloy::rpc::types::eth::BlockId;
use alloy::{hex, providers::Provider, transports::Transport};
use async_stream::try_stream;
use futures::Stream;
use thiserror::Error;
use tokio_stream::Stream;
use tracing::{error, info};

use crate::parsing;
Expand All @@ -27,7 +27,6 @@ pub enum BlockIntervalError {
}

/// Range of blocks to be processed and proven.
#[allow(unused)]
#[derive(Debug, PartialEq, Clone)]
pub enum BlockInterval {
// A single block number.
Expand Down
5 changes: 1 addition & 4 deletions leader/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ pub(crate) enum Command {
// The Jerigon RPC URL.
#[arg(long, short = 'u', value_hint = ValueHint::Url)]
rpc_url: String,
/// The block number for which to generate a proof.
#[arg(short, long)]
block_number: Option<u64>,
/// The block interval for which to generate a proof.
#[arg(long, short = 'i')]
block_interval: Option<String>,
block_interval: String,
/// The checkpoint block number.
#[arg(short, long, default_value_t = 0)]
checkpoint_block_number: u64,
Expand Down
4 changes: 2 additions & 2 deletions leader/src/jerigon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ pub(crate) async fn jerigon_main(
)
.await?;

let previous_block_proof = previous_proof.map(|proof| GeneratedBlockProof {
let checkpoint_block_proof = previous_proof.map(|proof| GeneratedBlockProof {
b_height: checkpoint_block_number,
intern: proof,
});

let block_proofs = prover_input
.prove(&runtime, previous_block_proof, save_inputs_on_error)
.prove(&runtime, checkpoint_block_proof, save_inputs_on_error)
.await?;
runtime.close().await?;

Expand Down
12 changes: 1 addition & 11 deletions leader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,14 @@ async fn main() -> Result<()> {
}
Command::Jerigon {
rpc_url,
block_number,
block_interval,
checkpoint_block_number,
previous_proof,
proof_output_dir,
save_inputs_on_error,
} => {
let previous_proof = get_previous_proof(previous_proof)?;

let block_interval = if let Some(block_number) = block_number {
BlockInterval::Single(block_number)
} else if let Some(s) = block_interval {
BlockInterval::new(&s)?
} else {
return Err(anyhow::Error::msg(
"block_number or block_interval must be provided as command line parameter",
));
};
let block_interval = BlockInterval::new(&block_interval)?;

info!("Proving {block_interval}");

Expand Down
39 changes: 0 additions & 39 deletions tools/debug_block.sh

This file was deleted.

1,387 changes: 0 additions & 1,387 deletions tools/witness.json

This file was deleted.

0 comments on commit 2a81ffe

Please sign in to comment.