diff --git a/Cargo.lock b/Cargo.lock index 4193c4bd693..b8a51717713 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -910,8 +910,9 @@ dependencies = [ [[package]] name = "concread" -version = "0.5.2" -source = "git+https://github.com/Erigara/concread.git?rev=bd80db2e85ed179f41aeabc6629e4eb3ec987ed9#bd80db2e85ed179f41aeabc6629e4eb3ec987ed9" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cba00cef522c2597dfbb0a8d1b0ac8ac2b99714f50cc354cda71da63164da0be" dependencies = [ "ahash 0.8.11", "arc-swap", @@ -3024,6 +3025,7 @@ dependencies = [ "iroha_telemetry", "iroha_version", "iroha_wasm_codec", + "mv", "nonzero_ext", "once_cell", "parity-scale-codec", @@ -3031,7 +3033,6 @@ dependencies = [ "rand", "serde", "serde_json", - "storage", "tempfile", "test_samples", "thiserror", @@ -4104,6 +4105,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "mv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043dac58686a287d11266132477331e8afdc83bd5880dbfeeba8adef565f9303" +dependencies = [ + "concread", + "serde", +] + [[package]] name = "native-tls" version = "0.2.11" @@ -5585,15 +5596,6 @@ dependencies = [ "thread_local", ] -[[package]] -name = "storage" -version = "0.1.0" -source = "git+https://github.com/Erigara/storage.git?rev=cf82588d20494a1c1613ea2f4faa1e66bd827b5c#cf82588d20494a1c1613ea2f4faa1e66bd827b5c" -dependencies = [ - "concread", - "serde", -] - [[package]] name = "streaming-stats" version = "0.2.3" diff --git a/Cargo.toml b/Cargo.toml index 8f03e5f5cd6..fa6ed17714e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -123,7 +123,7 @@ parity-scale-codec = { version = "3.6.12", default-features = false } json5 = "0.4.1" toml = "0.8.16" -storage = { git = "https://github.com/Erigara/storage.git", rev = "cf82588d20494a1c1613ea2f4faa1e66bd827b5c" } +mv = { version = "0.1.0" } [workspace.lints] rustdoc.private_doc_tests = "deny" diff --git a/core/Cargo.toml b/core/Cargo.toml index ea3cc487d02..504a2ade04a 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -45,7 +45,7 @@ iroha_telemetry = { workspace = true } iroha_primitives = { workspace = true } iroha_genesis = { workspace = true } iroha_wasm_codec = { workspace = true } -storage = { workspace = true, features = ["serde"] } +mv = { workspace = true, features = ["serde"] } async-trait = { workspace = true } dashmap = { workspace = true } diff --git a/core/src/block.rs b/core/src/block.rs index 8af28da8704..57cb6721f49 100644 --- a/core/src/block.rs +++ b/core/src/block.rs @@ -283,7 +283,7 @@ mod valid { use commit::CommittedBlock; use indexmap::IndexMap; use iroha_data_model::{account::AccountId, events::pipeline::PipelineEventBox, ChainId}; - use storage::storage::StorageReadOnly; + use mv::storage::StorageReadOnly; use super::*; use crate::{state::StateBlock, sumeragi::network_topology::Role}; diff --git a/core/src/metrics.rs b/core/src/metrics.rs index da9fec96d73..b377cd1986a 100644 --- a/core/src/metrics.rs +++ b/core/src/metrics.rs @@ -4,8 +4,8 @@ use std::{num::NonZeroUsize, sync::Arc, time::SystemTime}; use eyre::{Result, WrapErr as _}; use iroha_telemetry::metrics::Metrics; +use mv::storage::StorageReadOnly; use parking_lot::Mutex; -use storage::storage::StorageReadOnly; use crate::{ kura::Kura, diff --git a/core/src/smartcontracts/isi/mod.rs b/core/src/smartcontracts/isi/mod.rs index 670b30aa8d5..c19ad67493d 100644 --- a/core/src/smartcontracts/isi/mod.rs +++ b/core/src/smartcontracts/isi/mod.rs @@ -16,7 +16,7 @@ use iroha_data_model::{ prelude::*, }; use iroha_logger::prelude::*; -use storage::storage::StorageReadOnly; +use mv::storage::StorageReadOnly; use super::Execute; use crate::{ diff --git a/core/src/smartcontracts/isi/triggers/set.rs b/core/src/smartcontracts/isi/triggers/set.rs index 4e3f264829d..4de0ed0c110 100644 --- a/core/src/smartcontracts/isi/triggers/set.rs +++ b/core/src/smartcontracts/isi/triggers/set.rs @@ -19,17 +19,17 @@ use iroha_data_model::{ query::error::FindError, transaction::WasmSmartContract, }; -use serde::{ - de::{DeserializeSeed, MapAccess, Visitor}, - Deserialize, Serialize, -}; -use storage::{ +use mv::{ cell::{Block as CellBlock, Cell, Transaction as CellTransaction, View as CellView}, storage::{ Block as StorageBlock, Storage, StorageReadOnly, Transaction as StorageTransaction, View as StorageView, }, }; +use serde::{ + de::{DeserializeSeed, MapAccess, Visitor}, + Deserialize, Serialize, +}; use thiserror::Error; use crate::{ @@ -207,11 +207,10 @@ impl<'de> DeserializeSeed<'de> for WasmSeed<'_, Set> { ids = Some(map.next_value()?); } "contracts" => { - contracts = - Some(map.next_value_seed(storage::serde::StorageSeeded { - kseed: PhantomData, - vseed: self.loader.cast::(), - })?); + contracts = Some(map.next_value_seed(mv::serde::StorageSeeded { + kseed: PhantomData, + vseed: self.loader.cast::(), + })?); } "matched_ids" => { matched_ids = Some(map.next_value()?); @@ -710,7 +709,7 @@ impl<'block, 'set> SetTransaction<'block, 'set> { /// # Errors /// /// Return [`Err`] if failed to preload wasm trigger - fn add_to( + fn add_to( &mut self, engine: &wasmtime::Engine, trigger: SpecializedTrigger, @@ -872,7 +871,7 @@ impl<'block, 'set> SetTransaction<'block, 'set> { /// Note that this function doesn't remove the trigger from [`Set::ids`]. /// /// Returns `true` if trigger was removed and `false` otherwise. - fn remove_from( + fn remove_from( contracts: &mut WasmSmartContractMapTransaction<'block, 'set>, triggers: &mut StorageTransaction<'block, 'set, TriggerId, LoadedAction>, trigger_id: TriggerId, @@ -936,7 +935,7 @@ impl<'block, 'set> SetTransaction<'block, 'set> { } /// Remove actions with zero execution count from `triggers` - fn remove_zeros( + fn remove_zeros( ids: &mut StorageTransaction<'block, 'set, TriggerId, TriggeringEventType>, contracts: &mut WasmSmartContractMapTransaction<'block, 'set>, triggers: &mut StorageTransaction<'block, 'set, TriggerId, LoadedAction>, diff --git a/core/src/state.rs b/core/src/state.rs index 80a6077e5b8..d85d8c2da4c 100644 --- a/core/src/state.rs +++ b/core/src/state.rs @@ -24,6 +24,13 @@ use iroha_data_model::{ }; use iroha_logger::prelude::*; use iroha_primitives::{must_use::MustUse, numeric::Numeric, small::SmallVec}; +use mv::{ + cell::{Block as CellBlock, Cell, Transaction as CellTransaction, View as CellView}, + storage::{ + Block as StorageBlock, RangeIter, Storage, StorageReadOnly, + Transaction as StorageTransaction, View as StorageView, + }, +}; use nonzero_ext::nonzero; use parking_lot::Mutex; use range_bounds::*; @@ -31,13 +38,6 @@ use serde::{ de::{DeserializeSeed, MapAccess, Visitor}, Deserializer, Serialize, }; -use storage::{ - cell::{Block as CellBlock, Cell, Transaction as CellTransaction, View as CellView}, - storage::{ - Block as StorageBlock, RangeIter, Storage, StorageReadOnly, - Transaction as StorageTransaction, View as StorageView, - }, -}; use crate::{ block::CommittedBlock, @@ -1871,7 +1871,7 @@ mod range_bounds { } pub(crate) mod deserialize { - use storage::serde::CellSeeded; + use mv::serde::CellSeeded; use super::*; diff --git a/core/src/tx.rs b/core/src/tx.rs index c3b2c5c1c10..44fe92aed46 100644 --- a/core/src/tx.rs +++ b/core/src/tx.rs @@ -20,7 +20,7 @@ use iroha_data_model::{ }; use iroha_logger::{debug, error}; use iroha_macro::FromVariant; -use storage::storage::StorageReadOnly; +use mv::storage::StorageReadOnly; use crate::{ smartcontracts::wasm,