Просмотр исходного кода

chore: dropped remaining sled references

x 3 дней назад
Родитель
Сommit
27143c318c

+ 10 - 99
Cargo.lock

@@ -2052,7 +2052,7 @@ dependencies = [
  "nu-ansi-term",
  "num-bigint",
  "oxy-upnp-igd",
- "parking_lot 0.12.5",
+ "parking_lot",
  "pin-project-lite",
  "plotters",
  "prettytable-rs",
@@ -2064,7 +2064,6 @@ dependencies = [
  "semver",
  "serde",
  "sha2 0.11.0",
- "sled-overlay",
  "smol",
  "socket2",
  "structopt",
@@ -2102,7 +2101,7 @@ dependencies = [
  "darkfi_money_contract",
  "kvdb-overlay",
  "num-bigint",
- "parking_lot 0.12.5",
+ "parking_lot",
  "rand 0.8.6",
  "tracing",
  "tracing-subscriber",
@@ -2184,7 +2183,6 @@ dependencies = [
  "num-bigint",
  "pasta_curves",
  "semver",
- "sled-overlay",
  "url",
 ]
 
@@ -2459,7 +2457,7 @@ dependencies = [
  "hashbrown 0.14.5",
  "lock_api",
  "once_cell",
- "parking_lot_core 0.9.12",
+ "parking_lot_core",
 ]
 
 [[package]]
@@ -3432,16 +3430,6 @@ dependencies = [
  "walkdir",
 ]
 
-[[package]]
-name = "fs2"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213"
-dependencies = [
- "libc",
- "winapi",
-]
-
 [[package]]
 name = "fs4"
 version = "0.13.1"
@@ -3647,15 +3635,6 @@ dependencies = [
  "slab",
 ]
 
-[[package]]
-name = "fxhash"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
-dependencies = [
- "byteorder",
-]
-
 [[package]]
 name = "genawaiter"
 version = "0.99.1"
@@ -4433,15 +4412,6 @@ dependencies = [
  "hybrid-array",
 ]
 
-[[package]]
-name = "instant"
-version = "0.1.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
-dependencies = [
- "cfg-if",
-]
-
 [[package]]
 name = "interval-heap"
 version = "0.0.5"
@@ -5681,17 +5651,6 @@ version = "2.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
 
-[[package]]
-name = "parking_lot"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
-dependencies = [
- "instant",
- "lock_api",
- "parking_lot_core 0.8.6",
-]
-
 [[package]]
 name = "parking_lot"
 version = "0.12.5"
@@ -5699,21 +5658,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
 dependencies = [
  "lock_api",
- "parking_lot_core 0.9.12",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
-dependencies = [
- "cfg-if",
- "instant",
- "libc",
- "redox_syscall 0.2.16",
- "smallvec",
- "winapi",
+ "parking_lot_core",
 ]
 
 [[package]]
@@ -5724,7 +5669,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
 dependencies = [
  "cfg-if",
  "libc",
- "redox_syscall 0.5.18",
+ "redox_syscall",
  "smallvec",
  "windows-link",
 ]
@@ -6029,7 +5974,7 @@ dependencies = [
  "atomic 0.5.3",
  "crossbeam-queue",
  "futures",
- "parking_lot 0.12.5",
+ "parking_lot",
  "pin-project",
  "static_assertions",
  "thiserror 1.0.69",
@@ -6618,15 +6563,6 @@ dependencies = [
  "rand_core 0.6.4",
 ]
 
-[[package]]
-name = "redox_syscall"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
-dependencies = [
- "bitflags 1.3.2",
-]
-
 [[package]]
 name = "redox_syscall"
 version = "0.5.18"
@@ -7532,31 +7468,6 @@ version = "0.4.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
 
-[[package]]
-name = "sled"
-version = "0.34.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935"
-dependencies = [
- "crc32fast",
- "crossbeam-epoch",
- "crossbeam-utils",
- "fs2",
- "fxhash",
- "libc",
- "log",
- "parking_lot 0.11.2",
-]
-
-[[package]]
-name = "sled-overlay"
-version = "0.1.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "719b8db2a2b2798bc015c45613040c4dbc552dca6c605d8796248ba587afa7fe"
-dependencies = [
- "sled",
-]
-
 [[package]]
 name = "slice-group-by"
 version = "0.3.1"
@@ -8110,7 +8021,7 @@ dependencies = [
  "blake2",
  "borsh",
  "bytemuck",
- "parking_lot 0.12.5",
+ "parking_lot",
  "slab",
 ]
 
@@ -9726,7 +9637,7 @@ dependencies = [
  "num-bigint",
  "num-traits",
  "pack1",
- "parking_lot 0.12.5",
+ "parking_lot",
  "pastey",
  "polling",
  "rand 0.9.4",
@@ -9802,7 +9713,7 @@ checksum = "d1038dcaa88536044e984dd58c39c2475f9d1e8218a705338d750b19ad3fd36f"
 dependencies = [
  "bindgen 0.69.5",
  "env_logger",
- "parking_lot 0.12.5",
+ "parking_lot",
  "tracing",
  "tracing-appender",
  "tracing-subscriber",
@@ -9853,7 +9764,7 @@ dependencies = [
  "bindgen 0.69.5",
  "env_logger",
  "genawaiter",
- "parking_lot 0.12.5",
+ "parking_lot",
  "tracing",
  "tracing-appender",
  "tracing-subscriber",

+ 0 - 1
Cargo.toml

@@ -116,7 +116,6 @@ wasmer-compiler-singlepass = {version = "6.1.0", optional = true}
 wasmer-middlewares = {version = "6.1.0", optional = true}
 
 # Blockchain store
-sled-overlay = {version = "0.1.20", optional = true}
 kvdb-overlay = {git = "https://git.dark.fi/darkrenaissance/kvdb-overlay", version = "0.1.0", optional = true}
 
 # Miner

+ 1 - 1
contrib/localnet/darkfid-five-nodes/tmux_sessions.sh

@@ -5,7 +5,7 @@ set -e
 
 # Path to used binaries
 XMRIG="xmrig"
-DARKFID="LOG_TARGETS='!runtime,!sled' ../../../darkfid"
+DARKFID="LOG_TARGETS='!runtime,!fjall' ../../../darkfid"
 
 # Dummy mining wallet address so mining daemons can start
 XMRIG_USER="DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"

+ 1 - 1
contrib/localnet/darkfid-single-node/tmux_sessions.sh

@@ -12,7 +12,7 @@ XMRIG_PARAMS="-u x+1 -r 1000 -R 20 -o $XMRIG_STRATUM_ENDPOINT -t $XMRIG_THREADS
 XMRIG="$XMRIG_BINARY_PATH $XMRIG_PARAMS"
 
 # Path to darkfid binary
-DARKFID="LOG_TARGETS='!net,!runtime,!sled' ../../../darkfid -c darkfid.toml"
+DARKFID="LOG_TARGETS='!net,!runtime,!fjall' ../../../darkfid -c darkfid.toml"
 
 session=darkfid-single-node
 

+ 1 - 1
contrib/localnet/darkfid-small/reorg-test.sh

@@ -3,7 +3,7 @@ set -e
 
 # Path to used binaries
 XMRIG="xmrig"
-DARKFID="LOG_TARGETS='!sled' ../../../darkfid"
+DARKFID="LOG_TARGETS='!fjall' ../../../darkfid"
 
 # Dummy mining wallet addresses so mining daemons can start
 XMRIG_USER0="DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"

+ 1 - 1
contrib/localnet/darkfid-small/tmux_sessions.sh

@@ -9,7 +9,7 @@ mkdir -p darkfid0 darkfid1 darkfid2
 
 # Path to used binaries
 XMRIG="xmrig"
-DARKFID="LOG_TARGETS='!sled' ../../../darkfid"
+DARKFID="LOG_TARGETS='!fjall' ../../../darkfid"
 
 # Dummy mining wallet addresses so mining daemons can start
 XMRIG_USER0="DZnsGMCvZU5CEzvpuExnxbvz6SEhE2rn89sMcuHsppFE6TjL4SBTrKkf"

+ 1 - 1
contrib/localnet/taud-four-nodes/seed.toml

@@ -7,7 +7,7 @@ datastore = "seed"
 ## Sets DB logs replay datastore path
 #replay_datastore = "~/.local/share/darkfi/replayed_taud_db"
 
-## Run in replay mode to store Sled DB instructions
+## Run in replay mode to store KVDB instructions
 ## (for eventgraph debugging tool)
 #replay_mode = false
 

+ 2 - 2
contrib/localnet/taud-four-nodes/taud_full_node1.toml

@@ -7,7 +7,7 @@ datastore = "taud1"
 ## Sets DB logs replay datastore path
 #replay_datastore = "~/.local/share/darkfi/replayed_taud_db"
 
-## Run in replay mode to store Sled DB instructions
+## Run in replay mode to store KVDB instructions
 ## (for eventgraph debugging tool)
 #replay_mode = false
 
@@ -96,4 +96,4 @@ inbound = ["tcp://127.0.0.1:23332"]
 
 ## Addresses we want to advertise to peers (optional)
 ## These should be reachable externally
-external_addrs = ["tcp://127.0.0.1:23332"]
+external_addrs = ["tcp://127.0.0.1:23332"]

+ 2 - 2
contrib/localnet/taud-four-nodes/taud_full_node2.toml

@@ -7,7 +7,7 @@ datastore = "taud2"
 ## Sets DB logs replay datastore path
 #replay_datastore = "~/.local/share/darkfi/replayed_taud_db"
 
-## Run in replay mode to store Sled DB instructions
+## Run in replay mode to store KVDB instructions
 ## (for eventgraph debugging tool)
 #replay_mode = false
 
@@ -96,4 +96,4 @@ inbound = ["tcp://127.0.0.1:23333"]
 
 ## Addresses we want to advertise to peers (optional)
 ## These should be reachable externally
-external_addrs = ["tcp://127.0.0.1:23333"]
+external_addrs = ["tcp://127.0.0.1:23333"]

+ 2 - 2
contrib/localnet/taud-four-nodes/taud_full_node3.toml

@@ -7,7 +7,7 @@ datastore = "taud3"
 ## Sets DB logs replay datastore path
 #replay_datastore = "~/.local/share/darkfi/replayed_taud_db"
 
-## Run in replay mode to store Sled DB instructions
+## Run in replay mode to store KVDB instructions
 ## (for eventgraph debugging tool)
 #replay_mode = false
 
@@ -91,4 +91,4 @@ inbound = ["tcp://127.0.0.1:23334"]
 
 ## Addresses we want to advertise to peers (optional)
 ## These should be reachable externally
-external_addrs = ["tcp://127.0.0.1:23334"]
+external_addrs = ["tcp://127.0.0.1:23334"]

+ 2 - 2
contrib/localnet/taud-four-nodes/taud_full_node4.toml

@@ -7,7 +7,7 @@ datastore = "taud4"
 ## Sets DB logs replay datastore path
 #replay_datastore = "~/.local/share/darkfi/replayed_taud_db"
 
-## Run in replay mode to store Sled DB instructions
+## Run in replay mode to store KVDB instructions
 ## (for eventgraph debugging tool)
 #replay_mode = false
 
@@ -91,4 +91,4 @@ external_addrs = ["tcp://127.0.0.1:23335"]
 seeds = ["tcp://127.0.0.1:23331"]
 
 ## Manual peers to connect to
-#peers = []
+#peers = []

+ 1 - 1
doc/src/misc/darkirc/archive-node.md

@@ -52,7 +52,7 @@ with the configuration above—and then retains every new hourly DAG.
 
 To operate an archive containing history from before it was started, bootstrap
 it from a known-good archive datastore while both nodes are stopped. Copy the
-entire DarkIRC datastore, not individual sled trees. Be aware that this
+entire DarkIRC datastore, not individual kvdb trees. Be aware that this
 datastore can also contain local NickServ account secrets; a purpose-built
 archive should not be used for personal IRC accounts. See the
 [operations and recovery notes](darkirc.md#operations-and-recovery) before copying or

+ 1 - 1
doc/src/misc/darkirc/darkirc.md

@@ -221,7 +221,7 @@ local NickServ account secrets. Stop the process and back up the complete
 public DAG state from suitable peers, but it cannot recover local nullifiers
 and trapdoors that were never backed up or exported.
 
-Do not hand-edit RLN counters, static DAG state, or individual sled trees. See
+Do not hand-edit RLN counters, static DAG state, or individual kvdb trees. See
 [Event Graph recovery](../event_graph/recovery.md) and
 [security invariants](../event_graph/security_invariants.md). For connection
 problems, see [network troubleshooting](../network-troubleshooting.md).

+ 4 - 4
doc/src/misc/event_graph/recovery.md

@@ -8,7 +8,7 @@ needed.
 
 ## Data layout
 
-`EventGraph` stores several sled trees in the application's datastore.
+`EventGraph` stores several kvdb trees in the application's datastore.
 For DarkIRC this is the `--datastore` path, defaulting to
 `~/.local/share/darkfi/darkirc/darkirc_db`. This is not the same as the P2P
 `p2p_datastore` path.
@@ -26,7 +26,7 @@ Important trees are:
 | `rln-historical-roots-ordered` | Derived historical root index in canonical static-event order. |
 | `rln-historical-roots-by-value` | Reverse lookup for historical roots. |
 
-DarkIRC also stores local account secrets in the same sled database under
+DarkIRC also stores local account secrets in the same kvdb database under
 `darkirc_account_*` and `darkirc_account_default`. Treat the datastore as
 secret material. A clean resync can rebuild network DAG state, but it will
 not recover local account nullifiers and trapdoors unless they were backed
@@ -34,7 +34,7 @@ up or exported with `NickServ INFO <account_name>`.
 
 ## First response
 
-1. Stop the application. Do not edit or copy sled files while the process
+1. Stop the application. Do not edit or copy kvdb files while the process
    is running.
 2. Copy the whole datastore directory and the config file before changing
    anything.
@@ -136,7 +136,7 @@ Safe response:
   matters.
 - For disposable rotating history, move the datastore aside and let the node
   create a fresh store, then sync from peers.
-- Do not edit individual sled tree files in place. The `<timestamp>` and
+- Do not edit individual kvdb tree files in place. The `<timestamp>` and
   `headers_<timestamp>` trees must agree with each other, and event blobs must
   agree with the event bodies.
 

+ 1 - 1
doc/src/misc/network-troubleshooting.md

@@ -159,7 +159,7 @@ secrets as well as public history.
 Stop DarkIRC, preserve the entire datastore and configuration, and follow the
 [Event Graph recovery guide](event_graph/recovery.md). If a clean resync is
 appropriate, move the old directory aside and start with a new empty path.
-Never copy individual sled trees between datastores.
+Never copy individual kvdb trees between datastores.
 
 ## Network viewers
 

+ 2 - 2
doc/src/testnet/node.md

@@ -424,10 +424,10 @@ folder, and `./drk` command to be replaced by
 To run a node in full debug mode:
 
 ```shell
-$ LOG_TARGETS='!sled,!rustls,!net' ./darkfid -vv | tee /tmp/darkfid.log
+$ LOG_TARGETS='!fjall,!rustls,!net' ./darkfid -vv | tee /tmp/darkfid.log
 ```
 
-The `sled` and `net` targets are very noisy and slow down the node so
+The `fjall` and `net` targets are very noisy and slow down the node so
 we disable those.
 
 We can now view the log, and grep through it.

+ 1 - 1
src/contract/test-harness/src/lib.rs

@@ -105,7 +105,7 @@ pub fn init_logger() {
     // We check this error so we can execute same-file tests in parallel.
     // Otherwise subsequent calls fail to init the logger here.
     if setup_test_logger(
-        &["fjall", "sled"],
+        &["fjall"],
         false,
         Level::Info,
         //Level::Verbose,

+ 1 - 9
src/error.rs

@@ -366,14 +366,6 @@ pub enum Error {
     #[error("Database error: {0}")]
     DatabaseError(String),
 
-    #[cfg(feature = "sled-overlay")]
-    #[error(transparent)]
-    SledError(#[from] sled_overlay::sled::Error),
-
-    #[cfg(feature = "sled-overlay")]
-    #[error(transparent)]
-    SledTransactionError(#[from] sled_overlay::sled::transaction::TransactionError),
-
     #[cfg(feature = "kvdb-overlay")]
     #[error(transparent)]
     KvdbError(#[from] kvdb_overlay::Error),
@@ -423,7 +415,7 @@ pub enum Error {
     #[error("Contract already initialized")]
     ContractAlreadyInitialized,
 
-    #[error("zkas bincode not found in sled database")]
+    #[error("zkas bincode not found in database")]
     ZkasBincodeNotFound,
 
     // ===================

+ 1 - 1
src/net/tests.rs

@@ -49,7 +49,7 @@ use crate::{
 
 fn init_logger() {
     let ignored_targets = [
-        "sled",
+        "fjall",
         "net::protocol_ping",
         "net::channel::subscribe_stop()",
         "net::hosts",

+ 0 - 1
src/serial/Cargo.toml

@@ -22,7 +22,6 @@ pasta_curves = {version = "0.5", optional = true}
 semver = {version = "1", optional = true}
 url = {version = "2", optional = true}
 num-bigint = {version = "0.4", optional = true}
-sled-overlay = {version = "0.1.20", optional = true}
 
 [features]
 default = ["derive", "semver"]

+ 0 - 3
src/serial/src/types.rs

@@ -39,8 +39,5 @@ mod semver;
 #[cfg(feature = "num-bigint")]
 mod bigint;
 
-#[cfg(feature = "sled-overlay")]
-mod sled_overlay;
-
 #[cfg(feature = "kvdb-overlay")]
 mod kvdb_overlay;

+ 0 - 248
src/serial/src/types/sled_overlay.rs

@@ -1,248 +0,0 @@
-/* This file is part of DarkFi (https://dark.fi)
- *
- * Copyright (C) 2020-2026 Dyne.org foundation
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- */
-
-use std::{
-    collections::BTreeMap,
-    io::{Read, Result, Write},
-};
-
-use sled_overlay::{SledDbOverlayStateDiff, SledTreeOverlayStateDiff};
-
-#[cfg(feature = "async")]
-use crate::{AsyncDecodable, AsyncEncodable};
-#[cfg(feature = "async")]
-use async_trait::async_trait;
-#[cfg(feature = "async")]
-use futures_lite::{AsyncRead, AsyncWrite};
-
-use crate::{Decodable, Encodable, VarInt};
-
-impl Encodable for SledTreeOverlayStateDiff {
-    fn encode<S: Write>(&self, s: &mut S) -> Result<usize> {
-        let mut len = 0;
-
-        len += VarInt(self.cache.len() as u64).encode(s)?;
-        for (key, (previous, current)) in self.cache.iter() {
-            len += key.to_vec().encode(s)?;
-            let previous = previous.as_ref().map(|p| p.to_vec());
-            len += previous.encode(s)?;
-            len += current.to_vec().encode(s)?;
-        }
-
-        len += VarInt(self.removed.len() as u64).encode(s)?;
-        for (key, value) in self.removed.iter() {
-            len += key.to_vec().encode(s)?;
-            len += value.to_vec().encode(s)?;
-        }
-
-        Ok(len)
-    }
-}
-
-#[cfg(feature = "async")]
-#[async_trait]
-impl AsyncEncodable for SledTreeOverlayStateDiff {
-    async fn encode_async<S: AsyncWrite + Unpin + Send>(&self, s: &mut S) -> Result<usize> {
-        let mut len = 0;
-
-        len += VarInt(self.cache.len() as u64).encode_async(s).await?;
-        for (key, (previous, current)) in self.cache.iter() {
-            len += key.to_vec().encode_async(s).await?;
-            let previous = previous.as_ref().map(|p| p.to_vec());
-            len += previous.encode_async(s).await?;
-            len += current.to_vec().encode_async(s).await?;
-        }
-
-        len += VarInt(self.removed.len() as u64).encode_async(s).await?;
-        for (key, value) in self.removed.iter() {
-            len += key.to_vec().encode_async(s).await?;
-            len += value.to_vec().encode_async(s).await?;
-        }
-
-        Ok(len)
-    }
-}
-
-impl Decodable for SledTreeOverlayStateDiff {
-    fn decode<D: Read>(d: &mut D) -> Result<Self> {
-        let len = VarInt::decode(d)?.0;
-        let mut cache = BTreeMap::new();
-        for _ in 0..len {
-            let key: Vec<u8> = Decodable::decode(d)?;
-            let (previous, current): (Option<Vec<u8>>, Vec<u8>) = Decodable::decode(d)?;
-            let previous = previous.as_ref().map(|p| p.clone().into());
-            cache.insert(key.into(), (previous, current.into()));
-        }
-
-        let len = VarInt::decode(d)?.0;
-        let mut removed = BTreeMap::new();
-        for _ in 0..len {
-            let key: Vec<u8> = Decodable::decode(d)?;
-            let entry: Vec<u8> = Decodable::decode(d)?;
-            removed.insert(key.into(), entry.into());
-        }
-
-        Ok(Self { cache, removed })
-    }
-}
-
-#[cfg(feature = "async")]
-#[async_trait]
-impl AsyncDecodable for SledTreeOverlayStateDiff {
-    async fn decode_async<D: AsyncRead + Unpin + Send>(d: &mut D) -> Result<Self> {
-        let len = VarInt::decode_async(d).await?.0;
-        let mut cache = BTreeMap::new();
-        for _ in 0..len {
-            let key: Vec<u8> = AsyncDecodable::decode_async(d).await?;
-            let (previous, current): (Option<Vec<u8>>, Vec<u8>) =
-                AsyncDecodable::decode_async(d).await?;
-            let previous = previous.as_ref().map(|p| p.clone().into());
-            cache.insert(key.into(), (previous, current.into()));
-        }
-
-        let len = VarInt::decode_async(d).await?.0;
-        let mut removed = BTreeMap::new();
-        for _ in 0..len {
-            let key: Vec<u8> = AsyncDecodable::decode_async(d).await?;
-            let entry: Vec<u8> = AsyncDecodable::decode_async(d).await?;
-            removed.insert(key.into(), entry.into());
-        }
-
-        Ok(Self { cache, removed })
-    }
-}
-
-impl Encodable for SledDbOverlayStateDiff {
-    fn encode<S: Write>(&self, s: &mut S) -> Result<usize> {
-        let mut len = 0;
-
-        len += VarInt(self.initial_tree_names.len() as u64).encode(s)?;
-        for tree_name in &self.initial_tree_names {
-            len += tree_name.to_vec().encode(s)?;
-        }
-
-        len += VarInt(self.caches.len() as u64).encode(s)?;
-        for (key, (cache, drop)) in self.caches.iter() {
-            len += key.to_vec().encode(s)?;
-            len += cache.encode(s)?;
-            len += drop.encode(s)?;
-        }
-
-        len += VarInt(self.dropped_trees.len() as u64).encode(s)?;
-        for (key, (cache, restore)) in self.dropped_trees.iter() {
-            len += key.to_vec().encode(s)?;
-            len += cache.encode(s)?;
-            len += restore.encode(s)?;
-        }
-
-        Ok(len)
-    }
-}
-
-#[cfg(feature = "async")]
-#[async_trait]
-impl AsyncEncodable for SledDbOverlayStateDiff {
-    async fn encode_async<S: AsyncWrite + Unpin + Send>(&self, s: &mut S) -> Result<usize> {
-        let mut len = 0;
-
-        len += VarInt(self.initial_tree_names.len() as u64).encode_async(s).await?;
-        for tree_name in &self.initial_tree_names {
-            len += tree_name.to_vec().encode_async(s).await?;
-        }
-
-        len += VarInt(self.caches.len() as u64).encode_async(s).await?;
-        for (key, (cache, drop)) in self.caches.iter() {
-            len += key.to_vec().encode_async(s).await?;
-            len += cache.encode_async(s).await?;
-            len += drop.encode_async(s).await?;
-        }
-
-        len += VarInt(self.dropped_trees.len() as u64).encode_async(s).await?;
-        for (key, (cache, restore)) in self.dropped_trees.iter() {
-            len += key.to_vec().encode_async(s).await?;
-            len += cache.encode_async(s).await?;
-            len += restore.encode_async(s).await?;
-        }
-
-        Ok(len)
-    }
-}
-
-impl Decodable for SledDbOverlayStateDiff {
-    fn decode<D: Read>(d: &mut D) -> Result<Self> {
-        let len = VarInt::decode(d)?.0;
-        let mut initial_tree_names = vec![];
-        for _ in 0..len {
-            let initial_tree_name: Vec<u8> = Decodable::decode(d)?;
-            initial_tree_names.push(initial_tree_name.into());
-        }
-
-        let len = VarInt::decode(d)?.0;
-        let mut caches = BTreeMap::new();
-        for _ in 0..len {
-            let key: Vec<u8> = Decodable::decode(d)?;
-            let cache = Decodable::decode(d)?;
-            let drop = Decodable::decode(d)?;
-            caches.insert(key.into(), (cache, drop));
-        }
-
-        let len = VarInt::decode(d)?.0;
-        let mut dropped_trees = BTreeMap::new();
-        for _ in 0..len {
-            let key: Vec<u8> = Decodable::decode(d)?;
-            let cache = Decodable::decode(d)?;
-            let restore = Decodable::decode(d)?;
-            dropped_trees.insert(key.into(), (cache, restore));
-        }
-
-        Ok(Self { initial_tree_names, caches, dropped_trees })
-    }
-}
-
-#[cfg(feature = "async")]
-#[async_trait]
-impl AsyncDecodable for SledDbOverlayStateDiff {
-    async fn decode_async<D: AsyncRead + Unpin + Send>(d: &mut D) -> Result<Self> {
-        let len = VarInt::decode_async(d).await?.0;
-        let mut initial_tree_names = vec![];
-        for _ in 0..len {
-            let initial_tree_name: Vec<u8> = AsyncDecodable::decode_async(d).await?;
-            initial_tree_names.push(initial_tree_name.into());
-        }
-
-        let len = VarInt::decode_async(d).await?.0;
-        let mut caches = BTreeMap::new();
-        for _ in 0..len {
-            let key: Vec<u8> = AsyncDecodable::decode_async(d).await?;
-            let cache = AsyncDecodable::decode_async(d).await?;
-            let drop = AsyncDecodable::decode_async(d).await?;
-            caches.insert(key.into(), (cache, drop));
-        }
-
-        let len = VarInt::decode_async(d).await?.0;
-        let mut dropped_trees = BTreeMap::new();
-        for _ in 0..len {
-            let key: Vec<u8> = AsyncDecodable::decode_async(d).await?;
-            let cache = AsyncDecodable::decode_async(d).await?;
-            let restore = AsyncDecodable::decode_async(d).await?;
-            dropped_trees.insert(key.into(), (cache, restore));
-        }
-
-        Ok(Self { initial_tree_names, caches, dropped_trees })
-    }
-}