This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
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
18 changed files
with
202 additions
and
51 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
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,14 @@ | ||
[package] | ||
name = "common" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
serde = { workspace = true } | ||
plonky_block_proof_gen = { workspace = true } | ||
proof_protocol_decoder = { workspace = true } | ||
tracing = { workspace = true } | ||
paladin-core = { workspace = true } | ||
ethereum-types = { workspace = true } | ||
anyhow = { workspace = true } | ||
ops = { path = "../ops" } |
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,4 @@ | ||
pub const MATIC_CHAIN_ID: u64 = 137; | ||
|
||
mod prover_input; | ||
pub use prover_input::ProverInput; |
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
This file was deleted.
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,14 @@ | ||
use std::io::Write; | ||
|
||
use anyhow::Result; | ||
use paladin::runtime::Runtime; | ||
|
||
/// The main function for the jerigon mode. | ||
pub(crate) async fn jerigon_main(runtime: Runtime, rpc_url: &str, block_number: u64) -> Result<()> { | ||
let prover_input = rpc::fetch_prover_input(rpc_url, block_number).await?; | ||
|
||
let proof = prover_input.prove(&runtime).await?; | ||
std::io::stdout().write_all(&serde_json::to_vec(&proof.intern)?)?; | ||
|
||
Ok(()) | ||
} |
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
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,20 @@ | ||
[package] | ||
name = "rpc" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
tokio = { workspace = true } | ||
tracing = { workspace = true } | ||
tracing-subscriber = { workspace = true } | ||
anyhow = { workspace = true } | ||
serde = { workspace = true } | ||
proof_protocol_decoder = { workspace = true } | ||
serde_json = { workspace = true } | ||
serde_path_to_error = { workspace = true } | ||
clap = { workspace = true } | ||
ethereum-types = { workspace = true } | ||
reqwest = { version = "0.11.22", features = ["json"] } | ||
thiserror = "1.0.50" | ||
plonky2_evm = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "49976ea2a98dcb6052bd6cf3a65f730e55727330" } | ||
common = { path = "../common" } |
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,20 @@ | ||
use clap::{Parser, Subcommand, ValueHint}; | ||
|
||
#[derive(Parser)] | ||
pub(crate) struct Cli { | ||
#[command(subcommand)] | ||
pub(crate) command: Commands, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
pub(crate) enum Commands { | ||
/// Fetch and generate prover input from the RPC endpoint | ||
Fetch { | ||
/// The RPC URL | ||
#[arg(short, long, value_hint = ValueHint::Url)] | ||
rpc_url: String, | ||
/// The block number | ||
#[arg(short, long)] | ||
block_number: u64, | ||
}, | ||
} |
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,11 @@ | ||
use tracing_subscriber::{fmt::format::FmtSpan, prelude::*, util::SubscriberInitExt, EnvFilter}; | ||
pub(crate) fn tracing() { | ||
tracing_subscriber::Registry::default() | ||
.with( | ||
tracing_subscriber::fmt::layer() | ||
.pretty() | ||
.with_span_events(FmtSpan::CLOSE) | ||
.with_filter(EnvFilter::from_default_env()), | ||
) | ||
.init(); | ||
} |
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,2 @@ | ||
mod rpc; | ||
pub use rpc::fetch_prover_input; |
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,27 @@ | ||
use std::io::Write; | ||
|
||
use anyhow::Result; | ||
use clap::Parser; | ||
use cli::Commands; | ||
use rpc::fetch_prover_input; | ||
|
||
mod cli; | ||
mod init; | ||
mod rpc; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
init::tracing(); | ||
let args = cli::Cli::parse(); | ||
|
||
match args.command { | ||
Commands::Fetch { | ||
rpc_url, | ||
block_number, | ||
} => { | ||
let prover_input = fetch_prover_input(&rpc_url, block_number).await?; | ||
std::io::stdout().write_all(&serde_json::to_vec(&prover_input)?)?; | ||
} | ||
} | ||
Ok(()) | ||
} |
Oops, something went wrong.