From 783282b23ea6ba4f845aa12283d544ec9062bf7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuke=20=F0=9F=8C=84?= Date: Thu, 27 Feb 2025 08:51:34 -0700 Subject: [PATCH] fix links, workspace version & edition (#55) * cargo fix --edition, cargo clipy --fix * edition blocked on https://github.com/succinctlabs/sp1/issues/2097#issuecomment-2685783517 --- Cargo.toml | 4 ++++ README.md | 8 ++++---- blob-tool/Cargo.toml | 4 ++-- blob-tool/src/main.rs | 2 +- common/Cargo.toml | 4 ++-- example.env | 2 +- program-keccak-inclusion/Cargo.toml | 5 +++-- runner-keccak-inclusion/Cargo.toml | 4 ++-- runner-keccak-inclusion/src/main.rs | 4 ++-- sdk/Cargo.toml | 4 ++-- service/Cargo.toml | 4 ++-- service/src/internal/inclusion.rs | 16 +++++++++------- service/src/internal/job.rs | 4 ++-- service/src/internal/util.rs | 2 +- 14 files changed, 37 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 617b806..93b6a32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,10 @@ members = ["service", "program-keccak-inclusion", "common", "blob-tool", "runner default-members = ["service"] resolver = "2" +[workspace.package] +version = "0.1.0" +edition = "2021" + [workspace.dependencies] celestia-types = "0.10" celestia-rpc = "0.9" diff --git a/README.md b/README.md index 2387a64..722dc6f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Data Availability Equivalence Service A gRPC service acting as a "cryptographic adapter" providing proofs that data (a blob) exists on [Celestia](https://celestia.org/) that are efficiently verifiable on EVM networks. -A [Namespace Merkle Tree (NMT)](https://celestia.org/glossary/namespaced-merkle-tree/) proof is transformed via a [Zero Knowledge Proof (ZKP)](https://docs.succinct.xyz/docs/what-is-a-zkvm) into a keccak hash check. +A [Namespace Merkle Tree (NMT)](https://celestia.org/glossary/namespaced-merkle-tree/) proof is transformed via a [Zero Knowledge Proof (ZKP)](https://docs.succinct.xyz/docs/sp1/what-is-a-zkvm) into a keccak hash check. A few key features: @@ -45,7 +45,7 @@ The service **_requires_** a connection to: - Fetch blob data. - Get headers. - Retrieve Merkle tree proofs for blobs. -1. [Succinct's prover network](https://docs.succinct.xyz/docs/generating-proofs/prover-network) as a provider to generate Zero-Knowledge Proofs (ZKPs) of data existing on Celestia. +1. [Succinct's prover network](https://docs.succinct.xyz/docs/sp1/generating-proofs/prover-network) as a provider to generate Zero-Knowledge Proofs (ZKPs) of data existing on Celestia. _See the [ZKP program](./program-keccak-inclusion/src/main.rs) for details on what is proven._ ## Interact @@ -111,7 +111,7 @@ Most users will want to pull and run this service via the [container registry](# - Succinct prover network over `443` - **NOTE:** These requirements may be significantly more to respond under heavy load, please report if you have issues! -1. A whitelisted key in your `env` for use with the Succinct prover network Key - [requested here](https://docs.succinct.xyz/docs/generating-proofs/prover-network). +1. A whitelisted key in your `env` for use with the Succinct prover network Key - [requested here](https://docs.succinct.xyz/docs/sp1/generating-proofs/prover-network). 1. A Celestia Light Node [installed](https://docs.celestia.org/how-to-guides/celestia-node) & [running](https://docs.celestia.org/tutorials/node-tutorial#auth-token) accessible on `localhost`, or elsewhere. Alternatively, use [an RPC provider](https://github.com/celestiaorg/awesome-celestia/?tab=readme-ov-file#node-operator-contributions) you trust. @@ -158,7 +158,7 @@ The images are built and published for [releases](https://github.com/celestiaorg First, some tooling is required: 1. Rust & Cargo - [install instructions](https://www.rust-lang.org/tools/install) -1. Succinct's SP1 zkVM Toolchain - [install instructions](https://docs.succinct.xyz/docs/getting-started/install) +1. Succinct's SP1 zkVM Toolchain - [install instructions](https://docs.succinct.xyz/docs/sp1/getting-started/install) 1. Protocol Buffers (Protobuf) compiler - [official examples](https://github.com/hyperium/tonic/tree/master/examples#examples) contain install instructions 1. (Optional) Just - a modern alternative to `make` [installed](https://just.systems/man/en/packages.html) diff --git a/blob-tool/Cargo.toml b/blob-tool/Cargo.toml index 6015095..74c85ce 100644 --- a/blob-tool/Cargo.toml +++ b/blob-tool/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "blob-tool" -version = "0.1.0" -edition = "2021" +edition.workspace = true +version.workspace = true publish = false [dependencies] diff --git a/blob-tool/src/main.rs b/blob-tool/src/main.rs index 2a2dd9a..8919af5 100644 --- a/blob-tool/src/main.rs +++ b/blob-tool/src/main.rs @@ -6,7 +6,7 @@ use celestia_types::blob::Commitment; use celestia_types::nmt::Namespace; use celestia_types::ShareProof; use clap::{command, Parser}; -use eq_common::{KeccakInclusionToDataRootProofInput, KeccakInclusionToDataRootProofOutput}; +use eq_common::KeccakInclusionToDataRootProofInput; use sha3::{Digest, Keccak256}; #[derive(Parser, Debug)] diff --git a/common/Cargo.toml b/common/Cargo.toml index 8683235..51613d2 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "eq-common" -version = "0.1.0" -edition = "2021" +edition.workspace = true +version.workspace = true [dependencies] celestia-types = {workspace = true} diff --git a/example.env b/example.env index afd6189..9d2c8f2 100644 --- a/example.env +++ b/example.env @@ -30,5 +30,5 @@ EQ_PROTO_DIR=./common/proto # For using the SP1 Prover network # More info & request getting on the white list: -# https://docs.succinct.xyz/docs/generating-proofs/prover-network +# NETWORK_PRIVATE_KEY=succinct-luvs-u diff --git a/program-keccak-inclusion/Cargo.toml b/program-keccak-inclusion/Cargo.toml index 9d099d0..b2fe249 100644 --- a/program-keccak-inclusion/Cargo.toml +++ b/program-keccak-inclusion/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "eq-program-keccak-inclusion" -version = "0.1.0" -edition = "2021" +edition.workspace = true +version.workspace = true + publish = false [dependencies] diff --git a/runner-keccak-inclusion/Cargo.toml b/runner-keccak-inclusion/Cargo.toml index 7892ac3..dc642f4 100644 --- a/runner-keccak-inclusion/Cargo.toml +++ b/runner-keccak-inclusion/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "runner-keccak-inclusion" -version = "0.1.0" -edition = "2021" +edition.workspace = true +version.workspace = true publish = false [dependencies] diff --git a/runner-keccak-inclusion/src/main.rs b/runner-keccak-inclusion/src/main.rs index dc09a11..077b390 100644 --- a/runner-keccak-inclusion/src/main.rs +++ b/runner-keccak-inclusion/src/main.rs @@ -1,7 +1,7 @@ #![doc = include_str!("../README.md")] use eq_common::KeccakInclusionToDataRootProofInput; -use sp1_sdk::{Prover, ProverClient, SP1Stdin}; +use sp1_sdk::{ProverClient, SP1Stdin}; use std::fs; const KECCAK_INCLUSION_ELF: &[u8] = include_bytes!( @@ -33,7 +33,7 @@ fn main() { serde_json::to_string(&proof).expect("Failed to serialize proof"), ) .expect("Failed to write proof to file");*/ - let r = client + let _r = client .execute(&KECCAK_INCLUSION_ELF, &stdin) .run() .expect("Failed executing program"); diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 83f0658..eb1db6c 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "eq-sdk" -version = "0.1.0" -edition = "2021" +edition.workspace = true +version.workspace = true [dependencies] eq-common = {path = "../common"} diff --git a/service/Cargo.toml b/service/Cargo.toml index d4eeda1..4d71a43 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "eq-service" -version = "0.1.0" -edition = "2021" +edition.workspace = true +version.workspace = true publish = false [dependencies] diff --git a/service/src/internal/inclusion.rs b/service/src/internal/inclusion.rs index 84f8ea3..dec1b4c 100644 --- a/service/src/internal/inclusion.rs +++ b/service/src/internal/inclusion.rs @@ -182,10 +182,10 @@ impl InclusionService { .get(zk_program_elf_sha3) .map_err(|e| InclusionServiceError::InternalError(e.to_string()))?; - let proof_setup = if let Some(precomputed) = precomputed_proof_setup { + let proof_setup = match precomputed_proof_setup { Some(precomputed) => { bincode::deserialize(&precomputed) .map_err(|e| InclusionServiceError::InternalError(e.to_string()))? - } else { + } _ => { info!( "No ZK proof setup in DB for SHA3_256 = 0x{} -- generation & storing in config DB", hex::encode(zk_program_elf_sha3) @@ -206,7 +206,7 @@ impl InclusionService { .map_err(|e| InclusionServiceError::InternalError(e.to_string()))?; new_proof_setup - }; + }}; Ok(Arc::new(proof_setup)) }) .await? @@ -290,7 +290,9 @@ impl InclusionService { JsonRpcError::Call(error_object) => { // TODO: make this handle errors much better! JSON stringiness is a problem! if error_object.message().starts_with("header: not found") { - e = InclusionServiceError::DaClientError(format!("{call_err} - Likely DA Node is not properly synced, and blob does exists on the network. PLEASE REPORT!")); + e = InclusionServiceError::DaClientError(format!( + "{call_err} - Likely DA Node is not properly synced, and blob does exists on the network. PLEASE REPORT!" + )); job_status = JobStatus::Failed( e.clone(), Some(JobStatus::DataAvailabilityPending.into()), @@ -359,9 +361,9 @@ impl InclusionService { let (e, job_status); match zk_client_error { SP1NetworkError::SimulationFailed | SP1NetworkError::RequestUnexecutable { .. } => { - e = InclusionServiceError::DaClientError( - format!("ZKP program critical failure: {zk_client_error} occured for {job:?} PLEASE REPORT!"), - ); + e = InclusionServiceError::DaClientError(format!( + "ZKP program critical failure: {zk_client_error} occured for {job:?} PLEASE REPORT!" + )); job_status = JobStatus::Failed(e.clone(), None); } SP1NetworkError::RequestUnfulfillable { .. } => { diff --git a/service/src/internal/job.rs b/service/src/internal/job.rs index c81a908..6b0642c 100644 --- a/service/src/internal/job.rs +++ b/service/src/internal/job.rs @@ -10,8 +10,8 @@ pub type Job = BlobId; /// Used as a [Job] state machine for the eq-service. /// -/// Should map 1to1 with [ResponseStatus] for consistency in internal state -/// and what is reported by the RPC. +/// Should map 1to1 with [ResponseStatus](eq_common::eqs::get_keccak_inclusion_response::ResponseValue) +/// for consistency in internal state and what is reported by the RPC. #[derive(Serialize, Deserialize)] pub enum JobStatus { /// DA inclusion proof data is being collected diff --git a/service/src/internal/util.rs b/service/src/internal/util.rs index 0ab20d6..14a2d95 100644 --- a/service/src/internal/util.rs +++ b/service/src/internal/util.rs @@ -5,7 +5,7 @@ use tokio::signal::{ unix::{signal as unix_signal, SignalKind}, }; /// A Succinct Prover Network request ID. -/// See: https://docs.succinct.xyz/docs/generating-proofs/prover-network/usage +/// See: pub type SuccNetJobId = [u8; 32]; /// A SHA3 256 bit hash of a zkVM program's ELF.