Skip to content

Commit

Permalink
changed some naming and added git dep
Browse files Browse the repository at this point in the history
  • Loading branch information
dubbelosix committed Nov 13, 2023
1 parent dad932b commit e3daead
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
Expand Down
2 changes: 1 addition & 1 deletion celestia_rollup_config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[da]
# The JWT used to authenticate with the celestia light client. Instructions for generating this token can be found in the README
celestia_rpc_auth_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJwdWJsaWMiLCJyZWFkIiwid3JpdGUiLCJhZG1pbiJdfQ.ennP1rdqesCr7_KIPv9aHiJAzI9RRUxWK8yd_YHmtkU"
celestia_rpc_auth_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJwdWJsaWMiLCJyZWFkIiwid3JpdGUiLCJhZG1pbiJdfQ.cpgAm8Hms_DYhpaQADyWll5RP13nfTAsYROrfFilpLk"
# The address of the *trusted* Celestia light client to interact with
celestia_rpc_address = "http://127.0.0.1:26658"
# The largest response the rollup will accept from the Celestia node. Defaults to 100 MB
Expand Down
1 change: 0 additions & 1 deletion crates/rollup/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ sov-modules-rollup-blueprint = { workspace = true }
sov-modules-stf-blueprint = { workspace = true, features = ["native"] }
sov-stf-runner = { workspace = true, features = ["native"] }
sov-cli = { workspace = true, optional = true }
#sov-demo-rollup = { workspace = true, optional = true }

sov-db = { workspace = true }
sov-sequencer = { workspace = true }
Expand Down
14 changes: 7 additions & 7 deletions crates/rollup/src/bin/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use anyhow::Context;
use clap::Parser;
use sov_modules_rollup_blueprint::{Rollup, RollupBlueprint, RollupProverConfig};
#[cfg(feature = "mock_da")]
use sov_rollup_starter::mock_rollup::StarterRollup;
use sov_rollup_starter::mock_rollup::MockRollup;
#[cfg(feature = "celestia_da")]
use sov_rollup_starter::celestia_rollup::StarterRollup;
use sov_rollup_starter::celestia_rollup::CelestiaRollup;
#[cfg(feature = "mock_da")]
use sov_mock_da::MockDaConfig;
#[cfg(feature = "celestia_da")]
Expand Down Expand Up @@ -70,14 +70,14 @@ async fn new_rollup(
genesis_paths: &GenesisPaths,
rollup_config_path: &str,
prover_config: Option<RollupProverConfig>,
) -> Result<Rollup<StarterRollup>, anyhow::Error> {
) -> Result<Rollup<MockRollup>, anyhow::Error> {
info!("Reading rollup config from {rollup_config_path:?}");

let rollup_config: RollupConfig<MockDaConfig> =
from_toml_path(rollup_config_path).context("Failed to read rollup configuration")?;

let starter_rollup = StarterRollup {};
starter_rollup
let mock_rollup = MockRollup {};
mock_rollup
.create_new_rollup(genesis_paths, rollup_config, prover_config)
.await
}
Expand All @@ -87,7 +87,7 @@ async fn new_rollup(
genesis_paths: &GenesisPaths,
rollup_config_path: &str,
prover_config: Option<RollupProverConfig>,
) -> Result<Rollup<StarterRollup>, anyhow::Error> {
) -> Result<Rollup<CelestiaRollup>, anyhow::Error> {
info!(
"Starting celestia rollup with config {}",
rollup_config_path
Expand All @@ -96,7 +96,7 @@ async fn new_rollup(
let rollup_config: RollupConfig<CelestiaConfig> =
from_toml_path(rollup_config_path).context("Failed to read rollup configuration")?;

let celestia_rollup = StarterRollup {};
let celestia_rollup = CelestiaRollup {};
celestia_rollup
.create_new_rollup(genesis_paths, rollup_config, prover_config)
.await
Expand Down
4 changes: 2 additions & 2 deletions crates/rollup/src/bin/starter_cli_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
use sov_modules_api::cli::{FileNameArg, JsonStringArg};
use sov_modules_rollup_blueprint::WalletBlueprint;
#[cfg(feature = "mock_da")]
use sov_rollup_starter::mock_rollup::StarterRollup;
use sov_rollup_starter::mock_rollup::MockRollup as StarterRollup ;
#[cfg(feature = "celestia_da")]
use sov_rollup_starter::celestia_rollup::StarterRollup;
use sov_rollup_starter::celestia_rollup::CelestiaRollup as StarterRollup;
use stf_starter::runtime::RuntimeSubcommand;

#[tokio::main]
Expand Down
8 changes: 5 additions & 3 deletions crates/rollup/src/celestia_rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ use sov_celestia_adapter::verifier::{CelestiaSpec, CelestiaVerifier, RollupParam
/// The namespace for the rollup on Celestia. Must be kept in sync with the "rollup/src/lib.rs"
const ROLLUP_NAMESPACE: Namespace = Namespace::const_v0(*b"sov-celest");

/// Rollup with [`MockDaService`].
pub struct StarterRollup {}
/// Rollup with [`CelestiaDaService`].
pub struct CelestiaRollup {}

/// This is the place, where all the rollup components come together and
/// they can be easily swapped with alternative implementations as needed.
#[async_trait]
impl sov_modules_rollup_blueprint::RollupBlueprint for StarterRollup {
impl sov_modules_rollup_blueprint::RollupBlueprint for CelestiaRollup {
type DaService = CelestiaService;
type DaSpec = CelestiaSpec;
type DaConfig = CelestiaConfig;
Expand Down Expand Up @@ -107,3 +107,5 @@ impl sov_modules_rollup_blueprint::RollupBlueprint for StarterRollup {
}
}
}

impl sov_modules_rollup_blueprint::WalletBlueprint for CelestiaRollup {}
9 changes: 0 additions & 9 deletions crates/rollup/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,3 @@ pub mod mock_rollup;

#[cfg(feature = "celestia_da")]
pub mod celestia_rollup;

#[cfg(feature = "mock_da")]
use mock_rollup::StarterRollup;

#[cfg(feature = "celestia_da")]
use celestia_rollup::StarterRollup;

// Wallet implementation doesn't depend on the adapter so creating the impl here
impl sov_modules_rollup_blueprint::WalletBlueprint for StarterRollup {}
6 changes: 4 additions & 2 deletions crates/rollup/src/mock_rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ use sov_stf_runner::RollupConfig;
use stf_starter::Runtime;

/// Rollup with [`MockDaService`].
pub struct StarterRollup {}
pub struct MockRollup {}

/// This is the place, where all the rollup components come together and
/// they can be easily swapped with alternative implementations as needed.
#[async_trait]
impl sov_modules_rollup_blueprint::RollupBlueprint for StarterRollup {
impl sov_modules_rollup_blueprint::RollupBlueprint for MockRollup {
/// This component defines the Data Availability layer.
type DaService = MockDaService;
/// DaSpec & DaConfig are derived from DaService.
Expand Down Expand Up @@ -94,3 +94,5 @@ impl sov_modules_rollup_blueprint::RollupBlueprint for StarterRollup {
Default::default()
}
}

impl sov_modules_rollup_blueprint::WalletBlueprint for MockRollup {}

0 comments on commit e3daead

Please sign in to comment.