Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Aug 30, 2024
1 parent 16dc0df commit 7664529
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 27 deletions.
3 changes: 2 additions & 1 deletion client-programs/aggregation/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ use std::collections::HashMap;
/// TODO: The aggregation program should take in an arbitrary vkey digest, and the smart contract
/// should verify the proof matches the arbitrary vkey digest stored in the contract. This means
/// that the aggregate program would no longer need to update this value.
const MULTI_BLOCK_PROGRAM_VKEY_DIGEST: [u32; 8] = [1172625895, 1280247262, 651076015, 321432881, 243715685, 1565992912, 1444792760, 1908047081];
const MULTI_BLOCK_PROGRAM_VKEY_DIGEST: [u32; 8] =
[1172625895, 1280247262, 651076015, 321432881, 243715685, 1565992912, 1444792760, 1908047081];

/// Verify that the L1 heads in the boot infos are in the header chain.
fn verify_l1_heads(agg_inputs: &AggregationInputs, headers: &[Header]) {
Expand Down
7 changes: 4 additions & 3 deletions crates/client-utils/src/precompiles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use alloc::sync::Arc;
use kona_executor::PrecompileOverride;
use kona_mpt::{TrieDB, TrieDBFetcher, TrieDBHinter};
use revm::precompile::secp256r1;
use revm::{
db::states::state::State,
handler::register::EvmHandler,
precompile::{
bn128, secp256k1, Precompile, PrecompileResult, PrecompileSpecId, PrecompileWithAddress,
bn128, secp256k1, secp256r1, Precompile, PrecompileResult, PrecompileSpecId,
PrecompileWithAddress,
},
primitives::Bytes,
ContextPrecompiles,
Expand Down Expand Up @@ -84,7 +84,8 @@ where
// Alphanet does the same here: https://github.com/paradigmxyz/alphanet/blob/f28e4220a1a637c19ef6b4928e9a427560d46fcb/crates/node/src/evm.rs#L53-L56
ctx_precompiles.extend(secp256r1::precompiles());

// Extend with ZKVM-accelerated precompiles and annotated precompiles that track the cycle count.
// Extend with ZKVM-accelerated precompiles and annotated precompiles that track the
// cycle count.
let override_precompiles = [
ANNOTATED_BN_ADD,
ANNOTATED_BN_MUL,
Expand Down
4 changes: 2 additions & 2 deletions crates/host-utils/src/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use alloy_primitives::keccak256;
use crate::{L2Output, ProgramType};

#[derive(Clone)]
/// The OPSuccinctDataFetcher struct is used to fetch the L2 output data and L2 claim data for a given block number.
/// It is used to generate the boot info for the native host program.
/// The OPSuccinctDataFetcher struct is used to fetch the L2 output data and L2 claim data for a
/// given block number. It is used to generate the boot info for the native host program.
pub struct OPSuccinctDataFetcher {
pub l1_rpc: String,
pub l1_provider: Arc<RootProvider<Http<Client>>>,
Expand Down
7 changes: 4 additions & 3 deletions op-succinct-proposer/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ async fn request_span_proof(
fs::create_dir_all(&data_dir)?;

// Start the server and native client with a timeout.
// Note: Ideally, the server should call out to a separate process that executes the native host,
// and return an ID that the client can poll on to check if the proof was submitted.
// TODO: If this fails, we should definitely NOT request a proof! Otherwise, we get execution failures on the cluster.
// Note: Ideally, the server should call out to a separate process that executes the native
// host, and return an ID that the client can poll on to check if the proof was submitted.
// TODO: If this fails, we should definitely NOT request a proof! Otherwise, we get execution
// failures on the cluster.
run_native_host(&host_cli, Duration::from_secs(60)).await?;

let sp1_stdin = get_proof_stdin(&host_cli)?;
Expand Down
18 changes: 3 additions & 15 deletions op-succinct-proposer/bin/span_batch_ranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ async fn get_span_batch_ranges_from_server(
env::var("SPAN_BATCH_SERVER_URL").unwrap_or("http://localhost:8080".to_string());
let query_url = format!("{}/span-batch-ranges", span_batch_server_url);

let response: SpanBatchResponse = client
.post(&query_url)
.json(&request)
.send()
.await?
.json()
.await?;
let response: SpanBatchResponse =
client.post(&query_url).json(&request).send().await?.json().await?;

Ok(response.ranges)
}
Expand All @@ -82,14 +77,7 @@ async fn main() -> Result<()> {
args.start,
args.end,
l2_chain_id,
rollup_config
.genesis
.system_config
.clone()
.unwrap()
.batcher_address
.to_string()
.as_str(),
rollup_config.genesis.system_config.clone().unwrap().batcher_address.to_string().as_str(),
)
.await?;

Expand Down
3 changes: 2 additions & 1 deletion op-succinct-proposer/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ fn main() {
let programs = vec!["range"];

for program in programs {
// Note: Don't comment this out, because the Docker program depends on the native program for range being built.
// Note: Don't comment this out, because the Docker program depends on the native program
// for range being built.
build_native_program(program);
build_zkvm_program(program);
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.79.0"
channel = "nightly-2024-08-01"
components = ["llvm-tools", "rustc-dev"]
5 changes: 4 additions & 1 deletion zkvm-host/bin/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use std::{fs, time::Instant};
use anyhow::Result;
use clap::Parser;
use host_utils::{
fetcher::{ChainMode, OPSuccinctDataFetcher}, get_proof_stdin, stats::get_execution_stats, ProgramType
fetcher::{ChainMode, OPSuccinctDataFetcher},
get_proof_stdin,
stats::get_execution_stats,
ProgramType,
};
use kona_host::start_server_and_native_client;
use sp1_sdk::{utils, ProverClient};
Expand Down

0 comments on commit 7664529

Please sign in to comment.