diff --git a/Cargo.lock b/Cargo.lock index 2ca104e60..9336cc56d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -909,6 +909,39 @@ dependencies = [ "libc", ] +[[package]] +name = "celestia" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.21.2", + "bech32 0.9.1", + "borsh", + "hex", + "hex-literal 0.4.1", + "jsonrpsee 0.16.2", + "nmt-rs", + "postcard", + "proptest", + "prost", + "prost-build", + "prost-types", + "risc0-zkvm", + "risc0-zkvm-platform", + "serde", + "serde_json", + "sha2 0.10.7", + "sov-rollup-interface", + "tendermint", + "tendermint-proto", + "thiserror", + "tokio", + "tracing", + "wiremock", + "zk-cycle-macros", +] + [[package]] name = "cexpr" version = "0.6.0" @@ -3352,39 +3385,6 @@ dependencies = [ "simple_asn1", ] -[[package]] -name = "jupiter" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "base64 0.21.2", - "bech32 0.9.1", - "borsh", - "hex", - "hex-literal 0.4.1", - "jsonrpsee 0.16.2", - "nmt-rs", - "postcard", - "proptest", - "prost", - "prost-build", - "prost-types", - "risc0-zkvm", - "risc0-zkvm-platform", - "serde", - "serde_json", - "sha2 0.10.7", - "sov-rollup-interface", - "tendermint", - "tendermint-proto", - "thiserror", - "tokio", - "tracing", - "wiremock", - "zk-cycle-macros", -] - [[package]] name = "k256" version = "0.13.1" @@ -6578,6 +6578,7 @@ dependencies = [ "async-trait", "borsh", "bytes", + "celestia", "clap", "const-rollup-config", "criterion", @@ -6586,7 +6587,6 @@ dependencies = [ "hex", "jmt", "jsonrpsee 0.18.2", - "jupiter", "prettytable-rs", "prometheus 0.11.0", "proptest", @@ -6636,11 +6636,11 @@ name = "sov-ethereum" version = "0.1.0" dependencies = [ "borsh", + "celestia", "const-rollup-config", "demo-stf", "ethers", "jsonrpsee 0.18.2", - "jupiter", "reth-primitives", "reth-rpc", "serde_json", @@ -6889,10 +6889,10 @@ version = "0.1.0" dependencies = [ "anyhow", "borsh", + "celestia", "futures", "hex", "jsonrpsee 0.18.2", - "jupiter", "rand 0.8.5", "serde", "serde_json", diff --git a/adapters/celestia/Cargo.toml b/adapters/celestia/Cargo.toml index f7f55a47b..643fefe05 100644 --- a/adapters/celestia/Cargo.toml +++ b/adapters/celestia/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "jupiter" +name = "celestia" version = { workspace = true } edition = { workspace = true } license = { workspace = true } diff --git a/adapters/celestia/src/lib.rs b/adapters/celestia/src/lib.rs index 23e284287..2708ca286 100644 --- a/adapters/celestia/src/lib.rs +++ b/adapters/celestia/src/lib.rs @@ -1,6 +1,6 @@ pub mod celestia; pub mod shares; -pub use celestia::*; +pub use crate::celestia::*; #[cfg(feature = "native")] pub mod da_service; diff --git a/examples/demo-prover/Cargo.lock b/examples/demo-prover/Cargo.lock index 271eeea6b..95f332485 100644 --- a/examples/demo-prover/Cargo.lock +++ b/examples/demo-prover/Cargo.lock @@ -458,6 +458,36 @@ dependencies = [ "libc", ] +[[package]] +name = "celestia" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.21.2", + "bech32", + "borsh", + "hex", + "hex-literal", + "jsonrpsee 0.16.2", + "nmt-rs", + "prost", + "prost-build", + "prost-types", + "risc0-zkvm", + "risc0-zkvm-platform", + "serde", + "serde_json", + "sha2 0.10.7", + "sov-rollup-interface", + "tendermint", + "tendermint-proto", + "thiserror", + "tokio", + "tracing", + "zk-cycle-macros", +] + [[package]] name = "cexpr" version = "0.6.0" @@ -1839,36 +1869,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "jupiter" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "base64 0.21.2", - "bech32", - "borsh", - "hex", - "hex-literal", - "jsonrpsee 0.16.2", - "nmt-rs", - "prost", - "prost-build", - "prost-types", - "risc0-zkvm", - "risc0-zkvm-platform", - "serde", - "serde_json", - "sha2 0.10.7", - "sov-rollup-interface", - "tendermint", - "tendermint-proto", - "thiserror", - "tokio", - "tracing", - "zk-cycle-macros", -] - [[package]] name = "keccak" version = "0.1.4" @@ -3567,12 +3567,12 @@ dependencies = [ "anyhow", "bincode", "borsh", + "celestia", "const-rollup-config", "demo-stf", "env_logger", "hex", "jsonrpsee 0.16.2", - "jupiter", "log", "log4rs", "methods", @@ -3605,13 +3605,13 @@ dependencies = [ "async-trait", "borsh", "bytes", + "celestia", "const-rollup-config", "demo-stf", "futures", "hex", "jmt", "jsonrpsee 0.18.2", - "jupiter", "risc0-adapter", "serde", "serde_json", @@ -3785,10 +3785,10 @@ version = "0.1.0" dependencies = [ "anyhow", "borsh", + "celestia", "futures", "hex", "jsonrpsee 0.18.2", - "jupiter", "serde", "serde_json", "sov-db", @@ -4765,3 +4765,8 @@ dependencies = [ "libc", "pkg-config", ] + +[[patch.unused]] +name = "cc" +version = "1.0.79" +source = "git+https://github.com/rust-lang/cc-rs?rev=e5bbdfa#e5bbdfa1fa468c028cb38fee6c35a3cf2e5a2736" diff --git a/examples/demo-prover/host/Cargo.toml b/examples/demo-prover/host/Cargo.toml index eff32b335..6e6672798 100644 --- a/examples/demo-prover/host/Cargo.toml +++ b/examples/demo-prover/host/Cargo.toml @@ -19,7 +19,7 @@ tokio = { workspace = true } tracing = "0.1.37" tracing-subscriber = "0.3.16" -jupiter = { path = "../../../adapters/celestia", features = ["native","bench"] } +celestia = { path = "../../../adapters/celestia", features = ["native","bench"] } demo-stf = { path = "../../demo-stf" } sov-rollup-interface = { path = "../../../rollup-interface" } risc0-adapter = { path = "../../../adapters/risc0" } diff --git a/examples/demo-prover/host/benches/prover_bench.rs b/examples/demo-prover/host/benches/prover_bench.rs index 4d7e80d24..d6baf31ed 100644 --- a/examples/demo-prover/host/benches/prover_bench.rs +++ b/examples/demo-prover/host/benches/prover_bench.rs @@ -7,14 +7,14 @@ use std::str::FromStr; use std::sync::{Arc, Mutex}; use anyhow::Context; +use celestia::da_service::CelestiaService; +use celestia::types::{FilteredCelestiaBlock, NamespaceId}; +use celestia::verifier::address::CelestiaAddress; +use celestia::verifier::{ChainValidityCondition, RollupParams}; +use celestia::BlobWithSender; use const_rollup_config::{ROLLUP_NAMESPACE_RAW, SEQUENCER_DA_ADDRESS}; use demo_stf::app::{App, DefaultPrivateKey}; use demo_stf::genesis_config::create_demo_genesis_config; -use jupiter::da_service::CelestiaService; -use jupiter::types::{FilteredCelestiaBlock, NamespaceId}; -use jupiter::verifier::address::CelestiaAddress; -use jupiter::verifier::{ChainValidityCondition, RollupParams}; -use jupiter::BlobWithSender; use log4rs::config::{Appender, Config, Root}; use methods::ROLLUP_ELF; use regex::Regex; diff --git a/examples/demo-prover/host/src/main.rs b/examples/demo-prover/host/src/main.rs index 685a0d822..742845f77 100644 --- a/examples/demo-prover/host/src/main.rs +++ b/examples/demo-prover/host/src/main.rs @@ -2,13 +2,13 @@ use std::env; use std::str::FromStr; use anyhow::Context; +use celestia::da_service::{CelestiaService, DaServiceConfig}; +use celestia::types::NamespaceId; +use celestia::verifier::address::CelestiaAddress; +use celestia::verifier::{CelestiaSpec, RollupParams}; use const_rollup_config::{ROLLUP_NAMESPACE_RAW, SEQUENCER_DA_ADDRESS}; use demo_stf::app::{App, DefaultPrivateKey}; use demo_stf::genesis_config::create_demo_genesis_config; -use jupiter::da_service::{CelestiaService, DaServiceConfig}; -use jupiter::types::NamespaceId; -use jupiter::verifier::address::CelestiaAddress; -use jupiter::verifier::{CelestiaSpec, RollupParams}; use methods::{ROLLUP_ELF, ROLLUP_ID}; use risc0_adapter::host::{Risc0Host, Risc0Verifier}; use serde::Deserialize; diff --git a/examples/demo-prover/methods/guest/Cargo.toml b/examples/demo-prover/methods/guest/Cargo.toml index cc69e5dde..82a90a9a1 100644 --- a/examples/demo-prover/methods/guest/Cargo.toml +++ b/examples/demo-prover/methods/guest/Cargo.toml @@ -11,7 +11,7 @@ anyhow = "1.0.68" risc0-zkvm = { version = "0.16", default-features = false, features = ["std"] } risc0-zkvm-platform = "0.16" borsh = { version = "0.10.3", features = ["bytes"] } -jupiter = { path = "../../../../adapters/celestia", default-features = false } +celestia = { path = "../../../../adapters/celestia", default-features = false } demo-stf = { path = "../../../demo-stf", default-features = false } sov-rollup-interface = { path = "../../../../rollup-interface", default-features = false} risc0-adapter = { path = "../../../../adapters/risc0", default-features = false } @@ -52,4 +52,4 @@ lto = true opt-level = 3 [features] -bench=["jupiter/bench", "sov-modules-stf-template/bench", "sov-state/bench", "sov-modules-api/bench", "sov-sequencer-registry/bench"] +bench=["celestia/bench", "sov-modules-stf-template/bench", "sov-state/bench", "sov-modules-api/bench", "sov-sequencer-registry/bench"] diff --git a/examples/demo-prover/methods/guest/src/bin/rollup.rs b/examples/demo-prover/methods/guest/src/bin/rollup.rs index 465003904..1d9302c74 100644 --- a/examples/demo-prover/methods/guest/src/bin/rollup.rs +++ b/examples/demo-prover/methods/guest/src/bin/rollup.rs @@ -4,13 +4,13 @@ use std::str::FromStr; +use celestia::types::NamespaceId; +use celestia::verifier::address::CelestiaAddress; +use celestia::verifier::{CelestiaSpec, CelestiaVerifier, ChainValidityCondition}; +use celestia::{BlobWithSender, CelestiaHeader}; use const_rollup_config::{ROLLUP_NAMESPACE_RAW, SEQUENCER_DA_ADDRESS}; use demo_stf::app::create_zk_app_template; use demo_stf::ArrayWitness; -use jupiter::types::NamespaceId; -use jupiter::verifier::address::CelestiaAddress; -use jupiter::verifier::{CelestiaSpec, CelestiaVerifier, ChainValidityCondition}; -use jupiter::{BlobWithSender, CelestiaHeader}; use risc0_adapter::guest::Risc0Guest; use risc0_zkvm::guest::env; use sov_rollup_interface::crypto::NoOpHasher; @@ -19,7 +19,6 @@ use sov_rollup_interface::services::da::SlotData; use sov_rollup_interface::stf::StateTransitionFunction; use sov_rollup_interface::zk::{StateTransition, ZkvmGuest}; - // The rollup stores its data in the namespace b"sov-test" on Celestia const ROLLUP_NAMESPACE: NamespaceId = NamespaceId(ROLLUP_NAMESPACE_RAW); @@ -33,7 +32,6 @@ risc0_zkvm::guest::entry!(main); // 5. Call end_slot // 6. Output (Da hash, start_root, end_root, event_root) pub fn main() { - env::write(&"Start guest\n"); let guest = Risc0Guest; @@ -57,15 +55,13 @@ pub fn main() { let witness: ArrayWitness = guest.read_from_host(); env::write(&"Witness have been read\n"); - env::write(&"Applying slot...\n"); let result = app.apply_slot(witness, &header, &mut blobs); env::write(&"Slot has been applied\n"); - // Step 3: Verify tx list - let verifier = CelestiaVerifier::new(jupiter::verifier::RollupParams { + let verifier = CelestiaVerifier::new(celestia::verifier::RollupParams { namespace: ROLLUP_NAMESPACE, }); @@ -92,7 +88,10 @@ pub fn main() { #[cfg(feature = "bench")] { - let tuple = ("Cycles per block".to_string(), (end_cycles - start_cycles) as u64); + let tuple = ( + "Cycles per block".to_string(), + (end_cycles - start_cycles) as u64, + ); let mut serialized = Vec::new(); serialized.extend(tuple.0.as_bytes()); serialized.push(0); diff --git a/examples/demo-rollup/Cargo.toml b/examples/demo-rollup/Cargo.toml index 0bb7614bc..a07858c89 100644 --- a/examples/demo-rollup/Cargo.toml +++ b/examples/demo-rollup/Cargo.toml @@ -27,7 +27,7 @@ futures = "0.3" tokio = { workspace = true } tracing-subscriber = "0.3.17" -jupiter = { path = "../../adapters/celestia" } +celestia = { path = "../../adapters/celestia" } demo-stf = { path = "../demo-stf", features = ["native"] } sov-rollup-interface = { path = "../../rollup-interface" } sov-db = { path = "../../full-node/db/sov-db" } diff --git a/examples/demo-rollup/README.md b/examples/demo-rollup/README.md index 345c4fb6e..78b2bffbc 100644 --- a/examples/demo-rollup/README.md +++ b/examples/demo-rollup/README.md @@ -94,13 +94,13 @@ Now run the demo-rollup full node, as shown below. You will see it consuming blo ```sh # Make sure you're still in the examples/demo-rollup directory. $ cargo run -2023-06-07T10:03:25.473920Z INFO jupiter::da_service: Fetching header at height=1... +2023-06-07T10:03:25.473920Z INFO celestia::da_service: Fetching header at height=1... 2023-06-07T10:03:25.496853Z INFO sov_demo_rollup: Received 0 blobs 2023-06-07T10:03:25.497700Z INFO sov_demo_rollup: Requesting data for height 2 and prev_state_root 0xa96745d3184e54d098982daf44923d84c358800bd22c1864734ccb978027a670 -2023-06-07T10:03:25.497719Z INFO jupiter::da_service: Fetching header at height=2... +2023-06-07T10:03:25.497719Z INFO celestia::da_service: Fetching header at height=2... 2023-06-07T10:03:25.505412Z INFO sov_demo_rollup: Received 0 blobs 2023-06-07T10:03:25.505992Z INFO sov_demo_rollup: Requesting data for height 3 and prev_state_root 0xa96745d3184e54d098982daf44923d84c358800bd22c1864734ccb978027a670 -2023-06-07T10:03:25.506003Z INFO jupiter::da_service: Fetching header at height=3... +2023-06-07T10:03:25.506003Z INFO celestia::da_service: Fetching header at height=3... 2023-06-07T10:03:25.511237Z INFO sov_demo_rollup: Received 0 blobs 2023-06-07T10:03:25.511815Z INFO sov_demo_rollup: Requesting data for height 4 and prev_state_root 0xa96745d3184e54d098982daf44923d84c358800bd22c1864734ccb978027a670 ``` @@ -118,7 +118,7 @@ $ make test-create-token ...wait a few seconds and you will see the transaction receipt in the output of the demo-rollup full node: ```sh -2023-07-12T15:04:52.291073Z INFO jupiter::da_service: Fetching header at height=31... +2023-07-12T15:04:52.291073Z INFO celestia::da_service: Fetching header at height=31... 2023-07-12T15:05:02.304393Z INFO sov_demo_rollup: Received 1 blobs at height 31 2023-07-12T15:05:02.305257Z INFO sov_demo_rollup: blob #0 at height 31 with blob_hash 0x4876c2258b57104356efa4630d3d9f901ccfda5dde426ba8aef81d4a3e357c79 has been applied with #1 transactions, sequencer outcome Rewarded(0) 2023-07-12T15:05:02.305280Z INFO sov_demo_rollup: tx #0 hash: 0x1e1892f77cf42c0abd2ca2acdd87eabb9aa65ec7497efea4ff9f5f33575f881a result Successful diff --git a/examples/demo-rollup/benches/rng_xfers.rs b/examples/demo-rollup/benches/rng_xfers.rs index 93f79a696..a5b6c9faf 100644 --- a/examples/demo-rollup/benches/rng_xfers.rs +++ b/examples/demo-rollup/benches/rng_xfers.rs @@ -3,9 +3,9 @@ use std::str::FromStr; use async_trait::async_trait; use borsh::ser::BorshSerialize; +use celestia::verifier::address::CelestiaAddress; use const_rollup_config::SEQUENCER_DA_ADDRESS; use demo_stf::runtime::Runtime; -use jupiter::verifier::address::CelestiaAddress; use sov_bank::{Bank, CallMessage, Coins}; use sov_modules_api::default_context::DefaultContext; use sov_modules_api::default_signature::private_key::DefaultPrivateKey; diff --git a/examples/demo-rollup/benches/rollup_bench.rs b/examples/demo-rollup/benches/rollup_bench.rs index fcf0ad219..9656f3910 100644 --- a/examples/demo-rollup/benches/rollup_bench.rs +++ b/examples/demo-rollup/benches/rollup_bench.rs @@ -6,11 +6,11 @@ use std::sync::Arc; use std::time::Duration; use anyhow::Context; +use celestia::verifier::address::CelestiaAddress; use const_rollup_config::SEQUENCER_DA_ADDRESS; use criterion::{criterion_group, criterion_main, Criterion}; use demo_stf::app::App; use demo_stf::genesis_config::create_demo_genesis_config; -use jupiter::verifier::address::CelestiaAddress; use risc0_adapter::host::Risc0Verifier; use rng_xfers::{RngDaService, RngDaSpec}; use sov_db::ledger_db::{LedgerDB, SlotCommit}; diff --git a/examples/demo-rollup/benches/rollup_coarse_measure.rs b/examples/demo-rollup/benches/rollup_coarse_measure.rs index 1ff37f92a..80acb5233 100644 --- a/examples/demo-rollup/benches/rollup_coarse_measure.rs +++ b/examples/demo-rollup/benches/rollup_coarse_measure.rs @@ -6,10 +6,10 @@ use std::sync::Arc; use std::time::{Duration, Instant}; use anyhow::Context; +use celestia::verifier::address::CelestiaAddress; use const_rollup_config::SEQUENCER_DA_ADDRESS; use demo_stf::app::App; use demo_stf::genesis_config::create_demo_genesis_config; -use jupiter::verifier::address::CelestiaAddress; use prometheus::{Histogram, HistogramOpts, Registry}; use risc0_adapter::host::Risc0Verifier; use rng_xfers::{RngDaService, RngDaSpec}; diff --git a/examples/demo-rollup/src/lib.rs b/examples/demo-rollup/src/lib.rs index fc183763d..27d125810 100644 --- a/examples/demo-rollup/src/lib.rs +++ b/examples/demo-rollup/src/lib.rs @@ -5,12 +5,12 @@ pub mod register_rpc; use std::str::FromStr; +use celestia::types::NamespaceId; +use celestia::verifier::address::CelestiaAddress; use const_rollup_config::{ROLLUP_NAMESPACE_RAW, SEQUENCER_DA_ADDRESS}; use demo_stf::app::DefaultPrivateKey; use demo_stf::genesis_config::create_demo_genesis_config; use demo_stf::runtime::GenesisConfig; -use jupiter::types::NamespaceId; -use jupiter::verifier::address::CelestiaAddress; use sov_db::ledger_db::LedgerDB; use sov_modules_api::default_context::DefaultContext; diff --git a/examples/demo-rollup/src/main.rs b/examples/demo-rollup/src/main.rs index 03b5c5cc2..be6de9832 100644 --- a/examples/demo-rollup/src/main.rs +++ b/examples/demo-rollup/src/main.rs @@ -1,10 +1,10 @@ use std::env; use anyhow::Context; +use celestia::da_service::CelestiaService; +use celestia::verifier::RollupParams; use demo_stf::app::{App, DefaultContext}; use demo_stf::runtime::get_rpc_methods; -use jupiter::da_service::CelestiaService; -use jupiter::verifier::RollupParams; #[cfg(feature = "experimental")] use sov_demo_rollup::register_rpc::register_ethereum; use sov_demo_rollup::register_rpc::{register_ledger, register_sequencer}; diff --git a/examples/demo-rollup/src/register_rpc.rs b/examples/demo-rollup/src/register_rpc.rs index 7930d7e16..30d7c9de2 100644 --- a/examples/demo-rollup/src/register_rpc.rs +++ b/examples/demo-rollup/src/register_rpc.rs @@ -1,8 +1,8 @@ //! Full-Node specific RPC methods. use anyhow::Context; +use celestia::verifier::address::CelestiaAddress; use demo_stf::app::App; -use jupiter::verifier::address::CelestiaAddress; use risc0_adapter::host::Risc0Verifier; use sov_db::ledger_db::LedgerDB; use sov_modules_stf_template::{SequencerOutcome, TxEffect}; diff --git a/full-node/sov-ethereum/Cargo.toml b/full-node/sov-ethereum/Cargo.toml index 291e7a9d5..b1325912a 100644 --- a/full-node/sov-ethereum/Cargo.toml +++ b/full-node/sov-ethereum/Cargo.toml @@ -18,7 +18,7 @@ sov-evm = { path = "../../module-system/module-implementations/sov-evm", default demo-stf = { path = "../../examples/demo-stf", features = ["native"] } sov-modules-api = { path = "../../module-system/sov-modules-api", default-features = false } const-rollup-config = { path = "../../examples/const-rollup-config" } -jupiter = { path = "../../adapters/celestia", features = ["native"] } +celestia = { path = "../../adapters/celestia", features = ["native"] } borsh = { workspace = true } serde_json = { workspace = true } diff --git a/full-node/sov-stf-runner/Cargo.toml b/full-node/sov-stf-runner/Cargo.toml index 9eb1a8d8e..e0fbc0127 100644 --- a/full-node/sov-stf-runner/Cargo.toml +++ b/full-node/sov-stf-runner/Cargo.toml @@ -27,7 +27,7 @@ sov-db = { path = "../db/sov-db" } sov-rollup-interface = { path = "../../rollup-interface", version = "0.1" } sov-state = { path = "../../module-system/sov-state", version = "0.1"} sov-modules-api = { path = "../../module-system/sov-modules-api", version = "0.1" } -jupiter = { path = "../../adapters/celestia" } +celestia = { path = "../../adapters/celestia" } [dev-dependencies] tempfile = { workspace = true } diff --git a/full-node/sov-stf-runner/src/config.rs b/full-node/sov-stf-runner/src/config.rs index 55e72d505..0384df764 100644 --- a/full-node/sov-stf-runner/src/config.rs +++ b/full-node/sov-stf-runner/src/config.rs @@ -1,4 +1,4 @@ -use jupiter::da_service::DaServiceConfig; +use celestia::da_service::DaServiceConfig; use serde::Deserialize; use crate::runner_config::Config as RunnerConfig;