Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build #4

Merged
merged 2 commits into from
Oct 31, 2023
Merged
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
4 changes: 3 additions & 1 deletion crates/provers/risc0/guest-mock/src/bin/mock_da.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! of the zkvm in order to generate proofs for the rollup.

use sov_modules_api::default_context::ZkDefaultContext;
use sov_modules_stf_template::kernels::basic::BasicKernel;
use sov_modules_stf_template::AppTemplate;
use sov_risc0_adapter::guest::Risc0Guest;
use sov_rollup_interface::mocks::MockDaVerifier;
Expand All @@ -15,7 +16,8 @@ risc0_zkvm::guest::entry!(main);
pub fn main() {
let guest = Risc0Guest::new();
let storage = ZkStorage::new();
let app: AppTemplate<ZkDefaultContext, _, _, Runtime<_, _>> = AppTemplate::new();
let app: AppTemplate<ZkDefaultContext, _, _, Runtime<_, _>, BasicKernel<_>> =
AppTemplate::new();

let mut stf_verifier = AppVerifier::new(app, MockDaVerifier {});

Expand Down
4 changes: 4 additions & 0 deletions crates/rollup/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use async_trait::async_trait;
use sov_db::ledger_db::LedgerDB;
use sov_modules_api::default_context::{DefaultContext, ZkDefaultContext};
use sov_modules_api::Spec;
use sov_modules_stf_template::kernels::basic::BasicKernel;
use sov_risc0_adapter::host::Risc0Host;
use sov_rollup_interface::mocks::{MockDaConfig, MockDaService, MockDaSpec};
use sov_rollup_interface::services::da::DaService;
Expand Down Expand Up @@ -41,6 +42,9 @@ impl sov_modules_rollup_template::RollupTemplate for StarterRollup {
type ZkRuntime = Runtime<Self::ZkContext, Self::DaSpec>;
/// Runtime for the Native environment.
type NativeRuntime = Runtime<Self::NativeContext, Self::DaSpec>;
/// Kernels.
type NativeKernel = BasicKernel<Self::NativeContext>;
type ZkKernel = BasicKernel<Self::ZkContext>;

/// This function generates RPC methods for the rollup, allowing for extension with custom endpoints.
fn create_rpc_methods(
Expand Down
4 changes: 2 additions & 2 deletions crates/stf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ use sov_rollup_interface::da::DaVerifier;
use sov_stf_runner::verifier::StateTransitionVerifier;

/// Alias for StateTransitionVerifier.
pub type AppVerifier<DA, Vm, ZkContext, RT> =
StateTransitionVerifier<AppTemplate<ZkContext, <DA as DaVerifier>::Spec, Vm, RT>, DA, Vm>;
pub type AppVerifier<DA, Vm, ZkContext, RT, K> =
StateTransitionVerifier<AppTemplate<ZkContext, <DA as DaVerifier>::Spec, Vm, RT, K>, DA, Vm>;
16 changes: 0 additions & 16 deletions crates/stf/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ pub use sov_accounts::{AccountsRpcImpl, AccountsRpcServer};
#[cfg(feature = "native")]
pub use sov_bank::{BankRpcImpl, BankRpcServer};
use sov_modules_api::capabilities::{BlobRefOrOwned, BlobSelector};
use sov_modules_api::default_context::ZkDefaultContext;
use sov_modules_api::macros::DefaultRuntime;
#[cfg(feature = "native")]
use sov_modules_api::Spec;
use sov_modules_api::{Context, DaSpec, DispatchCall, Genesis, MessageCodec};
use sov_modules_stf_template::AppTemplate;
use sov_rollup_interface::da::DaVerifier;
#[cfg(feature = "native")]
pub use sov_sequencer_registry::{SequencerRegistryRpcImpl, SequencerRegistryRpcServer};
use sov_stf_runner::verifier::StateTransitionVerifier;

#[cfg(feature = "native")]
use crate::genesis_config::GenesisPaths;
Expand Down Expand Up @@ -112,15 +108,3 @@ impl<C: Context, Da: DaSpec> BlobSelector<Da> for Runtime<C, Da> {
Ok(current_blobs.into_iter().map(BlobRefOrOwned::Ref).collect())
}
}

/// A verifier for the rollup
pub type RollupVerifier<DA, Zk> = StateTransitionVerifier<
AppTemplate<
ZkDefaultContext,
<DA as DaVerifier>::Spec,
Zk,
Runtime<ZkDefaultContext, <DA as DaVerifier>::Spec>,
>,
DA,
Zk,
>;