From 249b7d3ee977c05e003cc79dd5391f6845f4b4b6 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 27 Aug 2024 02:46:12 +0000 Subject: [PATCH] fix: docs among other things --- Cargo.toml | 1 - README.md | 6 ++++ client-programs/range/src/main.rs | 2 +- crates/client-utils/src/oracle/mod.rs | 10 +----- crates/client-utils/src/precompiles/mod.rs | 36 ++++++++++----------- op-succinct-proposer/Dockerfile.op_proposer | 3 +- op-succinct-proposer/src/lib.rs | 2 ++ 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5dcca823..08258745 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,6 @@ alloy-sol-types = { version = "0.7.6" } op-alloy-consensus = { version = "0.1.4", default-features = false } # sp1 -# TODO: Change to stable tag. sp1-lib = { version = "1.2.0-rc1", features = ["verify"] } sp1-zkvm = { version = "1.2.0-rc1", features = ["verify"] } sp1-sdk = { version = "1.2.0-rc1" } diff --git a/README.md b/README.md index 55f4ef58..07c9cf19 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ Standalone repo to use Kona & SP1 to verify OP Stack blocks. + +## ⚠️ Work in Progress + +**Warning**: This repository is currently a work in progress. The code and documentation are actively being developed and may be subject to significant changes. Use with caution and expect frequent updates. + + ## Overview **`crates`** diff --git a/client-programs/range/src/main.rs b/client-programs/range/src/main.rs index 4f58397f..962e0f8e 100644 --- a/client-programs/range/src/main.rs +++ b/client-programs/range/src/main.rs @@ -79,7 +79,7 @@ fn main() { // let precompile_overrides = NoPrecompileOverride; } } - // TODO: Even when I run both with ZKVMPrecompileOverride, I get key not found in cache error. + // TODO: Even when running both with ZKVMPrecompileOverride, I get key not found in cache error. // let precompile_overrides = ZKVMPrecompileOverride::default(); let precompile_overrides = NoPrecompileOverride; diff --git a/crates/client-utils/src/oracle/mod.rs b/crates/client-utils/src/oracle/mod.rs index 03758164..6952f368 100644 --- a/crates/client-utils/src/oracle/mod.rs +++ b/crates/client-utils/src/oracle/mod.rs @@ -73,7 +73,7 @@ impl HintWriterClient for InMemoryOracle { /// and verify it once, rather than verifying each of the 4096 elements separately. #[derive(Default)] struct Blob { - // TODO: This commitment is currently unused. + // TODO: Commitment is currently unused. _commitment: FixedBytes<48>, // 4096 Field elements, each 32 bytes. data: FixedBytes<131072>, @@ -93,14 +93,6 @@ impl InMemoryOracle { PreimageKeyType::Keccak256 => { let derived_key = PreimageKey::new(keccak256(value).into(), PreimageKeyType::Keccak256); - - let is_equal = key == derived_key; - if !is_equal { - println!("value: {:?}", value); - println!("key: {:?}", key); - println!("derived_key: {:?}", derived_key); - } - assert!(is_equal, "zkvm keccak constraint failed!"); } PreimageKeyType::GlobalGeneric => { unimplemented!(); diff --git a/crates/client-utils/src/precompiles/mod.rs b/crates/client-utils/src/precompiles/mod.rs index d85c6a7e..52cac3e6 100644 --- a/crates/client-utils/src/precompiles/mod.rs +++ b/crates/client-utils/src/precompiles/mod.rs @@ -37,16 +37,16 @@ macro_rules! create_annotated_precompile { }; } -// pub(crate) const ANNOTATED_BN_ADD: PrecompileWithAddress = -// create_annotated_precompile!(bn128::add::ISTANBUL, "bn-add"); -// pub(crate) const ANNOTATED_BN_MUL: PrecompileWithAddress = -// create_annotated_precompile!(bn128::mul::ISTANBUL, "bn-mul"); -// pub(crate) const ANNOTATED_BN_PAIR: PrecompileWithAddress = -// create_annotated_precompile!(bn128::pair::ISTANBUL, "bn-pair"); -// pub(crate) const ANNOTATED_KZG_EVAL: PrecompileWithAddress = create_annotated_precompile!( -// revm::precompile::kzg_point_evaluation::POINT_EVALUATION, -// "kzg-eval" -// ); +pub(crate) const ANNOTATED_BN_ADD: PrecompileWithAddress = + create_annotated_precompile!(bn128::add::ISTANBUL, "bn-add"); +pub(crate) const ANNOTATED_BN_MUL: PrecompileWithAddress = + create_annotated_precompile!(bn128::mul::ISTANBUL, "bn-mul"); +pub(crate) const ANNOTATED_BN_PAIR: PrecompileWithAddress = + create_annotated_precompile!(bn128::pair::ISTANBUL, "bn-pair"); +pub(crate) const ANNOTATED_KZG_EVAL: PrecompileWithAddress = create_annotated_precompile!( + revm::precompile::kzg_point_evaluation::POINT_EVALUATION, + "kzg-eval" +); pub(crate) const ANNOTATED_EC_RECOVER: PrecompileWithAddress = create_annotated_precompile!(secp256k1::ECRECOVER, "ec-recover"); @@ -85,14 +85,14 @@ where ContextPrecompiles::new(PrecompileSpecId::from_spec_id(spec_id)).clone(); // Extend with ZKVM-accelerated precompiles and annotated precompiles that track the cycle count. - // let override_precompiles = [ - // // ANNOTATED_BN_ADD, - // // ANNOTATED_BN_MUL, - // // ANNOTATED_BN_PAIR, - // // ANNOTATED_KZG_EVAL, - // // ANNOTATED_EC_RECOVER, - // ]; - // ctx_precompiles.extend(override_precompiles); + let override_precompiles = [ + ANNOTATED_BN_ADD, + ANNOTATED_BN_MUL, + ANNOTATED_BN_PAIR, + ANNOTATED_KZG_EVAL, + ANNOTATED_EC_RECOVER, + ]; + ctx_precompiles.extend(override_precompiles); ctx_precompiles }); diff --git a/op-succinct-proposer/Dockerfile.op_proposer b/op-succinct-proposer/Dockerfile.op_proposer index 1b47ee87..0460f846 100644 --- a/op-succinct-proposer/Dockerfile.op_proposer +++ b/op-succinct-proposer/Dockerfile.op_proposer @@ -4,6 +4,7 @@ FROM golang:1.21 AS go-builder # Set up Go environment FROM go-builder AS optimism-builder WORKDIR /optimism +# TODO: Modify this to instead pull a Docker image, rather than cloning the repo. RUN git clone -b zk-proposer https://github.com/succinctlabs/optimism . RUN make op-proposer @@ -25,4 +26,4 @@ COPY ./op-succinct-proposer/op_proposer.sh /usr/local/bin/op_proposer.sh RUN chmod +x /usr/local/bin/op-proposer RUN chmod +x /usr/local/bin/op_proposer.sh -ENTRYPOINT ["/usr/local/bin/op_proposer.sh"] +ENTRYPOINT ["/usr/local/bin/op_proposer.sh"] \ No newline at end of file diff --git a/op-succinct-proposer/src/lib.rs b/op-succinct-proposer/src/lib.rs index b11850ef..550b8637 100644 --- a/op-succinct-proposer/src/lib.rs +++ b/op-succinct-proposer/src/lib.rs @@ -75,11 +75,13 @@ pub async fn run_native_host( result } +/// Wait for the child process to exit. async fn wait_for_child(child: Arc>) -> Result { let mut child = child.lock().await; child.wait().await.map_err(Into::into) } +/// Kill the child process. async fn kill_child(child: &Arc>) { let mut child = child.lock().await; if let Err(e) = child.kill().await {