Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 2026-04-13
- #2721 Adds support for fallback gRPC endpoints to celestia-adapter. Optional new field
- #2725 splits demo rollup for DA and ZKVM features
- #2735 Internal change: moves EVM RPC tests to sov-ethereum from sov-demo-rollup

# 2026-04-08
Expand Down
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ total-clean:

test: ## Runs test suite using next test
@cargo nextest run --no-fail-fast --status-level skip --all-features
@echo "Running demo-rollup SP1 prover tests..."
@cargo nextest run --no-fail-fast --status-level skip -p sov-demo-rollup --no-default-features --features mock_da,sp1

test-all: ## Runs test suite using nextest, across the whole workspace
cargo switcheroo save _backup
Expand Down Expand Up @@ -166,10 +168,22 @@ lint-fix: ## cargo fmt, fix and clippy. Skip clippy on guest code since it's no
SKIP_GUEST_BUILD=1 cargo clippy --fix --allow-dirty -- -A clippy::too_many_arguments

check-features: ## Checks that project compiles with all combinations of features.
cargo hack check --feature-powerset --exclude-features default --partition $(CARGO_HACK_PARTITION_N)/$(CARGO_HACK_PARTITION_M) --all-targets
cargo hack check --feature-powerset --exclude-features default --exclude sov-demo-rollup --partition $(CARGO_HACK_PARTITION_N)/$(CARGO_HACK_PARTITION_M) --all-targets
$(MAKE) check-demo-rollup-features

check-features-default-targets:
cargo hack check --feature-powerset --exclude-features default --partition $(CARGO_HACK_PARTITION_N)/$(CARGO_HACK_PARTITION_M)
cargo hack check --feature-powerset --exclude-features default --exclude sov-demo-rollup --partition $(CARGO_HACK_PARTITION_N)/$(CARGO_HACK_PARTITION_M)
$(MAKE) check-demo-rollup-features

check-demo-rollup-features: ## Checks demo-rollup compiles with each meaningful DA+ZKVM combination.
SKIP_GUEST_BUILD=1 cargo check -p sov-demo-rollup --all-targets
SKIP_GUEST_BUILD=1 cargo check -p sov-demo-rollup --all-targets --no-default-features --features mock_da,mock_zkvm
SKIP_GUEST_BUILD=1 cargo check -p sov-demo-rollup --all-targets --no-default-features --features celestia_da,mock_zkvm
SKIP_GUEST_BUILD=1 cargo check -p sov-demo-rollup --all-targets --no-default-features --features mock_da,risc0
SKIP_GUEST_BUILD=1 cargo check -p sov-demo-rollup --all-targets --no-default-features --features mock_da,sp1
SKIP_GUEST_BUILD=1 cargo check -p sov-demo-rollup --all-targets --no-default-features --features celestia_da,risc0
SKIP_GUEST_BUILD=1 cargo check -p sov-demo-rollup --all-targets --no-default-features --features celestia_da,sp1
SKIP_GUEST_BUILD=1 cargo check -p sov-demo-rollup --all-targets --all-features

check-constant-overriding-is-disabled-in-release-mode:
# Passes in release mode...
Expand Down
44 changes: 34 additions & 10 deletions examples/demo-rollup/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ workspace = true
[dependencies]
# non-optional dependencies
sov-address = { workspace = true, features = ["evm"] }
sov-celestia-adapter = { workspace = true, features = ["native"] }
sov-mock-da = { workspace = true, features = ["native"] }
sov-celestia-adapter = { workspace = true, features = ["native"], optional = true }
sov-mock-da = { workspace = true, features = ["native"], optional = true }
sov-rollup-interface = { workspace = true, features = ["native"] }
sov-stf-runner = { workspace = true }
sov-metrics = { workspace = true, features = ["native"] }
Expand All @@ -36,18 +36,18 @@ sov-modules-api = { workspace = true, features = ["native"] }
sov-modules-rollup-blueprint = { workspace = true, features = ["native"] }
sov-modules-stf-blueprint = { workspace = true, features = ["native"] }
sov-solana-offchain-auth = { workspace = true }
sov-risc0-adapter = { workspace = true, features = ["native"] }
sov-risc0-adapter = { workspace = true, features = ["native"], optional = true }
sov-sequencer = { workspace = true }
sov-sp1-adapter = { workspace = true, features = ["native"] }
sov-sp1-adapter = { workspace = true, features = ["native"], optional = true }
rustls = { workspace = true, features = ["ring"] }
sov-full-node-configs = { workspace = true }
sov-state = { workspace = true, features = ["native"] }
sov-eth-dev-signer = { workspace = true }

demo-stf = { workspace = true, features = ["native"] }

risc0 = { path = "./provers/risc0" }
sp1 = { path = "./provers/sp1" }
risc0-prover = { path = "./provers/risc0", package = "risc0", optional = true }
sp1-prover = { path = "./provers/sp1", package = "sp1", optional = true }

borsh = { workspace = true, features = ["bytes", "derive"] }
async-trait = { workspace = true }
Expand Down Expand Up @@ -78,14 +78,13 @@ secp256k1 = { workspace = true, features = ["global-context", "recovery"] }
alloy = { workspace = true, features = ["genesis"] }
alloy-primitives = { workspace = true }
alloy-rlp = { workspace = true }
sov-zkvm-utils = { workspace = true }


[dev-dependencies]
sov-eth-client = { workspace = true }
jsonrpsee = { workspace = true }
sov-address = { workspace = true, features = ["native"] }
sov-risc0-adapter = { workspace = true, features = ["native"] }
sov-celestia-adapter = { workspace = true, features = ["native"] }
sov-mock-zkvm = { workspace = true, features = ["native"] }
sov-rollup-interface = { workspace = true }
sov-modules-api = { workspace = true, features = [
Expand Down Expand Up @@ -140,9 +139,23 @@ sov-zkvm-utils = { workspace = true }


[features]
default = []
default = ["mock_da", "mock_zkvm"]

# DA layer features
mock_da = ["sov-mock-da"]
celestia_da = ["sov-celestia-adapter"]

# ZKVM features (enable exactly one)
mock_zkvm = []
risc0 = [
"sov-risc0-adapter",
"risc0-prover",
"sov-metrics/risc0"
]
sp1 = ["sov-sp1-adapter", "sp1-prover"]

# Used for using different encoding between host and guest
bincode = ["risc0/bincode", "sov-risc0-adapter/bincode"]
bincode = ["risc0", "risc0-prover/bincode", "sov-risc0-adapter/bincode"]
migration-script = [
"dep:sov-blob-storage",
"dep:rockbound",
Expand All @@ -165,6 +178,7 @@ path = "src/main.rs"
[[bin]]
name = "demo-celestia-tester"
path = "src/da_tester/demo_celestia_tester.rs"
required-features = ["celestia_da"]

[[bin]]
name = "mockda-to-celestia-migrate"
Expand All @@ -174,3 +188,13 @@ required-features = ["migration-script"]
[[bin]]
name = "sov-hive-genesis-adapter"
path = "src/hive/genesis_adapter.rs"

[[test]]
name = "all_tests"
path = "tests/all_tests.rs"
required-features = ["mock_da", "mock_zkvm"]

[[test]]
name = "prover_tests"
path = "tests/prover_tests.rs"
required-features = ["sp1"]
3 changes: 3 additions & 0 deletions examples/demo-rollup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ celestia-logs:
build:
cargo build --bins

build-celestia:
cargo build --bins --no-default-features --features celestia_da,mock_zkvm

test-create-token: check-sov-cli
test-create-token:
$(SOV_CLI_REL_PATH) node set-url http://127.0.0.1:12346
Expand Down
28 changes: 26 additions & 2 deletions examples/demo-rollup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

- [What is This?](#what-is-this)
- [Getting Started](#getting-started)
- [Feature flags](#feature-flags)
- [Run a local DA layer instance](#run-a-local-da-layer-instance)
- [Start the Rollup Full Node](#start-the-rollup-full-node)
- [Sanity Check: Creating a Token](#sanity-check-creating-a-token)
Expand Down Expand Up @@ -49,8 +50,30 @@ understand how to build your own state transition function, check out at the doc
If you are looking for a simple rollup with minimal dependencies as a starting point, please have a look here:
[sov-rollup-starter](https://github.com/Sovereign-Labs/sov-rollup-starter/)

If you don't need ZK guest to be compiled,
for faster compilation time you can export `export SKIP_GUEST_BUILD=1`environment variable in each terminal you run.
#### Feature flags

The demo-rollup uses compile-time feature flags to select the DA layer and ZKVM:

| Feature | Description |
|---------|-------------|
| `mock_da` (default) | Use mock DA (pass `--external` for RPC mode) |
| `celestia_da` | Use Celestia DA |
| `mock_zkvm` (default) | Use mock ZKVM (fastest compilation) |
| `risc0` | Use Risc0 ZKVM |
| `sp1` | Use SP1 ZKVM |

Default features (`mock_da` + `mock_zkvm`) give the fastest compilation. To use a different DA or ZKVM:

```sh
# Build with Celestia DA
cargo build -p sov-demo-rollup --no-default-features --features celestia_da,mock_zkvm

# Build with SP1 ZKVM
cargo build -p sov-demo-rollup --no-default-features --features mock_da,sp1
```

If you don't need ZK guest to be compiled,
for faster compilation time you can export `export SKIP_GUEST_BUILD=1` environment variable in each terminal you run.
There are multiple options available:
- `export SKIP_GUEST_BUILD=1` or `export SKIP_GUEST_BUILD=true`: both guest VMs builds are skipped
* `export SKIP_GUEST_BUILD=risc0`: only risc0 VM build is skipped, sp1 guest is built.
Expand Down Expand Up @@ -173,6 +196,7 @@ You'll need the `sov-cli` binary in order to create transactions. Build it with

```bash,test-ci,bashtestmd:compare-output
# Make sure you're still in `examples/demo-rollup`
# sov-cli works with default features (mock_da). For Celestia, use --features celestia_da --no-default-features
$ SKIP_GUEST_BUILD=1 cargo build --bin sov-cli
$ ./../../target/debug/sov-cli --help
Usage: sov-cli <COMMAND>
Expand Down
10 changes: 5 additions & 5 deletions examples/demo-rollup/README_CELESTIA.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ If you are looking for a simple rollup with minimal dependencies as a starting p
$ echo $MY_PERSONAL_GITHUB_TOKEN | docker login ghcr.io -u $MY_GITHUB_USERNAME --password-stdin
```

3. Switch to the `examples/demo-rollup` directory (which is where this `README.md` is located!), and compile the application:
3. Switch to the `examples/demo-rollup` directory (which is where this `README.md` is located!), and compile the application with the Celestia DA feature:

```shell,test-ci
$ cd examples/demo-rollup/
$ make build
$ make build-celestia
```

4. Spin up a local Celestia instance as your DA layer. We've built a small Makefile to simplify that process:
Expand All @@ -87,8 +87,8 @@ $ make start
Now run the demo-rollup full node, as shown below. You will see it consuming blocks from the Celestia node running inside Docker:

```sh,test-ci,bashtestmd:long-running,bashtestmd:wait-until=rest_address
# Make sure you're still in the examples/demo-rollup directory and `make build` has been executed before
$ ./../../target/debug/sov-demo-rollup --da-layer celestia --rollup-config-path demo_rollup_config.toml --genesis-config-dir ../test-data/genesis/demo/celestia
# Make sure you're still in the examples/demo-rollup directory
$ ./../../target/debug/sov-demo-rollup --rollup-config-path demo_rollup_config.toml --genesis-config-dir ../test-data/genesis/demo/celestia
2025-03-07T13:13:20.453543Z INFO sov_modules_rollup_blueprint::native_only::logging: Open Telemetry exporter is not enabled
2025-03-07T13:13:20.466922Z INFO sov_demo_rollup: Running demo rollup with prover config prover_config_disc=None
2025-03-07T13:13:20.467830Z DEBUG sov_demo_rollup: Starting rollup on mock DA config_path="mock_rollup_config.toml"
Expand Down Expand Up @@ -369,7 +369,7 @@ It is possible to run several nodes and sequencers on the same host. But this re
6. Run second node:

```
cargo run -- --da-layer celestia --rollup-config-path demo_rollup_config_1.toml --genesis-config-dir ../test-data/genesis/demo/celestia
cargo run -p sov-demo-rollup --no-default-features --features celestia_da,mock_zkvm -- --rollup-config-path demo_rollup_config_1.toml --genesis-config-dir ../test-data/genesis/demo/celestia
```

Note that it uses newly generated config and also passes a different option for prometheus exporter.
Expand Down
21 changes: 9 additions & 12 deletions examples/demo-rollup/src/celestia_rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use sov_celestia_adapter::CelestiaService;
use sov_db::ledger_db::LedgerDb;
use sov_db::storage_manager::NomtStorageManager;
use sov_ethereum::EthRpcConfig;
use sov_mock_zkvm::{MockCodeCommitment, MockZkvm, MockZkvmHost};
use sov_mock_zkvm::MockCodeCommitment;
use sov_modules_api::configurable_spec::ConfigurableSpec;
use sov_modules_api::execution_mode::Native;
use sov_modules_api::rest::StateUpdateReceiver;
Expand All @@ -19,8 +19,6 @@ use sov_modules_rollup_blueprint::proof_sender::SovApiProofSender;
use sov_modules_rollup_blueprint::{
FullNodeBlueprint, RollupBlueprint, SequencerCreationReceipt, WalletBlueprint,
};
use sov_risc0_adapter::host::Risc0Host;
use sov_risc0_adapter::{Risc0, Risc0CryptoSpec};
use sov_rollup_interface::da::{DaSpec, DaVerifier};
use sov_rollup_interface::execution_mode::WitnessGeneration;
use sov_rollup_interface::zk::CryptoSpec;
Expand All @@ -31,6 +29,7 @@ use sov_stf_runner::processes::{ParallelProverService, ProverService, RollupProv
use sov_stf_runner::RollupConfig;

use crate::solana_offchain_endpoint::solana_offchain_router;
use crate::zk::{self, InnerCryptoSpec, InnerZkvm, OuterZkvm, OuterZkvmHost};
use crate::{eth_dev_signer, ROLLUP_BATCH_NAMESPACE, ROLLUP_PROOF_NAMESPACE};

/// Rollup with CelestiaDa
Expand All @@ -39,17 +38,17 @@ pub struct CelestiaDemoRollup<M> {
phantom: std::marker::PhantomData<M>,
}

type Hasher = <Risc0CryptoSpec as CryptoSpec>::Hasher;
type Hasher = <InnerCryptoSpec as CryptoSpec>::Hasher;
type NativeStorage =
NomtProverStorage<DefaultStorageSpec<Hasher>, <CelestiaSpec as DaSpec>::SlotHash>;

type CelestiaRollupSpec<M> = ConfigurableSpec<
CelestiaSpec,
Risc0,
MockZkvm,
InnerZkvm,
OuterZkvm,
MultiAddressEvmSolana,
M,
Risc0CryptoSpec,
InnerCryptoSpec,
NativeStorage,
>;

Expand Down Expand Up @@ -162,14 +161,12 @@ impl FullNodeBlueprint<Native> for CelestiaDemoRollup<Native> {

async fn create_prover_service(
&self,
prover_config: RollupProverConfig<Risc0>,
prover_config: RollupProverConfig<InnerZkvm>,
rollup_config: &RollupConfig<<Self::Spec as Spec>::Address, Self::DaService>,
_da_service: &Self::DaService,
) -> Self::ProverService {
let (elf, prover_config_disc) = prover_config.split();
let inner_vm = Risc0Host::new(*elf);

let outer_vm = MockZkvmHost::new_non_blocking();
let (inner_vm, prover_config_disc) = zk::create_inner_vm(prover_config);
let outer_vm = OuterZkvmHost::new_non_blocking();

let rollup_params = RollupParams {
rollup_batch_namespace: ROLLUP_BATCH_NAMESPACE,
Expand Down
24 changes: 10 additions & 14 deletions examples/demo-rollup/src/external_mock_rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use sov_db::storage_manager::NomtStorageManager;
use sov_ethereum::EthRpcConfig;
use sov_mock_da::storable::rpc::StorableMockDaClient;
use sov_mock_da::MockDaSpec;
use sov_mock_zkvm::{MockCodeCommitment, MockZkvm, MockZkvmHost};
use sov_mock_zkvm::MockCodeCommitment;
use sov_modules_api::configurable_spec::ConfigurableSpec;
use sov_modules_api::execution_mode::{Native, WitnessGeneration};
use sov_modules_api::rest::StateUpdateReceiver;
Expand All @@ -18,9 +18,6 @@ use sov_modules_api::{NodeEndpoints, Spec, Storage, SyncStatus, ZkVerifier};
use sov_modules_rollup_blueprint::pluggable_traits::PluggableSpec;
use sov_modules_rollup_blueprint::proof_sender::SovApiProofSender;
use sov_modules_rollup_blueprint::{FullNodeBlueprint, RollupBlueprint, SequencerCreationReceipt};
use sov_risc0_adapter::host::Risc0Host;
use sov_risc0_adapter::Risc0;
use sov_risc0_adapter::Risc0CryptoSpec;
use sov_rollup_interface::da::DaSpec;
use sov_sequencer::{ProofBlobSender, Sequencer};
use sov_state::nomt::prover_storage::NomtProverStorage;
Expand All @@ -30,19 +27,20 @@ use sov_stf_runner::RollupConfig;

use crate::eth_dev_signer;
use crate::solana_offchain_endpoint::solana_offchain_router;
use crate::zk::{self, InnerCryptoSpec, InnerZkvm, OuterZkvm, OuterZkvmHost};

type Hasher = <Risc0CryptoSpec as CryptoSpec>::Hasher;
type Hasher = <InnerCryptoSpec as CryptoSpec>::Hasher;
type NativeStorage =
NomtProverStorage<DefaultStorageSpec<Hasher>, <MockDaSpec as DaSpec>::SlotHash>;

/// The default spec of the rollup
pub type ExternalMockRollupSpec<M> = ConfigurableSpec<
MockDaSpec,
Risc0,
MockZkvm,
InnerZkvm,
OuterZkvm,
MultiAddressEvmSolana,
M,
Risc0CryptoSpec,
InnerCryptoSpec,
NativeStorage,
>;

Expand Down Expand Up @@ -154,21 +152,19 @@ impl FullNodeBlueprint<Native> for ExternalMockDemoRollup<Native> {

async fn create_prover_service(
&self,
prover_config: RollupProverConfig<Risc0>,
prover_config: RollupProverConfig<InnerZkvm>,
rollup_config: &RollupConfig<<Self::Spec as Spec>::Address, Self::DaService>,
_da_service: &Self::DaService,
) -> Self::ProverService {
let (host_args, prover_config_discriminant) = prover_config.split();
let inner_vm = Risc0Host::new(*host_args);

let outer_vm = MockZkvmHost::new_non_blocking();
let (inner_vm, prover_config_disc) = zk::create_inner_vm(prover_config);
let outer_vm = OuterZkvmHost::new_non_blocking();
let da_verifier = Default::default();

ParallelProverService::new_with_default_workers(
inner_vm,
outer_vm,
da_verifier,
prover_config_discriminant,
prover_config_disc,
rollup_config.proof_manager.prover_address,
)
}
Expand Down
Loading
Loading