Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
Signed-off-by: smtmfft <[email protected]>
  • Loading branch information
smtmfft committed Feb 8, 2025
1 parent 0ef3972 commit 0e1f1ed
Show file tree
Hide file tree
Showing 21 changed files with 1,187 additions and 358 deletions.
60 changes: 8 additions & 52 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,21 @@ dotenv = "0.15.0"
backoff = "0.4.0"

[patch.crates-io]
revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" }
revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" }
revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" }
# revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" }
# revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" }
# revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v36-taiko" }
revm = {path = "../../taiko/revm/crates/revm"}
revm-primitives = {path = "../../taiko/revm/crates/primitives"}
revm-precompile = {path = "../../taiko/revm/crates/precompile"}
secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch" }
blst = { git = "https://github.com/CeciliaZ030/blst.git", branch = "v0.3.12-serialize" }
alloy-serde = { git = "https://github.com/CeciliaZ030/alloy.git", branch = "v0.1.4-fix" }

[patch."https://github.com/taikoxyz/taiko-reth.git"]
reth-primitives = { path = "../../taiko/taiko-reth/crates/primitives" }
reth-evm-ethereum = { path = "../../taiko/taiko-reth/crates/ethereum/evm" }
reth-evm = { path = "../../taiko/taiko-reth/crates/evm" }
reth-rpc-types = { path = "../../taiko/taiko-reth/crates/rpc/rpc-types" }
reth-revm = { path = "../../taiko/taiko-reth/crates/revm" }
reth-chainspec = { path = "../../taiko/taiko-reth/crates/chainspec" }
reth-provider = { path = "../../taiko/taiko-reth/crates/storage/provider" }
21 changes: 14 additions & 7 deletions core/src/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use alloy_primitives::{Address, B256};
use clap::Args;
use raiko_lib::{
input::{
AggregationGuestInput, AggregationGuestOutput, BlobProofType, GuestBatchInput, GuestInput,
GuestOutput,
AggregationGuestInput, AggregationGuestOutput, BlobProofType, GuestBatchInput,
GuestBatchOutput, GuestInput, GuestOutput,
},
proof_type::ProofType,
prover::{IdStore, IdWrite, Proof, ProofKey, Prover, ProverError},
Expand Down Expand Up @@ -124,13 +124,12 @@ pub async fn run_prover(
pub async fn run_batch_prover(
proof_type: ProofType,
input: GuestBatchInput,
output: &GuestOutput,
output: &GuestBatchOutput,
config: &Value,
store: Option<&mut dyn IdWrite>,
) -> RaikoResult<Vec<Proof>> {
let shared_store = store.map(|s| Arc::new(Mutex::new(s)));
) -> RaikoResult<Proof> {
match proof_type {
ProofType::Native => NativeProver::batch_run(input.clone(), output, config, shared_store)
ProofType::Native => NativeProver::batch_run(input.clone(), output, config, store)
.await
.map_err(<ProverError as Into<RaikoError>>::into),
ProofType::Sp1 => {
Expand All @@ -151,7 +150,7 @@ pub async fn run_batch_prover(
}
ProofType::Sgx => {
#[cfg(feature = "sgx")]
return sgx_prover::SgxProver::run(input.clone(), output, config, store)
return sgx_prover::SgxProver::batch_run(input.clone(), output, config, store)
.await
.map_err(|e| e.into());
#[cfg(not(feature = "sgx"))]
Expand Down Expand Up @@ -244,6 +243,8 @@ pub async fn cancel_proof(
pub struct ProofRequest {
/// The block number for the block to generate a proof for.
pub block_number: u64,
/// The block number for the block to generate a proof for.
pub batch_id: u64,
/// The l1 block number of the l2 block be proposed.
pub l1_inclusion_block_number: u64,
/// The l2_l1 block pairs for batch proof generation.
Expand Down Expand Up @@ -274,6 +275,9 @@ pub struct ProofRequestOpt {
/// The block number for the block to generate a proof for.
pub block_number: Option<u64>,
#[arg(long, require_equals = true)]
/// The batch id for the batch of blocks to generate a proof for.
pub batch_id: Option<u64>,
#[arg(long, require_equals = true)]
/// The block number for the l2 block to be proposed.
/// in hekla, it is the anchored l1 block height - 1
/// in ontake, it is the anchored l1 block height - (1..64)
Expand Down Expand Up @@ -362,6 +366,7 @@ impl TryFrom<ProofRequestOpt> for ProofRequest {
block_number: value.block_number.ok_or(RaikoError::InvalidRequestConfig(
"Missing block number".to_string(),
))?,
batch_id: value.batch_id.unwrap_or_default(),
l1_inclusion_block_number: value.l1_inclusion_block_number.unwrap_or_default(),
network: value.network.ok_or(RaikoError::InvalidRequestConfig(
"Missing network".to_string(),
Expand Down Expand Up @@ -445,6 +450,7 @@ impl From<AggregationRequest> for Vec<ProofRequestOpt> {
.map(
|&(block_number, l1_inclusion_block_number)| ProofRequestOpt {
block_number: Some(block_number),
batch_id: None,
l1_inclusion_block_number,
l2_l1_block_pairs: Vec::new(),
network: value.network.clone(),
Expand All @@ -464,6 +470,7 @@ impl From<AggregationRequest> for ProofRequestOpt {
fn from(value: AggregationRequest) -> Self {
ProofRequestOpt {
block_number: None,
batch_id: None,
l1_inclusion_block_number: None,
l2_l1_block_pairs: value.block_numbers.iter().map(|(id, _)| *id).collect(),
network: value.network,
Expand Down
Loading

0 comments on commit 0e1f1ed

Please sign in to comment.