Skip to content

Commit

Permalink
fix: docs among other things
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Aug 27, 2024
1 parent 656b9be commit 249b7d3
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`**
Expand Down
2 changes: 1 addition & 1 deletion client-programs/range/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 1 addition & 9 deletions crates/client-utils/src/oracle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -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!();
Expand Down
36 changes: 18 additions & 18 deletions crates/client-utils/src/precompiles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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
});
Expand Down
3 changes: 2 additions & 1 deletion op-succinct-proposer/Dockerfile.op_proposer
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"]
2 changes: 2 additions & 0 deletions op-succinct-proposer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Mutex<Child>>) -> Result<std::process::ExitStatus> {
let mut child = child.lock().await;
child.wait().await.map_err(Into::into)
}

/// Kill the child process.
async fn kill_child(child: &Arc<Mutex<Child>>) {
let mut child = child.lock().await;
if let Err(e) = child.kill().await {
Expand Down

0 comments on commit 249b7d3

Please sign in to comment.