forked from 0xPolygonZero/zk_evm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
use alloy::{eips::BlockId, transports::http::reqwest::Url}; | ||
use anyhow::Result; | ||
use clap::{arg, Args, ValueEnum, ValueHint}; | ||
|
||
#[derive(ValueEnum, Clone)] | ||
enum RpcType { | ||
Jerigon, | ||
Native, | ||
} | ||
|
||
#[derive(ValueEnum, Clone)] | ||
enum RunMode { | ||
/// Dummy proof is generated only. Useful for quickly testing decoding and | ||
/// all other non-proving logic. | ||
Test, | ||
/// The proof generated but is not verified. | ||
Prove, | ||
/// The proof generated and verified. | ||
Verify, | ||
} | ||
|
||
#[derive(Args)] | ||
pub struct ProveRpcArgs { | ||
/// The node RPC URL. | ||
#[arg(short = 'u', value_hint = ValueHint::Url)] | ||
rpc_url: Url, | ||
/// The RPC type (jerigon or native). | ||
#[arg(short = 't', long)] | ||
rpc_type: RpcType, | ||
/// The start of the block range to prove (inclusive). | ||
#[arg(short = 's', long)] | ||
start_block: BlockId, | ||
/// The end of the block range to prove. If None, start_block-1 is used. | ||
#[arg(short = 'e', long)] | ||
checkpoint_block: Option<BlockId>, | ||
/// The end of the block range to prove (inclusive). | ||
#[arg(short = 'e', long)] | ||
end_block: Option<BlockId>, | ||
/// Backoff in milliseconds for retry requests | ||
#[arg(short = 'b', long, default_value_t = 0)] | ||
backoff: u64, | ||
/// The maximum number of retries | ||
#[arg(short = 'r', long, default_value_t = 0)] | ||
max_retries: u32, | ||
/// Whether to generate a proof and verify it or not. | ||
#[arg(short = 'm', long)] | ||
mode: RunMode, | ||
} | ||
// 1 --> Start block (number in decimal or block hash with prefix 0x). E.g. | ||
// `1234` or `0x1d5e7a08dd1f4ce7fa52afe7f4960d78e82e508c874838dee594d5300b8df625`. | ||
// 2 --> End block (number or hash, inclusive). Same format as start block. | ||
// 3 --> Rpc endpoint:port (eg. http://35.246.1.96:8545) | ||
// 4 --> Rpc type (eg. jerigon / native) | ||
// 5 --> Checkpoint block (number or hash). If argument is missing, start block | ||
// predecessor will be used. 6 --> Backoff in milliseconds (optional [default: | ||
// 0]) 7 --> Number of retries (optional [default: 0]) | ||
// 8 --> Test run only flag `test_only` (optional) | ||
|
||
pub fn prove_via_rpc(args: ProveRpcArgs) -> Result<()> { | ||
todo!() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters