diff --git a/Cargo.lock b/Cargo.lock index 703b3ad13..cd1e76c14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7626,8 +7626,6 @@ dependencies = [ "digest 0.10.7", "futures", "hex", - "proptest", - "proptest-derive", "serde", "serde_json", "thiserror", diff --git a/bin/citrea/Cargo.toml b/bin/citrea/Cargo.toml index 596dafb36..1a4a4d582 100644 --- a/bin/citrea/Cargo.toml +++ b/bin/citrea/Cargo.toml @@ -69,7 +69,7 @@ citrea-evm = { path = "../../crates/evm", features = ["native"] } citrea-primitives = { path = "../../crates/primitives", features = ["testing"] } sov-mock-da = { path = "../../crates/sovereign-sdk/adapters/mock-da", default-features = false } sov-prover-storage-manager = { path = "../../crates/sovereign-sdk/full-node/sov-prover-storage-manager", features = ["test-utils"] } -sov-rollup-interface = { path = "../../crates/sovereign-sdk/rollup-interface", features = ["fuzzing", "testing"] } +sov-rollup-interface = { path = "../../crates/sovereign-sdk/rollup-interface", features = ["testing"] } alloy = { workspace = true, features = ["hyper", "consensus", "rpc-types-eth", "provider-http", "signers", "signer-local"] } alloy-rlp = { workspace = true } diff --git a/crates/evm/src/lib.rs b/crates/evm/src/lib.rs index 8985fa1ee..5f96d36a0 100644 --- a/crates/evm/src/lib.rs +++ b/crates/evm/src/lib.rs @@ -166,8 +166,6 @@ impl sov_modules_api::Module for Evm { type CallMessage = call::CallMessage; - type Event = (); - fn genesis(&self, config: &Self::Config, working_set: &mut WorkingSet) { self.init_module(config, working_set) } diff --git a/crates/soft-confirmation-rule-enforcer/src/lib.rs b/crates/soft-confirmation-rule-enforcer/src/lib.rs index 00c1b8e4e..46b1c0864 100644 --- a/crates/soft-confirmation-rule-enforcer/src/lib.rs +++ b/crates/soft-confirmation-rule-enforcer/src/lib.rs @@ -53,8 +53,6 @@ impl sov_modules_api::Module for SoftConfirmationRuleEnf type CallMessage = CallMessage; - type Event = (); - fn call( &mut self, message: Self::CallMessage, diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs index 7bc2e247e..74580b9f0 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs @@ -253,7 +253,7 @@ impl SharedLedgerOps for LedgerDB { Ok(()) } - /// Get the next slot, block, transaction, and event numbers + /// Get the next slot, block, transaction numbers #[instrument(level = "trace", skip(self), ret)] fn get_next_items_numbers(&self) -> ItemNumbers { self.next_item_numbers.lock().unwrap().clone() diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs index bda51ed88..ad83287f5 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs @@ -42,7 +42,7 @@ pub trait SharedLedgerOps { l2_height: BatchNumber, ) -> Result<()>; - /// Get the next slot, block, transaction, and event numbers + /// Get the next slot, block, transaction numbers fn get_next_items_numbers(&self) -> ItemNumbers; /// Gets all slots with numbers `range.start` to `range.end`. If `range.end` is outside diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs index 42b31a354..e19f4bfe5 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs @@ -13,10 +13,6 @@ //! - `TxNumber -> (TxHash,Tx)` //! - `TxHash -> TxNumber` //! -//! Event Tables: -//! - `(EventKey, TxNumber) -> EventNumber` -//! - `EventNumber -> (EventKey, EventValue)` -//! //! JMT Tables: //! - `KeyHash -> Key` //! - `(Key, Version) -> JmtValue` diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/schema/types.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/schema/types.rs index 4c929f281..0c6951d45 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/schema/types.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/schema/types.rs @@ -4,14 +4,11 @@ use std::sync::Arc; use borsh::{BorshDeserialize, BorshSerialize}; use serde::de::DeserializeOwned; -use serde::{Deserialize, Serialize}; use sov_rollup_interface::rpc::{ BatchProofOutputRpcResponse, BatchProofResponse, HexTx, LightClientProofOutputRpcResponse, - LightClientProofResponse, SoftConfirmationResponse, TxIdentifier, TxResponse, - VerifiedBatchProofResponse, + LightClientProofResponse, SoftConfirmationResponse, TxResponse, VerifiedBatchProofResponse, }; use sov_rollup_interface::soft_confirmation::SignedSoftConfirmation; -use sov_rollup_interface::stf::EventKey; use sov_rollup_interface::zk::{BatchProofInfo, CumulativeStateDiff, Proof}; /// A cheaply cloneable bytes abstraction for use within the trust boundary of the node @@ -359,29 +356,6 @@ impl TryFrom for TxResponse { } } -/// An identifier that specifies a single event -#[derive(Debug, PartialEq, Serialize, Deserialize)] -pub enum EventIdentifier { - /// A unique identifier for an event consisting of a [`TxIdentifier`] and an offset into that transaction's event list - TxIdAndIndex((TxIdentifier, u64)), - /// A unique identifier for an event consisting of a [`TxIdentifier`] and an event key - TxIdAndKey((TxIdentifier, EventKey)), - /// The monotonically increasing number of the event, ordered by the DA layer For example, if the first tx - /// contains 7 events, tx 2 contains 11 events, and tx 3 contains 7 txs, - /// the last event in tx 3 would have number 25. The counter never resets. - Number(EventNumber), -} - -/// An identifier for a group of related events -#[derive(Debug, PartialEq, Serialize, Deserialize)] -pub enum EventGroupIdentifier { - /// All of the events which occurred in a particular transaction - TxId(TxIdentifier), - /// All events which a particular key - /// (typically, these events will have been emitted by several different transactions) - Key(Vec), -} - macro_rules! u64_wrapper { ($name:ident) => { /// A typed wrapper around u64 implementing `Encode` and `Decode` diff --git a/crates/sovereign-sdk/full-node/db/sov-schema-db/tests/snapshot_test.rs b/crates/sovereign-sdk/full-node/db/sov-schema-db/tests/snapshot_test.rs index c656dde66..19c74d81b 100644 --- a/crates/sovereign-sdk/full-node/db/sov-schema-db/tests/snapshot_test.rs +++ b/crates/sovereign-sdk/full-node/db/sov-schema-db/tests/snapshot_test.rs @@ -43,7 +43,7 @@ fn snapshot_lifecycle() { manager.add_snapshot(snapshot_2.into()); } - // Snapshot 3: gets empty result, event value is in some previous snapshots + // Snapshot 3: gets empty result value is in some previous snapshots let snapshot_3 = DbSnapshot::new(2, ReadOnlyLock::new(manager.clone())); assert_eq!(None, snapshot_3.read::(&key).unwrap()); } diff --git a/crates/sovereign-sdk/module-system/module-implementations/integration-tests/src/nested_modules/helpers.rs b/crates/sovereign-sdk/module-system/module-implementations/integration-tests/src/nested_modules/helpers.rs index 18961b323..b308bb80f 100644 --- a/crates/sovereign-sdk/module-system/module-implementations/integration-tests/src/nested_modules/helpers.rs +++ b/crates/sovereign-sdk/module-system/module-implementations/integration-tests/src/nested_modules/helpers.rs @@ -24,8 +24,6 @@ pub mod module_a { type CallMessage = (); - type Event = (); - fn call( &mut self, _message: Self::CallMessage, @@ -39,7 +37,6 @@ pub mod module_a { impl ModuleA { pub fn update(&mut self, key: &str, value: &str, working_set: &mut WorkingSet) { - working_set.add_event("module A", "update"); self.state_1_a .set(&key.to_owned(), &value.to_owned(), working_set); self.state_2_a.set(&value.to_owned(), working_set) @@ -71,8 +68,6 @@ pub mod module_b { type CallMessage = (); - type Event = (); - fn call( &mut self, _message: Self::CallMessage, @@ -86,7 +81,6 @@ pub mod module_b { impl ModuleB { pub fn update(&mut self, key: &str, value: &str, working_set: &mut WorkingSet) { - working_set.add_event("module B", "update"); self.state_1_b .set(&key.to_owned(), &value.to_owned(), working_set); self.mod_1_a.update("key_from_b", value, working_set); @@ -118,8 +112,6 @@ pub(crate) mod module_c { type CallMessage = (); - type Event = (); - fn call( &mut self, _message: Self::CallMessage, @@ -138,7 +130,6 @@ pub(crate) mod module_c { value: &str, working_set: &mut WorkingSet, ) { - working_set.add_event("module C", "execute"); self.mod_1_a.update(key, value, working_set); self.mod_1_b.update(key, value, working_set); self.mod_1_a.update(key, value, working_set); diff --git a/crates/sovereign-sdk/module-system/module-implementations/integration-tests/src/nested_modules/tests.rs b/crates/sovereign-sdk/module-system/module-implementations/integration-tests/src/nested_modules/tests.rs index 55f87aa47..6b38e22c6 100644 --- a/crates/sovereign-sdk/module-system/module-implementations/integration-tests/src/nested_modules/tests.rs +++ b/crates/sovereign-sdk/module-system/module-implementations/integration-tests/src/nested_modules/tests.rs @@ -1,6 +1,6 @@ use sov_modules_api::default_context::{DefaultContext, ZkDefaultContext}; use sov_modules_api::prelude::*; -use sov_modules_api::{Context, Event, ModulePrefix, StateMap, WorkingSet}; +use sov_modules_api::{Context, ModulePrefix, StateMap, WorkingSet}; use sov_prover_storage_manager::new_orphan_storage; use sov_state::{Storage, ZkStorage}; @@ -17,16 +17,6 @@ fn nested_module_call_test() { execute_module_logic::(&mut working_set); test_state_update::(&mut working_set); } - assert_eq!( - working_set.events(), - &vec![ - Event::new("module C", "execute"), - Event::new("module A", "update"), - Event::new("module B", "update"), - Event::new("module A", "update"), - Event::new("module A", "update"), - ] - ); let (log, mut witness) = working_set.checkpoint().freeze(); prover_storage diff --git a/crates/sovereign-sdk/module-system/module-implementations/sov-accounts/src/lib.rs b/crates/sovereign-sdk/module-system/module-implementations/sov-accounts/src/lib.rs index 9ace97977..883a6bd9f 100644 --- a/crates/sovereign-sdk/module-system/module-implementations/sov-accounts/src/lib.rs +++ b/crates/sovereign-sdk/module-system/module-implementations/sov-accounts/src/lib.rs @@ -55,8 +55,6 @@ impl sov_modules_api::Module for Accounts { type CallMessage = (); - type Event = (); - fn genesis(&self, config: &Self::Config, working_set: &mut WorkingSet) { self.init_module(config, working_set) } diff --git a/crates/sovereign-sdk/module-system/sov-modules-api/src/lib.rs b/crates/sovereign-sdk/module-system/sov-modules-api/src/lib.rs index b74142064..f4f2207c2 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-api/src/lib.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-api/src/lib.rs @@ -195,7 +195,7 @@ pub use sov_rollup_interface::services::da::SlotData; pub use sov_rollup_interface::soft_confirmation::{ SignedSoftConfirmation, UnsignedSoftConfirmation, UnsignedSoftConfirmationV1, }; -pub use sov_rollup_interface::stf::{Event, StateDiff}; +pub use sov_rollup_interface::stf::StateDiff; pub use sov_rollup_interface::zk::{BatchProofCircuitOutput, Zkvm}; pub use sov_rollup_interface::{digest, BasicAddress, RollupAddress}; diff --git a/crates/sovereign-sdk/module-system/sov-modules-api/src/reexport_macros.rs b/crates/sovereign-sdk/module-system/sov-modules-api/src/reexport_macros.rs index fb9b20f7f..a72a43077 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-api/src/reexport_macros.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-api/src/reexport_macros.rs @@ -35,7 +35,6 @@ pub use sov_modules_macros::MessageCodec; /// type Context = C; /// type Config = PhantomData; /// type CallMessage = (); -/// type Event = (); /// /// fn call( /// &mut self, diff --git a/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs b/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs index 1898e1893..5e22337b8 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs @@ -32,9 +32,6 @@ pub trait Module { /// Module defined argument to the call method. type CallMessage: Debug + BorshSerialize + BorshDeserialize; - /// Module defined event resulting from a call method. - type Event: Debug + BorshSerialize + BorshDeserialize; - /// Genesis is called when a rollup is deployed and can be used to set initial state values in the module. /// Genesis functions can't return error, they must panic fn genesis( diff --git a/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs b/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs index 9cad8e18e..486fab408 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs @@ -1,11 +1,8 @@ //! Runtime state machine definitions. use alloc::collections::BTreeMap; -use alloc::vec::Vec; use core::{fmt, mem}; -use sov_rollup_interface::stf::Event; - use self::archival_state::ArchivalOffchainWorkingSet; use crate::archival_state::{ArchivalAccessoryWorkingSet, ArchivalJmtWorkingSet}; use crate::common::Prefix; @@ -378,7 +375,6 @@ impl StateCheckpoint { delta: RevertableWriter::new(self.delta, None), offchain_delta: RevertableWriter::new(self.offchain_delta, None), accessory_delta: RevertableWriter::new(self.accessory_delta, None), - events: Default::default(), archival_working_set: None, archival_accessory_working_set: None, archival_offchain_working_set: None, @@ -423,7 +419,6 @@ pub struct WorkingSet { delta: RevertableWriter>, accessory_delta: RevertableWriter>, offchain_delta: RevertableWriter>, - events: Vec, archival_working_set: Option>, archival_offchain_working_set: Option>, archival_accessory_working_set: Option>, @@ -503,22 +498,6 @@ impl WorkingSet { } } - /// Adds an event to the working set. - pub fn add_event(&mut self, key: &str, value: &str) { - self.events.push(Event::new(key, value)); - } - - /// Extracts all events from this working set. - pub fn take_events(&mut self) -> Vec { - mem::take(&mut self.events) - } - - /// Returns an immutable slice of all events that have been previously - /// written to this working set. - pub fn events(&self) -> &[Event] { - &self.events - } - /// Fetches given value and provides a proof of it presence/absence. pub fn get_with_proof(&mut self, key: StorageKey) -> StorageProof<::Proof> where diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/cli_wallet_arg/derive_wallet.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/cli_wallet_arg/derive_wallet.rs index bbb47c4ee..f113f1225 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/cli_wallet_arg/derive_wallet.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/cli_wallet_arg/derive_wallet.rs @@ -37,7 +37,6 @@ pub mod first_test_module { type Context = C; type Config = (); type CallMessage = MyStruct; - type Event = (); fn genesis(&self, _config: &Self::Config, _working_set: &mut WorkingSet) {} @@ -82,7 +81,6 @@ pub mod second_test_module { type Context = Ctx; type Config = (); type CallMessage = MyEnum; - type Event = (); fn genesis(&self, _config: &Self::Config, _working_set: &mut WorkingSet) {} diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/dispatch/modules.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/dispatch/modules.rs index ea26404d9..d9d7ceaad 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/dispatch/modules.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/dispatch/modules.rs @@ -22,18 +22,10 @@ pub mod first_test_module { } } - #[derive(borsh::BorshDeserialize, borsh::BorshSerialize, Debug, PartialEq)] - pub enum Event { - FirstModuleEnum1(u64), - FirstModuleEnum2, - FirstModuleEnum3(Vec), - } - impl Module for FirstTestStruct { type Context = C; type Config = (); type CallMessage = u8; - type Event = Event; fn genesis(&self, _config: &Self::Config, working_set: &mut WorkingSet) { self.state_in_first_struct.set(&1, working_set); @@ -69,16 +61,10 @@ pub mod second_test_module { } } - #[derive(borsh::BorshDeserialize, borsh::BorshSerialize, Debug, PartialEq)] - pub enum Event { - SecondModuleEnum, - } - impl Module for SecondTestStruct { type Context = Ctx; type Config = (); type CallMessage = u8; - type Event = Event; fn genesis(&self, _config: &Self::Config, working_set: &mut WorkingSet) { self.state_in_second_struct.set(&2, working_set); @@ -130,7 +116,6 @@ pub mod third_test_module { type Context = Ctx; type Config = (); type CallMessage = OtherGeneric; - type Event = (); fn genesis(&self, _config: &Self::Config, working_set: &mut WorkingSet) { self.state_in_third_struct diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/module_info/field_missing_attribute.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/module_info/field_missing_attribute.rs index c81083cc1..591999571 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/module_info/field_missing_attribute.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/module_info/field_missing_attribute.rs @@ -18,8 +18,6 @@ impl Module for TestStruct { type CallMessage = (); - type Event = (); - fn call( &mut self, _message: Self::CallMessage, diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/module_info/mod_and_state.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/module_info/mod_and_state.rs index 6743d1b78..3a0f95467 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/module_info/mod_and_state.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/module_info/mod_and_state.rs @@ -26,8 +26,6 @@ pub mod first_test_module { type CallMessage = (); - type Event = (); - fn call( &mut self, _message: Self::CallMessage, @@ -64,8 +62,6 @@ mod second_test_module { type CallMessage = (); - type Event = (); - fn call( &mut self, _message: Self::CallMessage, diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc.rs index 973e362bc..e8d956983 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc.rs @@ -20,7 +20,6 @@ impl Module for QueryModule { type Context = C; type Config = u8; type CallMessage = u8; - type Event = (); fn genesis(&self, config: &Self::Config, working_set: &mut WorkingSet) { self.data.set(config, working_set); diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.rs index fd5287589..09bdd925c 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.rs @@ -48,7 +48,6 @@ pub mod my_module { type Context = C; type Config = D; type CallMessage = D; - type Event = (); fn genesis(&self, config: &Self::Config, working_set: &mut WorkingSet) { self.data.set(config, working_set); diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.stderr b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.stderr index 05588b3db..47d5ac3ad 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.stderr +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.stderr @@ -1,7 +1,7 @@ error[E0310]: the parameter type `S` may not live long enough - --> tests/rpc/expose_rpc_associated_type_not_static.rs:97:1 + --> tests/rpc/expose_rpc_associated_type_not_static.rs:96:1 | -97 | #[expose_rpc] +96 | #[expose_rpc] | ^^^^^^^^^^^^^ | | | the parameter type `S` must be valid for the static lifetime... @@ -10,5 +10,5 @@ error[E0310]: the parameter type `S` may not live long enough = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider adding an explicit lifetime bound | -100| struct Runtime { +99 | struct Runtime { | +++++++++ diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types.rs index 3120a3aee..aa9568093 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types.rs @@ -48,7 +48,6 @@ pub mod my_module { type Context = C; type Config = D; type CallMessage = D; - type Event = (); fn genesis(&self, config: &Self::Config, working_set: &mut WorkingSet) { self.data.set(config, working_set); diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types_nested.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types_nested.rs index caa40f4d5..b37798ed2 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types_nested.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types_nested.rs @@ -53,7 +53,6 @@ pub mod my_module { type Context = C; type Config = D; type CallMessage = D; - type Event = (); fn genesis(&self, config: &Self::Config, working_set: &mut WorkingSet) { self.data.set(config, working_set); diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.rs index 635da8c9e..eb5d6957c 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.rs @@ -45,7 +45,6 @@ pub mod my_module { type Context = C; type Config = D; type CallMessage = D; - type Event = (); fn genesis(&self, config: &Self::Config, working_set: &mut WorkingSet) { self.data.set(config, working_set); diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.stderr b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.stderr index aea84ba5b..b58f0302c 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.stderr +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.stderr @@ -1,15 +1,15 @@ error[E0220]: associated type `Storage` not found for `S` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:1 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:93:1 | -94 | #[expose_rpc] +93 | #[expose_rpc] | ^^^^^^^^^^^^^ associated type `Storage` not found | = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:16 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:16 | -97 | struct Runtime { +96 | struct Runtime { | ^ the trait `sov_modules_api::Context` is not implemented for `S` | note: required by a bound in `sov_modules_api::Genesis::Context` @@ -19,25 +19,25 @@ note: required by a bound in `sov_modules_api::Genesis::Context` | ^^^^^^^ required by this bound in `Genesis::Context` help: consider further restricting this bound | -97 | struct Runtime { +96 | struct Runtime { | ++++++++++++++++++++++++++ error[E0277]: the trait bound `S: Spec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:10 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^ the trait `Spec` is not implemented for `S` | = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -97 | struct Runtime { +96 | struct Runtime { | +++++++++++++++++++++++ error[E0277]: `::Data` cannot be shared between threads safely - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:8 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:8 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `::Data` cannot be shared between threads safely | = help: within `Runtime`, the trait `std::marker::Sync` is not implemented for `::Data`, which is required by `Runtime: std::marker::Sync` @@ -57,9 +57,9 @@ note: required because it appears within the type `QueryModule { | ^^^^^^^^^^^ note: required because it appears within the type `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:8 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:8 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^ note: required by a bound in `sov_modules_api::DispatchCall` --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs @@ -68,13 +68,13 @@ note: required by a bound in `sov_modules_api::DispatchCall` | ^^^^ required by this bound in `DispatchCall` help: consider further restricting the associated type | -97 | struct Runtime where ::Data: std::marker::Sync { +96 | struct Runtime where ::Data: std::marker::Sync { | ++++++++++++++++++++++++++++++++++++++++++++++ error[E0277]: `::Data` cannot be sent between threads safely - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:8 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:8 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `::Data` cannot be sent between threads safely | = help: within `Runtime`, the trait `Send` is not implemented for `::Data`, which is required by `Runtime: Send` @@ -94,9 +94,9 @@ note: required because it appears within the type `QueryModule { | ^^^^^^^^^^^ note: required because it appears within the type `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:8 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:8 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^ note: required by a bound in `sov_modules_api::DispatchCall` --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs @@ -105,13 +105,13 @@ note: required by a bound in `sov_modules_api::DispatchCall` | ^^^^ required by this bound in `DispatchCall` help: consider further restricting the associated type | -97 | struct Runtime where ::Data: Send { +96 | struct Runtime where ::Data: Send { | +++++++++++++++++++++++++++++++++ error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:16 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:16 | -97 | struct Runtime { +96 | struct Runtime { | ^ the trait `sov_modules_api::Context` is not implemented for `S` | note: required by a bound in `sov_modules_api::DispatchCall::Context` @@ -121,20 +121,20 @@ note: required by a bound in `sov_modules_api::DispatchCall::Context` | ^^^^^^^ required by this bound in `DispatchCall::Context` help: consider further restricting this bound | -97 | struct Runtime { +96 | struct Runtime { | ++++++++++++++++++++++++++ error[E0277]: `::Data` cannot be shared between threads safely - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:19 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ `::Data` cannot be shared between threads safely | = help: within `RuntimeCall`, the trait `std::marker::Sync` is not implemented for `::Data`, which is required by `RuntimeCall: std::marker::Sync` note: required because it appears within the type `RuntimeCall` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:19 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ note: required by a bound in `sov_modules_api::DispatchCall::Decodable` --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs @@ -144,20 +144,20 @@ note: required by a bound in `sov_modules_api::DispatchCall::Decodable` = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting the associated type | -97 | struct Runtime where ::Data: std::marker::Sync { +96 | struct Runtime where ::Data: std::marker::Sync { | ++++++++++++++++++++++++++++++++++++++++++++++ error[E0277]: `::Data` cannot be sent between threads safely - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:19 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ `::Data` cannot be sent between threads safely | = help: within `RuntimeCall`, the trait `Send` is not implemented for `::Data`, which is required by `RuntimeCall: Send` note: required because it appears within the type `RuntimeCall` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:19 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ note: required by a bound in `sov_modules_api::DispatchCall::Decodable` --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs @@ -167,37 +167,37 @@ note: required by a bound in `sov_modules_api::DispatchCall::Decodable` = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting the associated type | -97 | struct Runtime where ::Data: Send { +96 | struct Runtime where ::Data: Send { | +++++++++++++++++++++++++++++++++ error[E0277]: the trait bound `S: Spec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:19 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ the trait `Spec` is not implemented for `S` | = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -97 | struct Runtime { +96 | struct Runtime { | +++++++++++++++++++++++ error[E0277]: the trait bound `S: Spec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:1 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:93:1 | -94 | #[expose_rpc] +93 | #[expose_rpc] | ^^^^^^^^^^^^^ the trait `Spec` is not implemented for `S` | = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -97 | struct Runtime { +96 | struct Runtime { | +++++++++++++++++++++++ error[E0599]: no method named `set` found for struct `sov_modules_api::StateValue` in the current scope - --> tests/rpc/expose_rpc_first_generic_not_context.rs:51:23 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:50:23 | -51 | self.data.set(config, working_set); +50 | self.data.set(config, working_set); | ^^^ | ::: $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/containers/traits/value.rs @@ -217,9 +217,9 @@ help: trait `StateValueAccessor` which provides `set` is implemented but not in | error[E0599]: no method named `set` found for struct `sov_modules_api::StateValue` in the current scope - --> tests/rpc/expose_rpc_first_generic_not_context.rs:60:23 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:59:23 | -60 | self.data.set(&msg, working_set); +59 | self.data.set(&msg, working_set); | ^^^ | ::: $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/containers/traits/value.rs @@ -239,9 +239,9 @@ help: trait `StateValueAccessor` which provides `set` is implemented but not in | error[E0599]: no method named `get` found for struct `sov_modules_api::StateValue` in the current scope - --> tests/rpc/expose_rpc_first_generic_not_context.rs:85:39 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:84:39 | -85 | let value = self.data.get(working_set).map(|d| format!("{:?}", d)); +84 | let value = self.data.get(working_set).map(|d| format!("{:?}", d)); | ^^^ | ::: $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/containers/traits/value.rs @@ -257,16 +257,16 @@ help: there is a method `set` with a similar name, but with different arguments | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: trait `StateValueAccessor` which provides `get` is implemented but not in scope; perhaps you want to import it | -67 + use sov_modules_api::StateValueAccessor; +66 + use sov_modules_api::StateValueAccessor; | error[E0271]: type mismatch resolving `::Data> as ModuleInfo>::Context == S` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:10 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^ expected type parameter `S`, found type parameter `C` -96 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] -97 | struct Runtime { +95 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] +96 | struct Runtime { | - - found type parameter | | | expected type parameter @@ -279,9 +279,9 @@ error[E0271]: type mismatch resolving `::Data> as = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:10 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` | note: required by a bound in `sort_values_by_modules_dependencies` @@ -292,19 +292,19 @@ note: required by a bound in `sort_values_by_modules_dependencies` = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -97 | struct Runtime { +96 | struct Runtime { | ++++++++++++++++++++++++++ error[E0308]: mismatched types - --> tests/rpc/expose_rpc_first_generic_not_context.rs:95:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:94:19 | -95 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +94 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ | | | expected `&C`, found `&S` | arguments to this function are incorrect -96 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] -97 | struct Runtime { +95 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] +96 | struct Runtime { | - - expected type parameter | | | found type parameter @@ -321,15 +321,15 @@ note: method defined here = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: the function or associated item `default` exists for struct `Runtime`, but its trait bounds were not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:112:50 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:111:50 | -97 | struct Runtime { +96 | struct Runtime { | --------------------------------------- function or associated item `default` not found for this struct because it doesn't satisfy `_: Default` ... -101 | struct ActualSpec; +100 | struct ActualSpec; | ----------------- doesn't satisfy `ActualSpec: sov_modules_api::Context` ... -112 | let runtime = &mut Runtime::::default(); +111 | let runtime = &mut Runtime::::default(); | ^^^^^^^ function or associated item cannot be called on `Runtime` due to unsatisfied trait bounds | ::: $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/default_context.rs @@ -350,79 +350,79 @@ note: the trait `sov_modules_api::Context` must be implemented candidate #1: `std::default::Default` error[E0277]: the trait bound `ZkDefaultContext: TestSpec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:112:24 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:111:24 | -112 | let runtime = &mut Runtime::::default(); +111 | let runtime = &mut Runtime::::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TestSpec` is not implemented for `ZkDefaultContext` | = help: the trait `TestSpec` is implemented for `ActualSpec` note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:19 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^^ required by this bound in `Runtime` error[E0277]: the trait bound `ActualSpec: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:112:24 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:111:24 | -112 | let runtime = &mut Runtime::::default(); +111 | let runtime = &mut Runtime::::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `ActualSpec` | = help: the following other types implement trait `sov_modules_api::Context`: DefaultContext ZkDefaultContext note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:32 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:32 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^ required by this bound in `Runtime` error[E0277]: the trait bound `Runtime: EncodeCall>` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:118:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:117:10 | -118 | >>::encode_call(message); +117 | >>::encode_call(message); | ^^ the trait `EncodeCall>` is not implemented for `Runtime` | = help: the trait `EncodeCall::Data>>` is implemented for `Runtime` error[E0277]: the trait bound `ZkDefaultContext: TestSpec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:118:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:117:10 | -118 | >>::encode_call(message); +117 | >>::encode_call(message); | ^^ the trait `TestSpec` is not implemented for `ZkDefaultContext` | = help: the trait `TestSpec` is implemented for `ActualSpec` note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:19 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^^ required by this bound in `Runtime` error[E0277]: the trait bound `ActualSpec: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:118:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:117:10 | -118 | >>::encode_call(message); +117 | >>::encode_call(message); | ^^ the trait `sov_modules_api::Context` is not implemented for `ActualSpec` | = help: the following other types implement trait `sov_modules_api::Context`: DefaultContext ZkDefaultContext note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:32 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:32 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^ required by this bound in `Runtime` error[E0599]: the function or associated item `decode_call` exists for struct `Runtime`, but its trait bounds were not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:119:22 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:118:22 | -97 | struct Runtime { +96 | struct Runtime { | --------------------------------------- function or associated item `decode_call` not found for this struct because it doesn't satisfy `_: DispatchCall` ... -101 | struct ActualSpec; +100 | struct ActualSpec; | ----------------- doesn't satisfy `ActualSpec: sov_modules_api::Context` ... -119 | let module = RT::decode_call(&serialized_message).unwrap(); +118 | let module = RT::decode_call(&serialized_message).unwrap(); | ^^^^^^^^^^^ function or associated item cannot be called on `Runtime` due to unsatisfied trait bounds | ::: $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/default_context.rs @@ -443,29 +443,29 @@ note: the trait `sov_modules_api::Context` must be implemented candidate #1: `sov_modules_api::DispatchCall` error[E0277]: the trait bound `ZkDefaultContext: TestSpec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:119:18 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:118:18 | -119 | let module = RT::decode_call(&serialized_message).unwrap(); +118 | let module = RT::decode_call(&serialized_message).unwrap(); | ^^ the trait `TestSpec` is not implemented for `ZkDefaultContext` | = help: the trait `TestSpec` is implemented for `ActualSpec` note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:19 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^^ required by this bound in `Runtime` error[E0277]: the trait bound `ActualSpec: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:119:18 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:118:18 | -119 | let module = RT::decode_call(&serialized_message).unwrap(); +118 | let module = RT::decode_call(&serialized_message).unwrap(); | ^^ the trait `sov_modules_api::Context` is not implemented for `ActualSpec` | = help: the following other types implement trait `sov_modules_api::Context`: DefaultContext ZkDefaultContext note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:32 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:32 | -97 | struct Runtime { +96 | struct Runtime { | ^^^^^^^ required by this bound in `Runtime` diff --git a/crates/sovereign-sdk/rollup-interface/Cargo.toml b/crates/sovereign-sdk/rollup-interface/Cargo.toml index f50089139..969264b24 100644 --- a/crates/sovereign-sdk/rollup-interface/Cargo.toml +++ b/crates/sovereign-sdk/rollup-interface/Cargo.toml @@ -29,17 +29,12 @@ thiserror = { workspace = true, optional = true } tokio = { workspace = true, optional = true } tracing = { workspace = true, optional = true } -# Proptest should be a dev-dependency, but those can't be optional -proptest = { workspace = true, optional = true } -proptest-derive = { workspace = true, optional = true } - [dev-dependencies] serde_json = { workspace = true } [features] default = ["std"] native = ["std", "tokio", "futures", "tracing"] -fuzzing = ["proptest", "proptest-derive", "std"] testing = ["native"] arbitrary = ["dep:arbitrary"] std = [ @@ -49,7 +44,6 @@ std = [ "bytes", "digest/default", "hex/default", - "proptest?/default", "serde/default", "thiserror", ] diff --git a/crates/sovereign-sdk/rollup-interface/src/node/rpc/mod.rs b/crates/sovereign-sdk/rollup-interface/src/node/rpc/mod.rs index e45b4e52f..0788a0d29 100644 --- a/crates/sovereign-sdk/rollup-interface/src/node/rpc/mod.rs +++ b/crates/sovereign-sdk/rollup-interface/src/node/rpc/mod.rs @@ -12,52 +12,9 @@ use borsh::{BorshDeserialize, BorshSerialize}; use serde::{Deserialize, Serialize}; use crate::da::SequencerCommitment; -#[cfg(feature = "native")] -use crate::stf::EventKey; use crate::zk::{BatchProofInfo, CumulativeStateDiff}; /// A struct containing enough information to uniquely specify single batch. -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct SlotIdAndOffset { - /// The [`SlotIdentifier`] of the slot containing this batch. - pub slot_id: SlotIdentifier, - /// The offset into the slot at which this tx is located. - /// Index 0 is the first batch in the slot. - pub offset: u64, -} - -/// A struct containing enough information to uniquely specify single transaction. -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct BatchIdAndOffset { - /// The [`BatchIdentifier`] of the batch containing this transaction. - pub batch_id: BatchIdentifier, - /// The offset into the batch at which this tx is located. - /// Index 0 is the first transaction in the batch. - pub offset: u64, -} - -/// A struct containing enough information to uniquely specify single event. -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TxIdAndOffset { - /// The [`TxIdentifier`] of the transaction containing this event. - pub tx_id: TxIdentifier, - /// The offset into the tx's events at which this event is located. - /// Index 0 is the first event from this tx. - pub offset: u64, -} - -/// A struct containing enough information to uniquely specify single event. -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TxIdAndKey { - /// The [`TxIdentifier`] of the transaction containing this event. - pub tx_id: TxIdentifier, - /// The key of the event. - pub key: EventKey, -} /// An identifier that specifies a single soft confirmation #[derive(Debug, PartialEq, Serialize, Deserialize)] @@ -69,69 +26,6 @@ pub enum SoftConfirmationIdentifier { Hash(#[serde(with = "utils::rpc_hex")] [u8; 32]), } -/// An identifier that specifies a single batch -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(untagged, rename_all = "camelCase")] -pub enum BatchIdentifier { - /// The hex-encoded hash of the batch, as computed by the DA layer. - Hash(#[serde(with = "utils::rpc_hex")] [u8; 32]), - /// An offset into a particular slot (i.e. the 3rd batch in slot 5). - SlotIdAndOffset(SlotIdAndOffset), - /// The monotonically increasing number of the batch, ordered by the DA layer For example, if the genesis slot - /// contains 0 batches, slot 1 contains 2 txs, and slot 3 contains 3 txs, - /// the last batch in block 3 would have number 5. The counter never resets. - Number(u64), -} - -/// An identifier that specifies a single transaction. -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(untagged, rename_all = "camelCase")] -pub enum TxIdentifier { - /// The hex encoded hash of the transaction. - Hash(#[serde(with = "utils::rpc_hex")] [u8; 32]), - /// An offset into a particular batch (i.e. the 3rd transaction in batch 5). - BatchIdAndOffset(BatchIdAndOffset), - /// The monotonically increasing number of the tx, ordered by the DA layer For example, if genesis - /// contains 0 txs, batch 1 contains 8 txs, and batch 3 contains 7 txs, - /// the last tx in batch 3 would have number 15. The counter never resets. - Number(u64), -} - -/// An identifier that specifies a single event. -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(untagged, rename_all = "camelCase")] -pub enum EventIdentifier { - /// An offset into a particular transaction (i.e. the 3rd event in transaction number 5). - TxIdAndOffset(TxIdAndOffset), - /// A particular event key from a particular transaction. - TxIdAndKey(TxIdAndKey), - /// The monotonically increasing number of the event, ordered by the DA layer For example, if the first tx - /// contains 7 events, tx 2 contains 11 events, and tx 3 contains 7 txs, - /// the last event in tx 3 would have number 25. The counter never resets. - Number(u64), -} - -/// An identifier for a group of related events -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(untagged, rename_all = "camelCase")] -pub enum EventGroupIdentifier { - /// Fetch all events from a particular transaction. - TxId(TxIdentifier), - /// Fetch all events (i.e. from all transactions) with a particular key. - Key(Vec), -} - -/// An identifier that specifies a single slot. -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(untagged, rename_all = "camelCase")] -pub enum SlotIdentifier { - /// The hex encoded hash of the slot (i.e. the da layer's block hash). - Hash(#[serde(with = "utils::rpc_hex")] [u8; 32]), - /// The monotonically increasing number of the slot, ordered by the DA layer but starting from 0 - /// at the *rollup's* genesis. - Number(u64), -} - /// A type that represents a transaction hash bytes. #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] #[serde(transparent, rename_all = "camelCase")] diff --git a/crates/sovereign-sdk/rollup-interface/src/state_machine/stf.rs b/crates/sovereign-sdk/rollup-interface/src/state_machine/stf.rs index f4e82521e..da4d54ac3 100644 --- a/crates/sovereign-sdk/rollup-interface/src/state_machine/stf.rs +++ b/crates/sovereign-sdk/rollup-interface/src/state_machine/stf.rs @@ -409,67 +409,3 @@ impl std::fmt::Display for StateTransitionError { } } } - -/// A key-value pair representing a change to the rollup state -#[derive(Debug, Clone, PartialEq, BorshSerialize, BorshDeserialize, Serialize, Deserialize)] -#[cfg_attr(any(test, feature = "fuzzing"), derive(proptest_derive::Arbitrary))] -pub struct Event { - key: EventKey, - value: EventValue, -} - -impl Event { - /// Create a new event with the given key and value - pub fn new(key: &str, value: &str) -> Self { - Self { - key: EventKey(key.as_bytes().to_vec()), - value: EventValue(value.as_bytes().to_vec()), - } - } - - /// Get the event key - pub fn key(&self) -> &EventKey { - &self.key - } - - /// Get the event value - pub fn value(&self) -> &EventValue { - &self.value - } -} - -/// The key of an event. This is a wrapper around a `Vec`. -#[derive( - Debug, - Clone, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - BorshSerialize, - BorshDeserialize, - Serialize, - Deserialize, -)] -#[cfg_attr(any(test, feature = "fuzzing"), derive(proptest_derive::Arbitrary))] -pub struct EventKey(Vec); - -impl EventKey { - /// Return the inner bytes of the event key. - pub fn inner(&self) -> &Vec { - &self.0 - } -} - -/// The value of an event. This is a wrapper around a `Vec`. -#[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize, Serialize, Deserialize)] -#[cfg_attr(any(test, feature = "fuzzing"), derive(proptest_derive::Arbitrary))] -pub struct EventValue(Vec); - -impl EventValue { - /// Return the inner bytes of the event value. - pub fn inner(&self) -> &Vec { - &self.0 - } -} diff --git a/guests/risc0/batch-proof-bitcoin/Cargo.lock b/guests/risc0/batch-proof-bitcoin/Cargo.lock index f8d68b2e8..e37628fd4 100644 --- a/guests/risc0/batch-proof-bitcoin/Cargo.lock +++ b/guests/risc0/batch-proof-bitcoin/Cargo.lock @@ -3019,7 +3019,6 @@ dependencies = [ "bytes", "digest 0.10.7", "hex", - "proptest", "serde", "thiserror", ] diff --git a/guests/risc0/batch-proof-mock/Cargo.lock b/guests/risc0/batch-proof-mock/Cargo.lock index 70c2c408c..76445ed29 100644 --- a/guests/risc0/batch-proof-mock/Cargo.lock +++ b/guests/risc0/batch-proof-mock/Cargo.lock @@ -2821,7 +2821,6 @@ dependencies = [ "bytes", "digest 0.10.7", "hex", - "proptest", "serde", "thiserror", ] diff --git a/guests/risc0/light-client-proof-bitcoin/Cargo.lock b/guests/risc0/light-client-proof-bitcoin/Cargo.lock index e19533338..21c77740d 100644 --- a/guests/risc0/light-client-proof-bitcoin/Cargo.lock +++ b/guests/risc0/light-client-proof-bitcoin/Cargo.lock @@ -2787,7 +2787,6 @@ dependencies = [ "bytes", "digest 0.10.7", "hex", - "proptest", "serde", "thiserror", ] diff --git a/guests/risc0/light-client-proof-mock/Cargo.lock b/guests/risc0/light-client-proof-mock/Cargo.lock index 129d4335c..71590c375 100644 --- a/guests/risc0/light-client-proof-mock/Cargo.lock +++ b/guests/risc0/light-client-proof-mock/Cargo.lock @@ -2573,7 +2573,6 @@ dependencies = [ "bytes", "digest 0.10.7", "hex", - "proptest", "serde", "thiserror", ]