Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 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
531 changes: 409 additions & 122 deletions Cargo.lock

Large diffs are not rendered by default.

31 changes: 22 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,31 @@ zswap = { version = "=7.0.3", package = "midnight-zswap" }
# transient-crypto 2.2.0's new tagged-IR trait methods.
zkir = { version = "^2.2.0", package = "midnight-zkir" }

# Ledger 8 (compatible with layout-v2)
# coin-structure and transient-crypto (2.x) share versions with L7 so reuse those entries.
mn-ledger-8 = { version = "=8.1.0", package = "midnight-ledger" }
ledger-storage-ledger-8 = { version = "=2.0.1", package = "midnight-storage", features = ["parity-db"] }
onchain-runtime-ledger-8 = { version = "=3.1.0", package = "midnight-onchain-runtime" }
zswap-ledger-8 = { version = "=8.1.0", package = "midnight-zswap" }
# Ledger 8 (8.2.0-rc.1, compatible with layout-v2) — sourced from the git tag, not crates.io.
# 8.2.0-rc.1 is unpublished and the raw tag carries path deps, so the *whole* L8 companion set
# must resolve from the same git rev to unify types: a mixed crates.io/git graph forks a crate
# like midnight-storage-core 1.2.0 into two source-incompatible copies (E0277: trait `DB` not
# satisfied). Consequently L8 no longer shares coin-structure/base-crypto/transient-crypto/
# serialize with L7 — each gets a dedicated `-ledger-8` entry pinned to the tag.
mn-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-ledger" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wire Ledger 8 to guaranteed-only validation

This bump brings Ledger 8 to the 8.2 split-phase API, but the version-specific validation shim is still on the old path: ledger/src/versions/guaranteed_validation/ledger_8.rs:16-35 says Ledger 8 has no apply_guaranteed_only and dry-runs the full state.apply(...). When a node/runtime is still using the Ledger8 bridge, mempool and pre-dispatch validation of a transaction with an expensive or failing fallible segment will still execute that fallible work even though acceptance only depends on the guaranteed segment, undermining the purpose of the 8.2 upgrade and leaving a avoidable validation-cost/DoS path. Please switch the Ledger8 shim to the new apply_guaranteed_only API as part of this dependency bump.

Useful? React with 👍 / 👎.

zswap-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-zswap" }
onchain-runtime-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-onchain-runtime" }
ledger-storage-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-storage", features = ["parity-db"] }
coin-structure-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-coin-structure" }
base-crypto-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-base-crypto" }
transient-crypto-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-transient-crypto" }
serialize-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-serialize" }
# The workspace `zkir` (2.2.0) is bound to the 3.x-crypto stack and can't prove against L8's
# transient-crypto 2.1.0. Take zkir 2.1.0 from the same tag so L8's proving stack is self-consistent.
zkir-ledger-8 = { git = "https://github.com/midnightntwrk/midnight-ledger", tag = "ledger-8.2.0-rc.1", package = "midnight-zkir" }

# Ledger 9 (compatible with layout-v2; midnight-ledger-v9 crate)
# storage shares versions with L8 so reuses that entry. coin-structure and
# transient-crypto went semver-major in L9 so get their own entries. The workspace `zkir`
# (midnight-zkir 2.2.0) serves all of L7/L8/L9.
# midnight-ledger-v9 uses registry deps, so its storage resolves to crates.io 2.0.1; L8 moved to
# the git tag for 8.2, so the two no longer share a storage entry — L9 keeps its own crates.io one.
# coin-structure and transient-crypto went semver-major in L9 so get their own entries. The
# workspace `zkir` (midnight-zkir 2.2.0) serves all of L7/L8/L9.
mn-ledger-9 = { version = "=1.0.0", package = "midnight-ledger-v9" }
ledger-storage-ledger-9 = { version = "=2.0.1", package = "midnight-storage", features = ["parity-db"] }
onchain-runtime-ledger-9 = { version = "=4.0.0", package = "midnight-onchain-runtime" }
zswap-ledger-9 = { version = "=9.0.0", package = "midnight-zswap" }
coin-structure-ledger-9 = { version = "=3.0.0", package = "midnight-coin-structure" }
Expand Down
17 changes: 17 additions & 0 deletions changes/node/changed/ledger-8-2-upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ledger #dependencies
# Upgrade ledger 8 from 8.1.0 to 8.2.0-rc.1

Bumps the ledger-8 stack to `midnight-ledger` 8.2.0-rc.1 (picking up
`apply_guaranteed_only`, infallible `post_block_update`, split-phase execution
with deferred events, and the segment-type refactor), keeping ledger 9 as-is.

8.2.0-rc.1 is not published to crates.io, so the ledger-8 crates are sourced
directly from the `ledger-8.2.0-rc.1` git tag. Because the tag carries path
deps, ledger 8 no longer shares its companion crates with ledger 7 — each gets
a dedicated `-ledger-8` entry pinned to the tag. Per-generation storage code
now uses each ledger's own `DefaultHasher` instead of a hardcoded `sha2::Sha256`
so it tracks the git-8.2 storage-core's sha2 0.11 bump automatically, and the
hard-fork state-migration helpers serialize-round-trip across the (now
distinct) L7/L8/L9 storage arenas instead of reinterpreting arena keys in place.

PR: https://github.com/midnightntwrk/midnight-node/pull/1869
10 changes: 10 additions & 0 deletions ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ mn-ledger-8 = { workspace = true, features = ["proving"], optional = true }
onchain-runtime-ledger-8 = { workspace = true, optional = true }
ledger-storage-ledger-8 = { workspace = true, optional = true }
zswap-ledger-8 = { workspace = true, optional = true }
coin-structure-ledger-8 = { workspace = true, optional = true }
base-crypto-ledger-8 = { workspace = true, optional = true }
transient-crypto-ledger-8 = { workspace = true, optional = true }
serialize-ledger-8 = { workspace = true, optional = true }

mn-ledger-9 = { workspace = true, features = ["proving"], optional = true }
onchain-runtime-ledger-9 = { workspace = true, optional = true }
ledger-storage-ledger-9 = { workspace = true, optional = true }
zswap-ledger-9 = { workspace = true, optional = true }
coin-structure-ledger-9 = { workspace = true, optional = true }
transient-crypto-ledger-9 = { workspace = true, optional = true }
Expand Down Expand Up @@ -83,8 +88,13 @@ std = [
"onchain-runtime-ledger-8",
"ledger-storage-ledger-8",
"zswap-ledger-8",
"coin-structure-ledger-8",
"base-crypto-ledger-8",
"transient-crypto-ledger-8",
"serialize-ledger-8",
"mn-ledger-9",
"onchain-runtime-ledger-9",
"ledger-storage-ledger-9",
"zswap-ledger-9",
"coin-structure-ledger-9",
"transient-crypto-ledger-9",
Expand Down
6 changes: 6 additions & 0 deletions ledger/helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ mn-ledger-8 = { workspace = true, features = ["proving"] }
onchain-runtime-ledger-8 = { workspace = true }
ledger-storage-ledger-8 = { workspace = true }
zswap-ledger-8 = { workspace = true }
coin-structure-ledger-8 = { workspace = true }
base-crypto-ledger-8 = { workspace = true }
transient-crypto-ledger-8 = { workspace = true }
serialize-ledger-8 = { workspace = true }
zkir-ledger-8 = { workspace = true }

mn-ledger-9 = { workspace = true, features = ["proving", "test-utilities"] }
onchain-runtime-ledger-9 = { workspace = true }
ledger-storage-ledger-9 = { workspace = true }
zswap-ledger-9 = { workspace = true }
coin-structure-ledger-9 = { workspace = true }
transient-crypto-ledger-9 = { workspace = true }
Expand Down
15 changes: 4 additions & 11 deletions ledger/helpers/src/extract_tx_with_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,15 @@ pub fn extract_tx_with_context_ledger_9(bytes: &[u8]) -> (Vec<u8>, crate::ledger

#[cfg(feature = "can-panic")]
pub fn extract_tx_with_context_ledger_8(bytes: &[u8]) -> (Vec<u8>, crate::ledger_8::BlockContext) {
use crate::fork::raw_block_data::RawTransaction;

let serialized_tx: SerializedTx =
// The `BlockContext` JSON wire shape is version-agnostic (see `SerializedTx`
// docs), so deserialize straight into L8's context type.
let serialized_tx: SerializedTx<crate::ledger_8::BlockContext> =
serde_json::from_slice(bytes).expect("failed to deserialize as SerializedTx");
let RawTransaction::Midnight(tx_bytes) = serialized_tx.tx else {
panic!("expected test to run against midnight transaction");
};

let block_context = crate::ledger_8::BlockContext {
tblock: serialized_tx.context.tblock,
tblock_err: serialized_tx.context.tblock_err,
parent_block_hash: serialized_tx.context.parent_block_hash,
last_block_time: serialized_tx.context.last_block_time,
};

(tx_bytes, block_context)
(tx_bytes, serialized_tx.context)
}

#[cfg(feature = "can-panic")]
Expand Down
25 changes: 13 additions & 12 deletions ledger/helpers/src/fork/fork_7_to_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ use crate::ledger_8::{
Timestamp as Timestamp8, UnshieldedWallet, Wallet, WalletSeed, WalletState, default_storage,
};

/// Move a storage-pointer value from ledger-7 storage into ledger-8 storage.
///
/// L7 (crates.io storage-core) and L8 (git-8.2 storage-core) no longer share a storage arena, so
/// this serializes `t1` in the L7 format, deserializes it as `T2` in the L8 format, and allocates
/// the result into L8 storage. Hence the `Serializable`/`Deserializable` bounds.
pub fn old_to_new_sp<T1, T2>(
mut t1: crate::ledger_7::Sp<T1, Db7>,
t1: crate::ledger_7::Sp<T1, Db7>,
) -> Result<crate::ledger_8::Sp<T2, Db8>, std::io::Error>
where
T1: crate::ledger_7::Storable<Db7>,
T2: crate::ledger_8::Storable<Db8> + crate::ledger_8::Tagged,
T1: crate::ledger_7::Storable<Db7> + crate::ledger_7::Serializable + crate::ledger_7::Tagged,
T2: crate::ledger_8::Storable<Db8> + crate::ledger_8::Deserializable + crate::ledger_8::Tagged,
{
t1.persist();
let old_root = t1.as_typed_key().key;
// Both ArenaKey types are the same type (unified via midnight-storage-core patch).
let new_arena_key: crate::ledger_8::ArenaKey = old_root;
let new_root = crate::ledger_8::mn_ledger_storage::arena::TypedArenaKey::<
T2,
<Db8 as crate::ledger_8::DB>::Hasher,
>::from(new_arena_key);
default_storage::<Db8>().arena.get_lazy(&new_root)
// L7 (crates.io storage-core) and L8 (git-8.2 storage-core) no longer share a storage arena,
// so move the value across by serializing in the L7 format and deserializing in L8, then
// allocate it into L8 storage. (Previously this reinterpreted the arena key in place.)
let value: T2 = old_to_new_ser(&*t1)?;
Ok(default_storage::<Db8>().arena.alloc(value))
}

/// Serialize with ledger-7 format, deserialize with ledger-8 format (tagged).
Expand Down
41 changes: 23 additions & 18 deletions ledger/helpers/src/fork/fork_8_to_9.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ use crate::ledger_9::{
UnshieldedWallet, Wallet, WalletSeed, WalletState, default_storage,
};

/// Move a storage-pointer value from ledger-8 storage into ledger-9 storage.
///
/// L8 (git-8.2 storage-core) and L9 (crates.io storage-core) no longer share a storage arena, so
/// this serializes `t1` in the L8 format, deserializes it as `T2` in the L9 format, and allocates
/// the result into L9 storage. Hence the `Serializable`/`Deserializable` bounds.
pub fn old_to_new_sp<T1, T2>(
mut t1: crate::ledger_8::Sp<T1, Db8>,
t1: crate::ledger_8::Sp<T1, Db8>,
) -> Result<crate::ledger_9::Sp<T2, Db9>, std::io::Error>
where
T1: crate::ledger_8::Storable<Db8> + crate::ledger_8::Tagged,
T2: crate::ledger_9::Storable<Db9> + crate::ledger_9::Tagged,
T1: crate::ledger_8::Storable<Db8> + crate::ledger_8::Serializable + crate::ledger_8::Tagged,
T2: crate::ledger_9::Storable<Db9> + crate::ledger_9::Deserializable + crate::ledger_9::Tagged,
{
t1.persist();
let old_root = t1.as_typed_key().key;
// Both ArenaKey types are the same type (unified via midnight-storage-core patch).
let new_arena_key: crate::ledger_9::ArenaKey = old_root;
let new_root = crate::ledger_9::mn_ledger_storage::arena::TypedArenaKey::<
T2,
<Db8 as crate::ledger_9::DB>::Hasher,
>::from(new_arena_key);
default_storage::<Db9>().arena.get_lazy(&new_root)
// L8 (git-8.2 storage-core) and L9 (crates.io storage-core) no longer share a storage arena,
// so the old in-place arena-key reinterpret is invalid. Move the value across by serializing in
// the L8 format and deserializing in L9, then allocate it into L9 storage.
let value: T2 = old_to_new_ser(&*t1)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use untagged conversion for L8→L9 forked state

When fork_context_8_to_9 calls this for the ledger state, this now serializes with ledger-8's tagged format and deserializes with ledger-9's tagged format. The state tags are intentionally different (ledger-state[v13] vs ledger-state[v18], as documented in ledger/src/versions/common/storage.rs), so any toolkit path that forks an L8 context to L9 will return a deserialization error before migration instead of producing the new context; this replacement for the old arena-key copy needs an untagged or otherwise version-aware conversion for types whose tag changed.

Useful? React with 👍 / 👎.

Ok(default_storage::<Db9>().arena.alloc(value))
}

/// Serialize with ledger-8 format, deserialize with ledger-9 format (tagged).
Expand All @@ -52,22 +53,26 @@ pub fn old_to_new_ser_untagged<
crate::ledger_9::deserialize_untagged(&mut &t_bytes[..])
}

/// Convert a ledger-8 BlockContext to a ledger-9 BlockContext.
/// Convert a ledger-8 `BlockContext` to a ledger-9 one.
///
/// L8 and L9 base-crypto diverged (1.0.0 vs 1.1.0), so the `Timestamp` and `HashOutput` fields are
/// distinct types and are rebuilt by value rather than moved.
pub fn block_context_8_to_9(ctx8: &crate::ledger_8::BlockContext) -> BlockContext9 {
use crate::ledger_9::base_crypto::time::Timestamp;
// L8/L9 base-crypto diverged (1.0.0 vs 1.1.0), so timestamps are rebuilt by value.
BlockContext9 {
tblock: ctx8.tblock,
tblock: Timestamp::from_secs(ctx8.tblock.to_secs()),
tblock_err: ctx8.tblock_err,
parent_block_hash: HashOutput9(ctx8.parent_block_hash.0),
last_block_time: ctx8.last_block_time,
last_block_time: Timestamp::from_secs(ctx8.last_block_time.to_secs()),
}
}

pub fn fork_context_8_to_9(
context8: LedgerContext8<Db8>,
) -> Result<LedgerContext9<Db9>, std::io::Error> {
let ledger_state_8 = context8.ledger_state.lock().expect("failed to lock ledger state");
let ledger_state: crate::ledger_9::Sp<LedgerState8<Db8>, Db8> =
let ledger_state: crate::ledger_9::Sp<LedgerState8<Db9>, Db9> =
old_to_new_sp(ledger_state_8.clone())?;

let mut wallets = HashMap::new();
Expand All @@ -89,7 +94,7 @@ pub fn fork_context_8_to_9(
.expect("wallet seed different length between versions")
}),
shielded: ShieldedWallet {
state: (*old_to_new_sp::<_, WalletState<Db8>>(crate::ledger_8::Sp::new(
state: (*old_to_new_sp::<_, WalletState<Db9>>(crate::ledger_8::Sp::new(
v.shielded.state.clone(),
))?)
.clone(),
Expand All @@ -101,7 +106,7 @@ pub fn fork_context_8_to_9(
v.unshielded.clone(),
))?)
.clone(),
dust: (*old_to_new_sp::<_, DustWallet<Db8>>(crate::ledger_8::Sp::new(v.dust.clone()))?)
dust: (*old_to_new_sp::<_, DustWallet<Db9>>(crate::ledger_8::Sp::new(v.dust.clone()))?)
.clone(),
};
let new_key: WalletSeed = old_to_new_ser_untagged(&k)?;
Expand Down
12 changes: 9 additions & 3 deletions ledger/helpers/src/fork/raw_block_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,24 @@ impl RawBlockData {
}

/// A single serialized transaction ready for sending or file output.
///
/// `C` is the target ledger version's `BlockContext` (defaults to the current,
/// ledger-9, type). Every ledger version serializes `BlockContext` through the
/// same `SerdeBlockContext` bridge, so the JSON wire shape is version-agnostic
/// and the context can be deserialized directly as the version the caller
/// needs, e.g. `SerializedTx<ledger_8::BlockContext>`.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct SerializedTx {
pub struct SerializedTx<C = BlockContext> {
/// Serialized `Transaction` — the payload for `send_mn_transaction`.
pub tx: RawTransaction,
/// Serialized `BlockContext`
pub context: BlockContext,
pub context: C,
/// Transaction hash for logging.
#[serde(with = "hex_or_bytes_32")]
pub tx_hash: [u8; 32],
}

impl SerializedTx {
impl<C> SerializedTx<C> {
pub fn tx_byte_len(&self) -> usize {
match &self.tx {
RawTransaction::Midnight(tx) => tx.len(),
Expand Down
10 changes: 6 additions & 4 deletions ledger/helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ pub mod ledger_8 {
/// Workspace dependency name of the ledger crate backing this module.
pub const CRATE_NAME: &str = "mn-ledger-8";
pub use {
base_crypto, coin_structure, ledger_storage_ledger_8 as ledger_storage, midnight_serialize,
mn_ledger_8 as mn_ledger, onchain_runtime_ledger_8 as onchain_runtime, transient_crypto,
zkir, zswap_ledger_8 as zswap,
base_crypto_ledger_8 as base_crypto, coin_structure_ledger_8 as coin_structure,
ledger_storage_ledger_8 as ledger_storage, mn_ledger_8 as mn_ledger,
onchain_runtime_ledger_8 as onchain_runtime, serialize_ledger_8 as midnight_serialize,
transient_crypto_ledger_8 as transient_crypto, zkir_ledger_8 as zkir,
zswap_ledger_8 as zswap,
};

// Vendored test-utilities shim for v8.
Expand Down Expand Up @@ -285,7 +287,7 @@ pub mod ledger_9 {
pub const CRATE_NAME: &str = "mn-ledger-9";
pub use {
base_crypto, coin_structure_ledger_9 as coin_structure,
ledger_storage_ledger_8 as ledger_storage, midnight_serialize, mn_ledger_9 as mn_ledger,
ledger_storage_ledger_9 as ledger_storage, midnight_serialize, mn_ledger_9 as mn_ledger,
onchain_runtime_ledger_9 as onchain_runtime, transient_crypto_ledger_9 as transient_crypto,
zkir, zswap_ledger_9 as zswap,
};
Expand Down
2 changes: 1 addition & 1 deletion ledger/helpers/src/versions/common/wallet/dust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ impl<D: DB> TryFrom<&WalletAddress> for DustWallet<D> {

#[cfg(test)]
mod tests {
use super::storage::DefaultDB;
use super::{DerivationPath, DustWallet, Role, WalletSeed};
use crate::DefaultDB;

fn test_seed() -> WalletSeed {
WalletSeed::from([0u8; 32])
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/host_api/ledger_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Signature = crate::ledger_8::base_crypto_local::signatures::Signature;
type DbSeparate = crate::ledger_8::ledger_storage_local::db::ParityDb;
#[cfg(feature = "std")]
type DbUnified = crate::ledger_8::ledger_storage_local::db::ParityDb<
sha2::Sha256,
crate::ledger_8::ledger_storage_local::DefaultHasher,
crate::ledger_8::ledger_storage_local::db::paritydb::OwnedDb,
{ LedgerStorageExt::COLUMN_OFFSET },
>;
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/host_api/ledger_9.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ pub trait Ledger9Bridge {
/// drops new version's storage and initializes normal storage.
/// Returns true if storage was (re)initialized, false if already correct.
fn ensure_storage_initialized(&mut self) -> bool {
use ledger_storage_ledger_8::storage::try_get_default_storage;
use ledger_storage_ledger_9::storage::try_get_default_storage;

let unified = is_unified(*self);

Expand Down
14 changes: 7 additions & 7 deletions ledger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ pub mod ledger_7 {
pub mod ledger_8 {
#[cfg(feature = "std")]
pub(crate) use {
base_crypto as base_crypto_local, coin_structure as coin_structure_local,
base_crypto_ledger_8 as base_crypto_local, coin_structure_ledger_8 as coin_structure_local,
ledger_storage_ledger_8 as ledger_storage_local,
midnight_node_ledger_helpers::ledger_8 as helpers_local,
midnight_serialize as midnight_serialize_local, mn_ledger_8 as mn_ledger_local,
midnight_node_ledger_helpers::ledger_8 as helpers_local, mn_ledger_8 as mn_ledger_local,
onchain_runtime_ledger_8 as onchain_runtime_local,
transient_crypto as transient_crypto_local, zswap_ledger_8 as zswap_local,
serialize_ledger_8 as midnight_serialize_local,
transient_crypto_ledger_8 as transient_crypto_local, zswap_ledger_8 as zswap_local,
};

#[path = "block_context/post_ledger_8.rs"]
Expand Down Expand Up @@ -108,7 +108,7 @@ pub mod ledger_9 {
#[cfg(feature = "std")]
pub(crate) use {
base_crypto as base_crypto_local, coin_structure_ledger_9 as coin_structure_local,
ledger_storage_ledger_8 as ledger_storage_local,
ledger_storage_ledger_9 as ledger_storage_local,
midnight_node_ledger_helpers::ledger_9 as helpers_local,
midnight_serialize as midnight_serialize_local, mn_ledger_9 as mn_ledger_local,
onchain_runtime_ledger_9 as onchain_runtime_local,
Expand Down Expand Up @@ -167,7 +167,7 @@ pub mod types {
mod tests {
use frame_support::assert_ok;
use ledger_storage_ledger_8::{
Storage,
DefaultHasher, Storage,
db::ParityDb,
storage::{set_default_storage, try_get_default_storage, unsafe_drop_default_storage},
};
Expand All @@ -185,7 +185,7 @@ mod tests {
panic!("Failed to create dir {}, err {}", db_path.display(), err)
});

let db = ParityDb::<sha2::Sha256>::open(&db_path);
let db = ParityDb::<DefaultHasher>::open(&db_path);

Storage::new(0, db)
});
Expand Down
Loading
Loading