Skip to content

Commit

Permalink
fix links, workspace version & edition (#55)
Browse files Browse the repository at this point in the history
* cargo fix --edition, cargo clipy --fix
* edition blocked on succinctlabs/sp1#2097 (comment)
  • Loading branch information
nuke-web3 authored Feb 27, 2025
1 parent 94d2e57 commit 783282b
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 30 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions blob-tool/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "blob-tool"
version = "0.1.0"
edition = "2021"
edition.workspace = true
version.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion blob-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
2 changes: 1 addition & 1 deletion example.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
# <https://docs.succinct.xyz/docs/sp1/generating-proofs/prover-network>
NETWORK_PRIVATE_KEY=succinct-luvs-u
5 changes: 3 additions & 2 deletions program-keccak-inclusion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
4 changes: 2 additions & 2 deletions runner-keccak-inclusion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "runner-keccak-inclusion"
version = "0.1.0"
edition = "2021"
edition.workspace = true
version.workspace = true
publish = false

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions runner-keccak-inclusion/src/main.rs
Original file line number Diff line number Diff line change
@@ -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!(
Expand Down Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"}
Expand Down
4 changes: 2 additions & 2 deletions service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "eq-service"
version = "0.1.0"
edition = "2021"
edition.workspace = true
version.workspace = true
publish = false

[dependencies]
Expand Down
16 changes: 9 additions & 7 deletions service/src/internal/inclusion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -206,7 +206,7 @@ impl InclusionService {
.map_err(|e| InclusionServiceError::InternalError(e.to_string()))?;

new_proof_setup
};
}};
Ok(Arc::new(proof_setup))
})
.await?
Expand Down Expand Up @@ -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()),
Expand Down Expand Up @@ -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 { .. } => {
Expand Down
4 changes: 2 additions & 2 deletions service/src/internal/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion service/src/internal/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://docs.succinct.xyz/docs/sp1/generating-proofs/prover-network/usage>
pub type SuccNetJobId = [u8; 32];

/// A SHA3 256 bit hash of a zkVM program's ELF.
Expand Down

0 comments on commit 783282b

Please sign in to comment.