7. change(db): Use smaller keys for height and transaction indexes (#3874)

* Increment the database format version

* Update IntoDisk and FromDisk docs

* Rename fixed_byte_len to fixed_disk_byte_len

* Add functions that truncate and extend serialized bytes

* Store heights in 3 bytes on disk

* Update database raw data snapshots for 3-byte heights

* Log an error if we ever get close to the maximum disk height

* Store transaction indexes in 2 bytes on disk

* Update database raw data snapshots for 2-byte transaction indexes

* Make doc comment phrasing consistent

* Replace IntoDiskFixed with fixed constants

* Replace u32 byte length literal with a constant calculation

* Fix off-by-one error in MAX_ON_DISK_HEIGHT

* Add proptest seeds for the MAX_ON_DISK_HEIGHT off-by-one error

* Remove redundant module from a Height type

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
teor 2022-03-22 16:19:50 +10:00 committed by GitHub
parent de59fc6aa0
commit 20429b5efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 294 additions and 236 deletions

View File

@ -0,0 +1,9 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc 5a2d60ee208b2bcd8443786a20b2e1fb4f296eb7881a7d1157f65847a3967db8 # shrinks to mut val = Height(16777216)
cc 898538fff628bfe8898b0f72a3388d962b514d7d95fa9b509be6f70e79482e14 # shrinks to mut val = TransactionLocation { height: Height(16777216), index: TransactionIndex(0) }
cc 009490ee7d01837977aa3f6c08a4a7e8fffde5d4eef31d5f4367271ac77f79f7 # shrinks to mut val = Utxo { output: Output { value: Amount<zebra_chain::amount::NonNegative>(0), lock_script: Script("") }, height: Height(16777216), from_coinbase: false }

View File

@ -18,7 +18,7 @@ pub use zebra_chain::transparent::MIN_TRANSPARENT_COINBASE_MATURITY;
pub const MAX_BLOCK_REORG_HEIGHT: u32 = MIN_TRANSPARENT_COINBASE_MATURITY - 1;
/// The database format version, incremented each time the database format changes.
pub const DATABASE_FORMAT_VERSION: u32 = 13;
pub const DATABASE_FORMAT_VERSION: u32 = 14;
/// The maximum number of blocks to check for NU5 transactions,
/// before we assume we are on a pre-NU5 legacy chain.

View File

@ -17,31 +17,29 @@ mod tests;
pub use block::TransactionLocation;
/// Helper trait for defining the exact format used to store to disk,
/// for each type.
/// Helper type for writing types to disk as raw bytes.
/// Also used to convert key types to raw bytes for disk lookups.
pub trait IntoDisk {
/// The type used to compare a value as a key to other keys stored in a
/// database.
/// The type used to write bytes to disk,
/// and compare a value as a key to on-disk keys.
type Bytes: AsRef<[u8]>;
/// Converts the current type to its disk format in `zs_get()`,
/// without necessarily allocating a new ivec.
/// Converts the current type into serialized raw bytes.
///
/// Used to convert keys to bytes in [`ReadDisk`],
/// and keys and values to bytes in [`WriteDisk`].
///
/// # Panics
///
/// - if the input data doesn't serialize correctly
fn as_bytes(&self) -> Self::Bytes;
}
/// Helper trait for types with fixed-length disk storage.
///
/// This trait must not be implemented for types with variable-length disk storage.
pub trait IntoDiskFixedLen: IntoDisk {
/// Returns the fixed serialized length of `Bytes`.
fn fixed_byte_len() -> usize;
}
/// Helper type for retrieving types from the disk with the correct format.
///
/// The ivec should be correctly encoded by IntoDisk.
/// Helper type for reading types from disk as raw bytes.
pub trait FromDisk: Sized {
/// Function to convert the disk bytes back into the deserialized type.
/// Converts raw disk bytes back into the deserialized type.
///
/// Used to convert keys and values from bytes in [`ReadDisk`].
///
/// # Panics
///
@ -92,18 +90,59 @@ impl IntoDisk for () {
}
}
// Generic serialization length impls
// Serialization Modification Functions
impl<T> IntoDiskFixedLen for T
where
T: IntoDisk,
T::Bytes: Default + IntoIterator + Copy,
{
/// Returns the fixed size of `Bytes`.
///
/// Assumes that `Copy` types are fixed-sized byte arrays.
fn fixed_byte_len() -> usize {
// Bytes is probably a [u8; N]
Self::Bytes::default().into_iter().count()
/// Truncates `mem_bytes` to `disk_len`, by removing zero bytes from the start of the slice.
/// Used to discard unused zero bytes during serialization.
///
/// # Panics
///
/// - if `mem_bytes` is shorter than `disk_len`
/// - if any of the truncated bytes are non-zero
pub fn truncate_zero_be_bytes(mem_bytes: &[u8], disk_len: usize) -> &[u8] {
let truncated_bytes = mem_bytes
.len()
.checked_sub(disk_len)
.expect("unexpected `mem_bytes` length: must be at least `disk_len`");
if truncated_bytes == 0 {
return mem_bytes;
}
let (discarded, truncated) = mem_bytes.split_at(truncated_bytes);
assert!(
discarded.iter().all(|&byte| byte == 0),
"unexpected `mem_bytes` content: non-zero discarded bytes: {:?}\n\
truncated: {:?}",
discarded,
truncated,
);
assert_eq!(truncated.len(), disk_len);
truncated
}
/// Expands `disk_bytes` to `mem_len`, by adding zero bytes at the start of the slice.
/// Used to zero-fill bytes that were discarded during serialization.
///
/// # Panics
///
/// - if `disk_bytes` is longer than `mem_len`
pub fn expand_zero_be_bytes(disk_bytes: &[u8], mem_len: usize) -> Vec<u8> {
let extra_bytes = mem_len
.checked_sub(disk_bytes.len())
.expect("unexpected `disk_bytes` length: must not exceed `mem_len`");
if extra_bytes == 0 {
return disk_bytes.to_vec();
}
let mut expanded = vec![0; extra_bytes];
expanded.extend(disk_bytes);
assert_eq!(expanded.len(), mem_len);
expanded
}

View File

@ -15,21 +15,56 @@ use zebra_chain::{
transaction,
};
use crate::service::finalized_state::disk_format::{FromDisk, IntoDisk, IntoDiskFixedLen};
use crate::service::finalized_state::disk_format::{
expand_zero_be_bytes, truncate_zero_be_bytes, FromDisk, IntoDisk,
};
#[cfg(any(test, feature = "proptest-impl"))]
use proptest_derive::Arbitrary;
/// The maximum value of an on-disk serialized [`Height`].
///
/// This allows us to store [`OutputIndex`]es in 8 bytes,
/// which makes database searches more efficient.
///
/// # Consensus
///
/// This maximum height supports on-disk storage of blocks until around 2050.
///
/// Since Zebra only stores fully verified blocks on disk, blocks with heights
/// larger than this height are rejected before reaching the database.
/// (It would take decades to generate a valid chain this high.)
pub const MAX_ON_DISK_HEIGHT: Height = Height((1 << (HEIGHT_DISK_BYTES * 8)) - 1);
/// [`Height`]s are stored as 3 bytes on disk.
///
/// This reduces database size and increases lookup performance.
pub const HEIGHT_DISK_BYTES: usize = 3;
/// [`TransactionIndex`]es are stored as 2 bytes on disk.
///
/// This reduces database size and increases lookup performance.
pub const TX_INDEX_DISK_BYTES: usize = 2;
// Transaction types
/// A transaction's index in its block.
///
/// # Consensus
///
/// This maximum height supports on-disk storage of transactions in blocks up to ~5 MB.
/// (The current maximum block size is 2 MB.)
///
/// Since Zebra only stores fully verified blocks on disk,
/// blocks larger than this size are rejected before reaching the database.
///
/// (The maximum transaction count is tested by the large generated block serialization tests.)
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize)]
#[cfg_attr(any(test, feature = "proptest-impl"), derive(Arbitrary))]
pub struct TransactionIndex(u32);
pub struct TransactionIndex(u16);
impl TransactionIndex {
/// Create a transaction index from the native index integer type.
#[allow(dead_code)]
/// Creates a transaction index from the native index integer type.
pub fn from_usize(transaction_index: usize) -> TransactionIndex {
TransactionIndex(
transaction_index
@ -38,8 +73,7 @@ impl TransactionIndex {
)
}
/// Return this index as the native index integer type.
#[allow(dead_code)]
/// Returns this index as the native index integer type.
pub fn as_usize(&self) -> usize {
self.0
.try_into()
@ -61,8 +95,7 @@ pub struct TransactionLocation {
}
impl TransactionLocation {
/// Create a transaction location from a block height and index (as the native index integer type).
#[allow(dead_code)]
/// Creates a transaction location from a block height and index (as the native index integer type).
pub fn from_usize(height: Height, transaction_index: usize) -> TransactionLocation {
TransactionLocation {
height,
@ -90,17 +123,25 @@ impl FromDisk for Block {
}
impl IntoDisk for Height {
type Bytes = [u8; 4];
/// Consensus: see the note at [`MAX_ON_DISK_HEIGHT`].
type Bytes = [u8; HEIGHT_DISK_BYTES];
fn as_bytes(&self) -> Self::Bytes {
self.0.to_be_bytes()
let mem_bytes = self.0.to_be_bytes();
let disk_bytes = truncate_zero_be_bytes(&mem_bytes, HEIGHT_DISK_BYTES);
disk_bytes.try_into().unwrap()
}
}
impl FromDisk for Height {
fn from_bytes(bytes: impl AsRef<[u8]>) -> Self {
let array = bytes.as_ref().try_into().unwrap();
Height(u32::from_be_bytes(array))
let mem_len = u32::BITS / 8;
let mem_len = mem_len.try_into().unwrap();
let mem_bytes = expand_zero_be_bytes(bytes.as_ref(), mem_len);
Height(u32::from_be_bytes(mem_bytes.try_into().unwrap()))
}
}
@ -122,7 +163,7 @@ impl FromDisk for block::Hash {
// Transaction trait impls
impl IntoDisk for TransactionIndex {
type Bytes = [u8; 4];
type Bytes = [u8; TX_INDEX_DISK_BYTES];
fn as_bytes(&self) -> Self::Bytes {
self.0.to_be_bytes()
@ -131,16 +172,16 @@ impl IntoDisk for TransactionIndex {
impl FromDisk for TransactionIndex {
fn from_bytes(disk_bytes: impl AsRef<[u8]>) -> Self {
TransactionIndex(u32::from_be_bytes(disk_bytes.as_ref().try_into().unwrap()))
TransactionIndex(u16::from_be_bytes(disk_bytes.as_ref().try_into().unwrap()))
}
}
impl IntoDisk for TransactionLocation {
type Bytes = [u8; 8];
type Bytes = [u8; HEIGHT_DISK_BYTES + TX_INDEX_DISK_BYTES];
fn as_bytes(&self) -> Self::Bytes {
let height_bytes = self.height.as_bytes();
let index_bytes = self.index.as_bytes();
let height_bytes = self.height.as_bytes().to_vec();
let index_bytes = self.index.as_bytes().to_vec();
[height_bytes, index_bytes].concat().try_into().unwrap()
}
@ -148,9 +189,7 @@ impl IntoDisk for TransactionLocation {
impl FromDisk for TransactionLocation {
fn from_bytes(disk_bytes: impl AsRef<[u8]>) -> Self {
let height_len = Height::fixed_byte_len();
let (height_bytes, index_bytes) = disk_bytes.as_ref().split_at(height_len);
let (height_bytes, index_bytes) = disk_bytes.as_ref().split_at(HEIGHT_DISK_BYTES);
let height = Height::from_bytes(height_bytes);
let index = TransactionIndex::from_bytes(index_bytes);

View File

@ -4,26 +4,41 @@ use proptest::{arbitrary::any, prelude::*};
use zebra_chain::{
amount::NonNegative,
block::{self, Block},
block::{self, Block, Height},
transparent,
value_balance::ValueBalance,
};
use crate::service::finalized_state::{
arbitrary::assert_value_properties,
disk_format::{transparent::OutputLocation, TransactionLocation},
disk_format::{block::MAX_ON_DISK_HEIGHT, transparent::OutputLocation, TransactionLocation},
};
#[test]
fn roundtrip_block_height() {
zebra_test::init();
proptest!(|(val in any::<block::Height>())| assert_value_properties(val));
proptest!(
|(mut val in any::<Height>())| {
// Limit the random height to the valid on-disk range.
// Blocks outside this range are rejected before they reach the state.
// (It would take decades to generate a valid chain this high.)
val = val.clamp(Height(0), MAX_ON_DISK_HEIGHT);
assert_value_properties(val)
}
);
}
#[test]
fn roundtrip_transaction_location() {
zebra_test::init();
proptest!(|(val in any::<TransactionLocation>())| assert_value_properties(val));
proptest!(
|(mut val in any::<TransactionLocation>())| {
val.height = val.height.clamp(Height(0), MAX_ON_DISK_HEIGHT);
assert_value_properties(val)
}
);
}
#[test]
@ -49,7 +64,12 @@ fn roundtrip_block() {
fn roundtrip_transparent_output() {
zebra_test::init();
proptest!(|(val in any::<transparent::Utxo>())| assert_value_properties(val));
proptest!(
|(mut val in any::<transparent::Utxo>())| {
val.height = val.height.clamp(Height(0), MAX_ON_DISK_HEIGHT);
assert_value_properties(val)
}
);
}
#[test]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce1570101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff071f0104455a6361736830623963346565663862376363343137656535303031653335303039383462366665613335363833613763616331343161303433633432303634383335643334ffffffff010000000000000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce1570101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff071f0104455a6361736830623963346565663862376363343137656535303031653335303039383462366665613335363833613763616331343161303433633432303634383335643334ffffffff010000000000000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
),
KV(
k: "00000001",
k: "000001",
v: "0400000008ce3d9731b000c08338455c8a4a6bd05da16e26b11daa1b917184ece80f04000946edb9c083c9942d92305444527765fad789c438c717783276a9f7fbf61b850000000000000000000000000000000000000000000000000000000000000000ac7a1358ffff071f7534e8cf161ff2e49d54bdb3bfbcde8cdbf2fc5963c9ec7d86aed4a67e975790fd4005002b2ee0d2f5d0c1ebf5a265b6f5b428f2fdc9aaea07078a6c5cab4f1bbfcd56489863deae6ea3fd8d3d0762e8e5295ff2670c9e90d8e8c68a54a40927e82a65e1d44ced20d835818e172d7b7f5ffe0245d0c3860a3f11af5658d68b6a7253b4684ffef5242fefa77a0bfc3437e8d94df9dc57510f5a128e676dd9ddf23f0ef75b460090f507499585541ab53a470c547ea02723d3a979930941157792c4362e42d3b9faca342a5c05a56909b046b5e92e2870fca7c932ae2c2fdd97d75b6e0ecb501701c1250246093c73efc5ec2838aeb80b59577741aa5ccdf4a631b79f70fc419e28714fa22108d991c29052b2f5f72294c355b57504369313470ecdd8e0ae97fc48e243a38c2ee7315bb05b7de9602047e97449c81e46746513221738dc729d7077a1771cea858865d85261e71e82003ccfbba2416358f023251206d6ef4c5596bc35b2b5bce3e9351798aa2c9904723034e5815c7512d260cc957df5db6adf9ed7272483312d1e68c60955a944e713355089876a704aef06359238f6de5a618f7bd0b4552ba72d05a6165e582f62d55ff2e1b76991971689ba3bee16a520fd85380a6e5a31de4dd4654d561101ce0ca390862d5774921eae2c284008692e9e08562144e8aa1f399a9d3fab0c4559c1f12bc945e626f7a89668613e8829767f4116ee9a4f832cf7c3ade3a7aba8cb04de39edd94d0d05093ed642adf9fbd9d373a80832ffd1c62034e4341546b3515f0e42e6d8570393c6754be5cdb7753b4709527d3f164aebf3d315934f7b3736a1b31052f6cc5699758950331163b3df05b9772e9bf99c8c77f8960e10a15edb06200106f45742d740c422c86b7e4f5a52d3732aa79ee54cfc92f76e03c268ae226477c19924e733caf95b8f350233a5312f4ed349d3ad76f032358f83a6d0d6f83b2a456742aad7f3e615fa72286300f0ea1c9793831ef3a5a4ae08640a6e32f53d1cba0be284b25e923d0d110ba227e54725632efcbbe17c05a9cde976504f6aece0c461b562cfae1b85d5f6782ee27b3e332ac0775f681682ce524b32889f1dc4231226f1aada0703beaf8d41732c9647a0a940a86f8a1be7f239c44fcaa7ed7a055506bdbe1df848f9e047226bee1b6d788a03f6e352eead99b419cfc41741942dbeb7a5c55788d5a3e636d8aab7b36b4db71d16700373bbc1cdeba8f9b1db10bf39a621bc737ea4f4e333698d6e09b51ac7a97fb6fd117ccad1d6b6b3a7451699d5bfe448650396d7b58867b3b0872be13ad0b43da267df0ad77025155f04e20c56d6a9befb3e9c7d23b82cbf3a534295ebda540682cc81be9273781b92519c858f9c25294fbacf75c3b3c15bda6d36de1c83336f93e96910dbdcb190d6ef123c98565ff6df1e903f57d4e4df167ba6b829d6d9713eb2126b0cf869940204137babcc6a1b7cb2f0b94318a7460e5d1a605c249bd2e72123ebad332332c18adcb285ed8874dbde084ebcd4f744465350d57110f037fffed1569d642c258749e65b0d13e117eaa37014a769b5ab479b7c77178880e77099f999abe712e543dbbf626ca9bcfddc42ff2f109d21c8bd464894e55ae504fdf81e1a7694180225da7dac8879abd1036cf26bb50532b8cf138b337a1a1bd1a43f8dd70b7399e2690c8e7a5a1fe099026b8f2a6f65fc0dbedda15ba65e0abd66c7176fb426980549892b4817de78e345a7aeab05744c3def4a2f283b4255b02c91c1af7354a368c67a11703c642a385c7453131ce3a78b24c5e22ab7e136a38498ce82082181884418cb4d6c2920f258a3ad20cfbe7104af1c6c6cb5e58bf29a9901721ad19c0a260cd09a3a772443a45aea4a5c439a95834ef5dc2e26343278947b7b796f796ae9bcadb29e2899a1d7313e6f7bfb6f8b0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100ffffffff0250c30000000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875acd43000000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a8700000000",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce1570101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff071f0104455a6361736830623963346565663862376363343137656535303031653335303039383462366665613335363833613763616331343161303433633432303634383335643334ffffffff010000000000000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
),
KV(
k: "00000001",
k: "000001",
v: "0400000008ce3d9731b000c08338455c8a4a6bd05da16e26b11daa1b917184ece80f04000946edb9c083c9942d92305444527765fad789c438c717783276a9f7fbf61b850000000000000000000000000000000000000000000000000000000000000000ac7a1358ffff071f7534e8cf161ff2e49d54bdb3bfbcde8cdbf2fc5963c9ec7d86aed4a67e975790fd4005002b2ee0d2f5d0c1ebf5a265b6f5b428f2fdc9aaea07078a6c5cab4f1bbfcd56489863deae6ea3fd8d3d0762e8e5295ff2670c9e90d8e8c68a54a40927e82a65e1d44ced20d835818e172d7b7f5ffe0245d0c3860a3f11af5658d68b6a7253b4684ffef5242fefa77a0bfc3437e8d94df9dc57510f5a128e676dd9ddf23f0ef75b460090f507499585541ab53a470c547ea02723d3a979930941157792c4362e42d3b9faca342a5c05a56909b046b5e92e2870fca7c932ae2c2fdd97d75b6e0ecb501701c1250246093c73efc5ec2838aeb80b59577741aa5ccdf4a631b79f70fc419e28714fa22108d991c29052b2f5f72294c355b57504369313470ecdd8e0ae97fc48e243a38c2ee7315bb05b7de9602047e97449c81e46746513221738dc729d7077a1771cea858865d85261e71e82003ccfbba2416358f023251206d6ef4c5596bc35b2b5bce3e9351798aa2c9904723034e5815c7512d260cc957df5db6adf9ed7272483312d1e68c60955a944e713355089876a704aef06359238f6de5a618f7bd0b4552ba72d05a6165e582f62d55ff2e1b76991971689ba3bee16a520fd85380a6e5a31de4dd4654d561101ce0ca390862d5774921eae2c284008692e9e08562144e8aa1f399a9d3fab0c4559c1f12bc945e626f7a89668613e8829767f4116ee9a4f832cf7c3ade3a7aba8cb04de39edd94d0d05093ed642adf9fbd9d373a80832ffd1c62034e4341546b3515f0e42e6d8570393c6754be5cdb7753b4709527d3f164aebf3d315934f7b3736a1b31052f6cc5699758950331163b3df05b9772e9bf99c8c77f8960e10a15edb06200106f45742d740c422c86b7e4f5a52d3732aa79ee54cfc92f76e03c268ae226477c19924e733caf95b8f350233a5312f4ed349d3ad76f032358f83a6d0d6f83b2a456742aad7f3e615fa72286300f0ea1c9793831ef3a5a4ae08640a6e32f53d1cba0be284b25e923d0d110ba227e54725632efcbbe17c05a9cde976504f6aece0c461b562cfae1b85d5f6782ee27b3e332ac0775f681682ce524b32889f1dc4231226f1aada0703beaf8d41732c9647a0a940a86f8a1be7f239c44fcaa7ed7a055506bdbe1df848f9e047226bee1b6d788a03f6e352eead99b419cfc41741942dbeb7a5c55788d5a3e636d8aab7b36b4db71d16700373bbc1cdeba8f9b1db10bf39a621bc737ea4f4e333698d6e09b51ac7a97fb6fd117ccad1d6b6b3a7451699d5bfe448650396d7b58867b3b0872be13ad0b43da267df0ad77025155f04e20c56d6a9befb3e9c7d23b82cbf3a534295ebda540682cc81be9273781b92519c858f9c25294fbacf75c3b3c15bda6d36de1c83336f93e96910dbdcb190d6ef123c98565ff6df1e903f57d4e4df167ba6b829d6d9713eb2126b0cf869940204137babcc6a1b7cb2f0b94318a7460e5d1a605c249bd2e72123ebad332332c18adcb285ed8874dbde084ebcd4f744465350d57110f037fffed1569d642c258749e65b0d13e117eaa37014a769b5ab479b7c77178880e77099f999abe712e543dbbf626ca9bcfddc42ff2f109d21c8bd464894e55ae504fdf81e1a7694180225da7dac8879abd1036cf26bb50532b8cf138b337a1a1bd1a43f8dd70b7399e2690c8e7a5a1fe099026b8f2a6f65fc0dbedda15ba65e0abd66c7176fb426980549892b4817de78e345a7aeab05744c3def4a2f283b4255b02c91c1af7354a368c67a11703c642a385c7453131ce3a78b24c5e22ab7e136a38498ce82082181884418cb4d6c2920f258a3ad20cfbe7104af1c6c6cb5e58bf29a9901721ad19c0a260cd09a3a772443a45aea4a5c439a95834ef5dc2e26343278947b7b796f796ae9bcadb29e2899a1d7313e6f7bfb6f8b0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100ffffffff0250c30000000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875acd43000000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a8700000000",
),
KV(
k: "00000002",
k: "000002",
v: "040000008392336da29773c56b1649ab555156ceb7e700ad7c230ea7a4571c7e22bc0700f4b084a7c2fc5a5aa2985f2bcb1d4a9a65562a589d628b0d869c5f1c8dd074890000000000000000000000000000000000000000000000000000000000000000ca7a1358ffff071fa5556cd346010000000000000000000000000000000000000000000000000002fd4005005605e4490c2e7fc1acf199d7401e18ab8d2be4c843103a7ebdd34046d5514559e6ecbe29c00b9adf6f1aa49f1d63b9c20fd9bca4d9bbb381cb82f59cee9f387deb34ec4fd6b1e12f656a554bc21db88bd1560a033e64099c0bef439cdd6055aaa4f79c360ad37d1f1df1fbd35214e17fc5a0b3c0d272b1e693d6ba9e5e0ae71c6ff58545776838c18b756bf98a83a6b9739b4dec356117b2b227f6f6ea3f04fd854aadf27b40b302d3fa50719aa02f99c2003b51eab8c64cfd145117054dcadb604ba65a8854a095bd9f02884a65225baf0547a7ee44882b11343d40b1a6511cbc4db1d2fd840a8cd63610d29c47bd5c920fe13c349d1044185cd40854f8e60a212d59e1fe281e8bd1343a682e95f3ea23fb5ca83f9913bbcb11232ffd7165ea4a475273df1f3bb53cb721548b28f772acf56060da5d26fab50c4f8b87781bf28843bea805340531a61f002b5aad9a0427b597af1a08659f1a7b4b6d69d53b13191cf35512bc3521359dda47911112d06ae5410281d918bf53049f8295f067f2b3794a90cc15358e294c6cbd7896108d7c897e4bf61aa72451a280cfce72e0515b8dc510a52743b7615b25ba2f13419d562f6148fa36132622953c0fb74ea0b4870f86ccc1ece9661b29516a2226ea16b7100dbeb718a674eedbbe9d23ab02fe1c634234f3c1275ae9d7f74c754c66dec0af7331fc1407075a06cba62098a9be09d24889e7d0a6cf77d875131fe1278e6fdea2bfd9423903e1cb4502edcef971c60b064d4d8a9703ff324574e3d0535a59ab091355185499545be1baffddf6c2b654e5c30e7e1291763fd70896217d91d876a9be914a8472fa292ea3cfdc4be84f4c645f62d8ccff990ac4f5c84e0775b147d1532e2d4f3a8fb92fda899280a3e42f2b927dbef872ec6058254eb20e2770efde7c57905e7741321e833533e0006344a4c6deb9a78e8496de1ae1464ef8367ae97714700e76658e2390cb9702d1413b333d7f04fb89dd09cefeb34e0ead616cd5d352a2f348758e0f5fc4220c6a0693acc90b8dcd7a372ecb688d86356c151d9703576af8e904adea9941d1a6296774ba62b4dae7bf0a078f740af040c584f0245ed2ffa351f0b550c8b80e192ba1a75eb40fc42d67b722ea04ea947ed53e831fe057153a8bd6897ddcd43cb558d2766fb05640ed0c1d14eae0739b11ec07e34f3ea6acbd9f807b9ea6476bda5964a9fca1819c854680f75857e57fbf3fc50e3f5b0d25cadadcd9b3428b85b70b95080c9423a836e9e9e2cbd485075a29452d65acf3d5762111d70a0fd389ac7214b96b11eb14ae48ff1e4930ea50d8261472fd8d04877af717b4d463c0d9a6cf397b5b91fb1a898b329c4b46b8c350e3c0122e186bc393fe6d361e117963d38e44e0ccf1c45f33440aaebd8f99ad7b019c6411bb070178fb6b76e085e3bdae4c883f1f4112e7db91c519c48769fe96f56350cc8687679747730f0aad3bc58b78f87d162104beee449e55eab45558241f32cb5a0f30fea0f38632adfc8a2b7292ff89641581bb6e0111af26dad9199596ce8d432e6f7d0a7415aacc473acfb8af68c9c6ef8b60c535da095cd3a02598fd82fe20481dc87bf6ed25fb95633dc7ff8bcf3f81c323546084170e567536b5c4ce9392ae1dc1f201d732134597e3c9353416fa40ff8f2628815e9b980f27a9c05adefa779ef1a35fdfe6423e9f671677311971bd91d9aeb6adf4c45769d07df7a24955f4082730fb0d3f6467472f75add86b827a7b664005931130029553fdb62ad9ffdb64b44701c0d94e7c5f5ba2340e641d9e34737e29b47e619659f458a161648c9fb81dddbcc73f1eebc92fd7f7b70356635f0de19912d82c9a978c2750aacbfbeee3ab62e96f7df7ce918fa30101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025200ffffffff02a0860100000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875aca86100000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a8700000000",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac40000000000000000000000000000000000000000000000000000000000000000a11e1358ffff07200600000000000000000000000000000000000000000000000000000000000000fd400500a6a51259c3f6732481e2d035197218b7a69504461d04335503cd69759b2d02bd2b53a9653f42cb33c608511c953673fa9da76170958115fe92157ad3bb5720d927f18e09459bf5c6072973e143e20f9bdf0584058c96b7c2234c7565f100d5eea083ba5d3dbaff9f0681799a113e7beff4a611d2b49590563109962baa149b628aae869af791f2f70bb041bd7ebfa658570917f6654a142b05e7ec0289a4f46470be7be5f693b90173eaaa6e84907170f32602204f1f4e1c04b1830116ffd0c54f0b1caa9a5698357bd8aa1f5ac8fc93b405265d824ba0e49f69dab5446653927298e6b7bdc61ee86ff31c07bde86331b4e500d42e4e50417e285502684b7966184505b885b42819a88469d1e9cf55072d7f3510f85580db689302eab377e4e11b14a91fdd0df7627efc048934f0aff8e7eb77eb17b3a95de13678004f2512293891d8baf8dde0ef69be520a58bbd6038ce899c9594cf3e30b8c3d9c7ecc832d4c19a6212747b50724e6f70f6451f78fd27b58ce43ca33b1641304a916186cfbe7dbca224f55d08530ba851e4df22baf7ab7078e9cbea46c0798b35a750f54103b0cdd08c81a6505c4932f6bfbd492a9fced31d54e98b6370d4c96600552fcf5b37780ed18c8787d03200963600db297a8f05dfa551321d17b9917edadcda51e274830749d133ad226f8bb6b94f13b4f77e67b35b71f52112ce9ba5da706ad9573584a2570a4ff25d29ab9761a06bdcf2c33638bf9baf2054825037881c14adf3816ba0cbd0fca689aad3ce16f2fe362c98f48134a9221765d939f0b49677d1c2447e56b46859f1810e2cf23e82a53e0d44f34dae932581b3b7f49eaec59af872cf9de757a964f7b33d143a36c270189508fcafe19398e4d2966948164d40556b05b7ff532f66f5d1edc41334ef742f78221dfe0c7ae2275bb3f24c89ae35f00afeea4e6ed187b866b209dc6e83b660593fce7c40e143beb07ac86c56f39e895385924667efe3a3f031938753c7764a2dbeb0a643fd359c46e614873fd0424e435fa7fac083b9a41a9d6bf7e284eee537ea7c50dd239f359941a43dc982745184bf3ee31a8dc850316aa9c6b66d6985acee814373be3458550659e1a06287c3b3b76a185c5cb93e38c1eebcf34ff072894b6430aed8d34122dafd925c46a515cca79b0269c92b301890ca6b0dc8b679cdac0f23318c105de73d7a46d16d2dad988d49c22e9963c117960bdc70ef0db6b091cf09445a516176b7f6d58ec29539166cc8a38bbff387acefffab2ea5faad0e8bb70625716ef0edf61940733c25993ea3de9f0be23d36e7cb8da10505f9dc426cd0e6e5b173ab4fff8c37e1f1fb56d1ea372013d075e0934c6919393cfc21395eea20718fad03542a4162a9ded66c814ad8320b2d7c2da3ecaf206da34c502db2096d1c46699a91dd1c432f019ad434e2c1ce507f91104f66f491fed37b225b8e0b2888c37276cfa0468fc13b8d593fd9a2675f0f5b20b8a15f8fa7558176a530d6865738ddb25d3426dab905221681cf9da0e0200eea5b2eba3ad3a5237d2a391f9074bf1779a2005cee43eec2b058511532635e0fea61664f531ac2b356f40db5c5d275a4cf5c82d468976455af4e3362cc8f71aa95e71d394aff3ead6f7101279f95bcd8a0fedce1d21cb3c9f6dd3b182fce0db5d6712981b651f29178a24119968b14783cafa713bc5f2a65205a42e4ce9dc7ba462bdb1f3e4553afc15f5f39998fdb53e7e231e3e520a46943734a007c2daa1eda9f495791657eefcac5c32833936e568d06187857ed04d7b97167ae207c5c5ae54e528c36016a984235e9c5b2f0718d7b3aa93c7822ccc772580b6599671b3c02ece8a21399abd33cfd3028790133167d0a97e7de53dc8ff0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff071f0104455a6361736830623963346565663862376363343137656535303031653335303039383462366665613335363833613763616331343161303433633432303634383335643334ffffffff010000000000000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac40000000000000000000000000000000000000000000000000000000000000000a11e1358ffff07200600000000000000000000000000000000000000000000000000000000000000fd400500a6a51259c3f6732481e2d035197218b7a69504461d04335503cd69759b2d02bd2b53a9653f42cb33c608511c953673fa9da76170958115fe92157ad3bb5720d927f18e09459bf5c6072973e143e20f9bdf0584058c96b7c2234c7565f100d5eea083ba5d3dbaff9f0681799a113e7beff4a611d2b49590563109962baa149b628aae869af791f2f70bb041bd7ebfa658570917f6654a142b05e7ec0289a4f46470be7be5f693b90173eaaa6e84907170f32602204f1f4e1c04b1830116ffd0c54f0b1caa9a5698357bd8aa1f5ac8fc93b405265d824ba0e49f69dab5446653927298e6b7bdc61ee86ff31c07bde86331b4e500d42e4e50417e285502684b7966184505b885b42819a88469d1e9cf55072d7f3510f85580db689302eab377e4e11b14a91fdd0df7627efc048934f0aff8e7eb77eb17b3a95de13678004f2512293891d8baf8dde0ef69be520a58bbd6038ce899c9594cf3e30b8c3d9c7ecc832d4c19a6212747b50724e6f70f6451f78fd27b58ce43ca33b1641304a916186cfbe7dbca224f55d08530ba851e4df22baf7ab7078e9cbea46c0798b35a750f54103b0cdd08c81a6505c4932f6bfbd492a9fced31d54e98b6370d4c96600552fcf5b37780ed18c8787d03200963600db297a8f05dfa551321d17b9917edadcda51e274830749d133ad226f8bb6b94f13b4f77e67b35b71f52112ce9ba5da706ad9573584a2570a4ff25d29ab9761a06bdcf2c33638bf9baf2054825037881c14adf3816ba0cbd0fca689aad3ce16f2fe362c98f48134a9221765d939f0b49677d1c2447e56b46859f1810e2cf23e82a53e0d44f34dae932581b3b7f49eaec59af872cf9de757a964f7b33d143a36c270189508fcafe19398e4d2966948164d40556b05b7ff532f66f5d1edc41334ef742f78221dfe0c7ae2275bb3f24c89ae35f00afeea4e6ed187b866b209dc6e83b660593fce7c40e143beb07ac86c56f39e895385924667efe3a3f031938753c7764a2dbeb0a643fd359c46e614873fd0424e435fa7fac083b9a41a9d6bf7e284eee537ea7c50dd239f359941a43dc982745184bf3ee31a8dc850316aa9c6b66d6985acee814373be3458550659e1a06287c3b3b76a185c5cb93e38c1eebcf34ff072894b6430aed8d34122dafd925c46a515cca79b0269c92b301890ca6b0dc8b679cdac0f23318c105de73d7a46d16d2dad988d49c22e9963c117960bdc70ef0db6b091cf09445a516176b7f6d58ec29539166cc8a38bbff387acefffab2ea5faad0e8bb70625716ef0edf61940733c25993ea3de9f0be23d36e7cb8da10505f9dc426cd0e6e5b173ab4fff8c37e1f1fb56d1ea372013d075e0934c6919393cfc21395eea20718fad03542a4162a9ded66c814ad8320b2d7c2da3ecaf206da34c502db2096d1c46699a91dd1c432f019ad434e2c1ce507f91104f66f491fed37b225b8e0b2888c37276cfa0468fc13b8d593fd9a2675f0f5b20b8a15f8fa7558176a530d6865738ddb25d3426dab905221681cf9da0e0200eea5b2eba3ad3a5237d2a391f9074bf1779a2005cee43eec2b058511532635e0fea61664f531ac2b356f40db5c5d275a4cf5c82d468976455af4e3362cc8f71aa95e71d394aff3ead6f7101279f95bcd8a0fedce1d21cb3c9f6dd3b182fce0db5d6712981b651f29178a24119968b14783cafa713bc5f2a65205a42e4ce9dc7ba462bdb1f3e4553afc15f5f39998fdb53e7e231e3e520a46943734a007c2daa1eda9f495791657eefcac5c32833936e568d06187857ed04d7b97167ae207c5c5ae54e528c36016a984235e9c5b2f0718d7b3aa93c7822ccc772580b6599671b3c02ece8a21399abd33cfd3028790133167d0a97e7de53dc8ff0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff071f0104455a6361736830623963346565663862376363343137656535303031653335303039383462366665613335363833613763616331343161303433633432303634383335643334ffffffff010000000000000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
),
KV(
k: "00000001",
k: "000001",
v: "04000000382c4a332661c7ed0671f32a34d724619f086c61873bce7c99859dd9920aa605755f7c7d27a811596e9fae6dd30ca45be86e901d499909de35b6ff1f699f7ef30000000000000000000000000000000000000000000000000000000000000000e9851358ffff0720000056c2264c31261d597c6fcea7c5e00160cf6be1cd89ca96a0389473e50000fd40050053f4438864bc5d6dfc009d4bba545ac5e5feaaf46f9455b975b02115f842a966e26517ce678f1c074d09cc8d0049a190859eb505af5f3e760312fbbe54da115db2bc03c96408f39b679891790b539d2d9d17a801dc6af9af14ca3f6ba060edce2a1dd45aa45f11fe37dbaf1eb2647ae7c393f6680c3d5d7e53687e34530f48edf58924a04d3e0231c150b1c8218998f674bc171edd222bcb4ac4ba4ea52d7baa86399f371d5284043e1e166f9069dd0f2904ff94c7922a70fa7c660e0553cc40a20d9ee08eb3f47278485801ddae9c270411360773f0b74e03db2d92c50952c9bd4924bbca2a260e1235e99df51fe71e75744232f2d641ef94f394110a5ad05f51a057e4cb515b92c16cb1404a8cdcc43d4a4bb2caa54ca35dccf41aa7d832da65123b7029223c46ed2a13387d598d445435d3cb32fdad9e27672903864c90d86353b162033078327b5b7aaffc89b40096ae004f2d5c6bd2c99188574348518db66e9b6020f93f12ee1c06f7b00fe346fefceaffb1da9e3cdf08285057f549733eb10825737fcd1431bfdfb155f323f24e95a869212baacf445b30f2670206645779110e6547d5da90a5f2fe5151da911d5ecd5a833023661d1356b6c395d85968947678d53efd4db7b06f23b21125e74492644277ea0c1131b80d6a4e3e8093b82332556fbb3255a55ac3f0b7e4844c0e12bf577c37fd02323ae5ef4781772ed501d63b568032a3d31576c5104a48c01ac54f715286932351a8adc8cf2467a84a0572e99f366ee00f82c3735545fd4bb941d591ce70070425a81304272db89887949bc7dd8236bb7e82190f9815da938cd6e8fec7660e91354326a7a9bfe38120e97997fca3c289d54513ed00286c2b825fbe84f91a39528f335674b5e957425a6edfdd00f2feb2c2df575616197998c1e964e069875d4d934f419a9b02b100848d023b76d47bd4e284c3895ef9227a40d8ea8826e86c7155d6aa95b8f9175812523a32cd611efc700688e03f7c245c5bff01718281b5d75cefe8318b2c08962236b14a0bf79534c203df735fd9cced97cbae07c2b4ee9cda8c9993f3f6277ff3fec261fb94d3961c4befe4b0893dcf67b312c7d8d6ff7adc8539cb2b1d3534fccf109efddd07a9f1e77b94ab1e505b164221dca1c34621b1e9d234c31a032a401267d95f65b800d579a2482638dfeade804149c81e95d7ef5510ac0b6212231506b1c635a2e1d2f0c9712989f9f246762fadb4c55c20f707dcc0e510a33e9465fc5d5bdbfa524dab0d7a1c6a1baaa36869cf542aa2257c5c44ef07547a570343442c6091e13bc04d559dc0e6db5b001861914bf956816edce2a86b274bd97f27e2dbb08608c16a3e5d8595952faa91fb162d7fa6a7a47e849a1ad8fab3ba620ee3295a04fe13e5fb655ac92ae60d01020b8999526af8d56b28733e69c9ffb285de27c61edc0bf62261ac0787eff347d0fcd62257301ede9603106ea41650a3e3119bd5c4e86a7f6a3f00934f3a545f7f21d41699f3e35d38cf925a8bdaf2bf7eedea11c31c3d8bf6c527c77c6378281cdf02211a58fa5e46d28d7e7c5fb79d69b31703fd752395da115845952cf99aaeb2155c2ab951a69f67d938f223185567e52cfa3e57b62c790bf78674c4b02c12b7d3225fe8f705b408ba11c24245b3924482e2f3480994461b550641a88cd941d371139f3498afacdcba1249631402b20695760eaada5376e68df0e45139c410700effc9420dc3726515e7fcb3f349320f30511451964bd9b6530682efec65910ceb548aa2ab05ac3309e803161697213631ae8e13cc7d223ac28446c1bf94a19a8782ac16ff57df7ee4f10fb6e488c02c68d6b6dee6987f6d2c39227da366c59f54ff67e312ca530e7c467c3dc80101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0250c30000000000002321025229e1240a21004cf8338db05679fa34753706e84f6aebba086ba04317fd8f99acd43000000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c6428700000000",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac40000000000000000000000000000000000000000000000000000000000000000a11e1358ffff07200600000000000000000000000000000000000000000000000000000000000000fd400500a6a51259c3f6732481e2d035197218b7a69504461d04335503cd69759b2d02bd2b53a9653f42cb33c608511c953673fa9da76170958115fe92157ad3bb5720d927f18e09459bf5c6072973e143e20f9bdf0584058c96b7c2234c7565f100d5eea083ba5d3dbaff9f0681799a113e7beff4a611d2b49590563109962baa149b628aae869af791f2f70bb041bd7ebfa658570917f6654a142b05e7ec0289a4f46470be7be5f693b90173eaaa6e84907170f32602204f1f4e1c04b1830116ffd0c54f0b1caa9a5698357bd8aa1f5ac8fc93b405265d824ba0e49f69dab5446653927298e6b7bdc61ee86ff31c07bde86331b4e500d42e4e50417e285502684b7966184505b885b42819a88469d1e9cf55072d7f3510f85580db689302eab377e4e11b14a91fdd0df7627efc048934f0aff8e7eb77eb17b3a95de13678004f2512293891d8baf8dde0ef69be520a58bbd6038ce899c9594cf3e30b8c3d9c7ecc832d4c19a6212747b50724e6f70f6451f78fd27b58ce43ca33b1641304a916186cfbe7dbca224f55d08530ba851e4df22baf7ab7078e9cbea46c0798b35a750f54103b0cdd08c81a6505c4932f6bfbd492a9fced31d54e98b6370d4c96600552fcf5b37780ed18c8787d03200963600db297a8f05dfa551321d17b9917edadcda51e274830749d133ad226f8bb6b94f13b4f77e67b35b71f52112ce9ba5da706ad9573584a2570a4ff25d29ab9761a06bdcf2c33638bf9baf2054825037881c14adf3816ba0cbd0fca689aad3ce16f2fe362c98f48134a9221765d939f0b49677d1c2447e56b46859f1810e2cf23e82a53e0d44f34dae932581b3b7f49eaec59af872cf9de757a964f7b33d143a36c270189508fcafe19398e4d2966948164d40556b05b7ff532f66f5d1edc41334ef742f78221dfe0c7ae2275bb3f24c89ae35f00afeea4e6ed187b866b209dc6e83b660593fce7c40e143beb07ac86c56f39e895385924667efe3a3f031938753c7764a2dbeb0a643fd359c46e614873fd0424e435fa7fac083b9a41a9d6bf7e284eee537ea7c50dd239f359941a43dc982745184bf3ee31a8dc850316aa9c6b66d6985acee814373be3458550659e1a06287c3b3b76a185c5cb93e38c1eebcf34ff072894b6430aed8d34122dafd925c46a515cca79b0269c92b301890ca6b0dc8b679cdac0f23318c105de73d7a46d16d2dad988d49c22e9963c117960bdc70ef0db6b091cf09445a516176b7f6d58ec29539166cc8a38bbff387acefffab2ea5faad0e8bb70625716ef0edf61940733c25993ea3de9f0be23d36e7cb8da10505f9dc426cd0e6e5b173ab4fff8c37e1f1fb56d1ea372013d075e0934c6919393cfc21395eea20718fad03542a4162a9ded66c814ad8320b2d7c2da3ecaf206da34c502db2096d1c46699a91dd1c432f019ad434e2c1ce507f91104f66f491fed37b225b8e0b2888c37276cfa0468fc13b8d593fd9a2675f0f5b20b8a15f8fa7558176a530d6865738ddb25d3426dab905221681cf9da0e0200eea5b2eba3ad3a5237d2a391f9074bf1779a2005cee43eec2b058511532635e0fea61664f531ac2b356f40db5c5d275a4cf5c82d468976455af4e3362cc8f71aa95e71d394aff3ead6f7101279f95bcd8a0fedce1d21cb3c9f6dd3b182fce0db5d6712981b651f29178a24119968b14783cafa713bc5f2a65205a42e4ce9dc7ba462bdb1f3e4553afc15f5f39998fdb53e7e231e3e520a46943734a007c2daa1eda9f495791657eefcac5c32833936e568d06187857ed04d7b97167ae207c5c5ae54e528c36016a984235e9c5b2f0718d7b3aa93c7822ccc772580b6599671b3c02ece8a21399abd33cfd3028790133167d0a97e7de53dc8ff0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff071f0104455a6361736830623963346565663862376363343137656535303031653335303039383462366665613335363833613763616331343161303433633432303634383335643334ffffffff010000000000000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
),
KV(
k: "00000001",
k: "000001",
v: "04000000382c4a332661c7ed0671f32a34d724619f086c61873bce7c99859dd9920aa605755f7c7d27a811596e9fae6dd30ca45be86e901d499909de35b6ff1f699f7ef30000000000000000000000000000000000000000000000000000000000000000e9851358ffff0720000056c2264c31261d597c6fcea7c5e00160cf6be1cd89ca96a0389473e50000fd40050053f4438864bc5d6dfc009d4bba545ac5e5feaaf46f9455b975b02115f842a966e26517ce678f1c074d09cc8d0049a190859eb505af5f3e760312fbbe54da115db2bc03c96408f39b679891790b539d2d9d17a801dc6af9af14ca3f6ba060edce2a1dd45aa45f11fe37dbaf1eb2647ae7c393f6680c3d5d7e53687e34530f48edf58924a04d3e0231c150b1c8218998f674bc171edd222bcb4ac4ba4ea52d7baa86399f371d5284043e1e166f9069dd0f2904ff94c7922a70fa7c660e0553cc40a20d9ee08eb3f47278485801ddae9c270411360773f0b74e03db2d92c50952c9bd4924bbca2a260e1235e99df51fe71e75744232f2d641ef94f394110a5ad05f51a057e4cb515b92c16cb1404a8cdcc43d4a4bb2caa54ca35dccf41aa7d832da65123b7029223c46ed2a13387d598d445435d3cb32fdad9e27672903864c90d86353b162033078327b5b7aaffc89b40096ae004f2d5c6bd2c99188574348518db66e9b6020f93f12ee1c06f7b00fe346fefceaffb1da9e3cdf08285057f549733eb10825737fcd1431bfdfb155f323f24e95a869212baacf445b30f2670206645779110e6547d5da90a5f2fe5151da911d5ecd5a833023661d1356b6c395d85968947678d53efd4db7b06f23b21125e74492644277ea0c1131b80d6a4e3e8093b82332556fbb3255a55ac3f0b7e4844c0e12bf577c37fd02323ae5ef4781772ed501d63b568032a3d31576c5104a48c01ac54f715286932351a8adc8cf2467a84a0572e99f366ee00f82c3735545fd4bb941d591ce70070425a81304272db89887949bc7dd8236bb7e82190f9815da938cd6e8fec7660e91354326a7a9bfe38120e97997fca3c289d54513ed00286c2b825fbe84f91a39528f335674b5e957425a6edfdd00f2feb2c2df575616197998c1e964e069875d4d934f419a9b02b100848d023b76d47bd4e284c3895ef9227a40d8ea8826e86c7155d6aa95b8f9175812523a32cd611efc700688e03f7c245c5bff01718281b5d75cefe8318b2c08962236b14a0bf79534c203df735fd9cced97cbae07c2b4ee9cda8c9993f3f6277ff3fec261fb94d3961c4befe4b0893dcf67b312c7d8d6ff7adc8539cb2b1d3534fccf109efddd07a9f1e77b94ab1e505b164221dca1c34621b1e9d234c31a032a401267d95f65b800d579a2482638dfeade804149c81e95d7ef5510ac0b6212231506b1c635a2e1d2f0c9712989f9f246762fadb4c55c20f707dcc0e510a33e9465fc5d5bdbfa524dab0d7a1c6a1baaa36869cf542aa2257c5c44ef07547a570343442c6091e13bc04d559dc0e6db5b001861914bf956816edce2a86b274bd97f27e2dbb08608c16a3e5d8595952faa91fb162d7fa6a7a47e849a1ad8fab3ba620ee3295a04fe13e5fb655ac92ae60d01020b8999526af8d56b28733e69c9ffb285de27c61edc0bf62261ac0787eff347d0fcd62257301ede9603106ea41650a3e3119bd5c4e86a7f6a3f00934f3a545f7f21d41699f3e35d38cf925a8bdaf2bf7eedea11c31c3d8bf6c527c77c6378281cdf02211a58fa5e46d28d7e7c5fb79d69b31703fd752395da115845952cf99aaeb2155c2ab951a69f67d938f223185567e52cfa3e57b62c790bf78674c4b02c12b7d3225fe8f705b408ba11c24245b3924482e2f3480994461b550641a88cd941d371139f3498afacdcba1249631402b20695760eaada5376e68df0e45139c410700effc9420dc3726515e7fcb3f349320f30511451964bd9b6530682efec65910ceb548aa2ab05ac3309e803161697213631ae8e13cc7d223ac28446c1bf94a19a8782ac16ff57df7ee4f10fb6e488c02c68d6b6dee6987f6d2c39227da366c59f54ff67e312ca530e7c467c3dc80101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0250c30000000000002321025229e1240a21004cf8338db05679fa34753706e84f6aebba086ba04317fd8f99acd43000000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c6428700000000",
),
KV(
k: "00000002",
k: "000002",
v: "04000000238d665a062b9007836a7d8f968ba2f3847af5f542733389a952cf9b86795502d5b3ccfd5e7828c4b2d221bae3178c500e21d33399c39a2508a0a82d53c022580000000000000000000000000000000000000000000000000000000000000000898c1358ffff072000005b7d311fedc046109a4482bd0eccdf21a6089c99fce43633d03352530000fd400500282db5ba22a2c122aba42724a991196cd01cc2b7013318f691d61171db79202d2e5979b0b6d5692cd129eb37b7541ff51b7b2a840b45273f86d2509acfaa39183bb3850f9916ec8246ad9ee785462c9cda0ea202f12c7ccba8cc155096016a87a6fc40a6a44f5f3b309a868f30d9080b128c75234a6c3d019fb7fbe29708d01daaab84e4891a00d15ffdd9a598dd678899102265e2090a4b7b26ec55764febbfd1f5fe791aef8500619578359cb2abfb19844981b5c0e67e86b6549765bd638f3a701b0fc8a56d00c4efb87b55883f1d81012e5b02d44e10ec9bf620f20ad62ca549be934d11103f9142b3201ff31b7791c1636aaeadc512b2c0f801a64959300d5d526c2fc58e2838162659fe59168f2214b41d1ec963d543e2660ea630d031e2671c8c841fa9c1b58f7475bfe958724cf89c038d29306dc0043b93148ab95f6e99017ec5863db2f9130c48187bfd013924b34eaefd1db6b2818f4f6a604185fa774c2c069455c6eb195a5382403404c47db312b29b5d84e44c4a645f06ef7899f0b78962e95d5476bc989dcb9458c24733a435b151c9fb46c32cbebd3318cf3ed7310533cfa0b087d58c687505070858765968d1f7077f0e6dd75ebf15d74bb8c7466ef2f4974df537f5dd64097f4adf8b1cff61c00181ad26f94cca9c01960db31edc454c1650da4f4390b4aa0efd46c9ed527ed8bb068494285da2680993e8d355caf6a0bd42a4d681780db2312eef129aa76c6081ceff231311ea93fd65fb0b80df077c49ca69d8996b1ebcfd74bad793d7914b4748af45f31ad018dd12997bfcf809df3894bbd7a10cc585797915356389b744f71ee58ac25484b635fe12a1b20909c97edb1d7ae20b1ef1c776260ebab06e16a34c2789fb5555ddc954cc38f07ac551ac3b46c1370f4fa1ba22ac35d82134eaa0d3f3198eeef723030072214ede447893a03f706d389ea60ef8a81ff7e20ae920cb1a5219e93e1bd2058df6296dc8ba39e4d403199d2c209c3d6b3b2d462aecc04b0e248e7f1e9d204a1f6b7df51073ae2faab55be3353713743c5db40555bebda203a5c79fc3324cb8fb7629c9391931a1268c97fad6d6ab7ebc583330356372df8c5e9e885422c75ab956932351858452c5904a5aad3d9fd840e356abd580479d9a531cda6de08277008bb3a1bdf08604c1df0d8e8cd475cb455161bfe5d9710bc0dfac4214afeeed4bca6148b54241b8f4ab221502917f261705715c7388d9e91d3685a1f67c484a24b716912fe33a89ca7ebc3a5b77e6b36657c7e2b2e1e8b2b699690ca749339b7b2673fb1083496bbc753fdfc49ff6e921c5e35f27d9175afa7da3793d6a7ad5eb0ab8c9ee0e60a8ae438e3145cf64b5f6417625ca934b9d7acc150efa9b53618c15b4d8318be5de0855696d92ef2e018d97ebd24102e824bbd040aed958a51016a91661180e64932f2316b5ee55923263d19d293996118f511f22912e8c9c435af630099fc47b7c4ab581b7d760418314c0e6e814b3bbddb486517436d56ddc774701072cd77beada2cc94cad87f3d1cb83db4da05c2e141bc175bc8848e548c27584995333ef1d9eadd8d7f028cae60d5b0e9642db7245d388ff58c6a31556319a29c0dc14362b957b6220a428966d66d6c3339a12a503806de7dc4c4561bab6968245e41b27ae89fffbfd1bd2f4104d074f0f2b759576f9e16c0e2f73bedc7c0e0da97698e07ca1d729b113938a6b29c3b19d9b8225303f80d6dc0e39bec343ac9a2d23926ab414666e079e68745998ff73dacbe1645bd004dd06236f615f11d47e9b2d54cf8573d9a295bda88af4b2c6c603db0c0757485a543725b1cc04f7e9f38445ed875ec54317418600b4113600e137417e5d1fc333159a7e365d0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03520103ffffffff02a086010000000000232102acce9f6c16986c525fd34759d851ef5b4b85b5019a57bd59747be0ef1ba62523aca86100000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c6428700000000",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "08ce3d9731b000c08338455c8a4a6bd05da16e26b11daa1b917184ece80f0400",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "08ce3d9731b000c08338455c8a4a6bd05da16e26b11daa1b917184ece80f0400",
),
KV(
k: "00000001",
k: "000001",
v: "8392336da29773c56b1649ab555156ceb7e700ad7c230ea7a4571c7e22bc0700",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "08ce3d9731b000c08338455c8a4a6bd05da16e26b11daa1b917184ece80f0400",
),
KV(
k: "00000001",
k: "000001",
v: "8392336da29773c56b1649ab555156ceb7e700ad7c230ea7a4571c7e22bc0700",
),
KV(
k: "00000002",
k: "000002",
v: "ed73e297d7c51cb8dc53fc2213d7e2e3f116eb4f26434496fc1926906ca20200",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "382c4a332661c7ed0671f32a34d724619f086c61873bce7c99859dd9920aa605",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "382c4a332661c7ed0671f32a34d724619f086c61873bce7c99859dd9920aa605",
),
KV(
k: "00000001",
k: "000001",
v: "238d665a062b9007836a7d8f968ba2f3847af5f542733389a952cf9b86795502",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "382c4a332661c7ed0671f32a34d724619f086c61873bce7c99859dd9920aa605",
),
KV(
k: "00000001",
k: "000001",
v: "238d665a062b9007836a7d8f968ba2f3847af5f542733389a952cf9b86795502",
),
KV(
k: "00000002",
k: "000002",
v: "181ac2d6dc0ae73a82d7db472ac2879a7c24d8b12e5f73efc33a55549ea4f100",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "08ce3d9731b000c08338455c8a4a6bd05da16e26b11daa1b917184ece80f0400",
v: "00000000",
v: "000000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "08ce3d9731b000c08338455c8a4a6bd05da16e26b11daa1b917184ece80f0400",
v: "00000000",
v: "000000",
),
KV(
k: "8392336da29773c56b1649ab555156ceb7e700ad7c230ea7a4571c7e22bc0700",
v: "00000001",
v: "000001",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "08ce3d9731b000c08338455c8a4a6bd05da16e26b11daa1b917184ece80f0400",
v: "00000000",
v: "000000",
),
KV(
k: "8392336da29773c56b1649ab555156ceb7e700ad7c230ea7a4571c7e22bc0700",
v: "00000001",
v: "000001",
),
KV(
k: "ed73e297d7c51cb8dc53fc2213d7e2e3f116eb4f26434496fc1926906ca20200",
v: "00000002",
v: "000002",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "382c4a332661c7ed0671f32a34d724619f086c61873bce7c99859dd9920aa605",
v: "00000000",
v: "000000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "238d665a062b9007836a7d8f968ba2f3847af5f542733389a952cf9b86795502",
v: "00000001",
v: "000001",
),
KV(
k: "382c4a332661c7ed0671f32a34d724619f086c61873bce7c99859dd9920aa605",
v: "00000000",
v: "000000",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "181ac2d6dc0ae73a82d7db472ac2879a7c24d8b12e5f73efc33a55549ea4f100",
v: "00000002",
v: "000002",
),
KV(
k: "238d665a062b9007836a7d8f968ba2f3847af5f542733389a952cf9b86795502",
v: "00000001",
v: "000001",
),
KV(
k: "382c4a332661c7ed0671f32a34d724619f086c61873bce7c99859dd9920aa605",
v: "00000000",
v: "000000",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
KV(
k: "00000001",
k: "000001",
v: "0001ae2935f1dfd8a24aed7c70df7de3a668eb7a49b1319880dde2bbd9031ae5d82f",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
KV(
k: "00000001",
k: "000001",
v: "0001ae2935f1dfd8a24aed7c70df7de3a668eb7a49b1319880dde2bbd9031ae5d82f",
),
KV(
k: "00000002",
k: "000002",
v: "0001ae2935f1dfd8a24aed7c70df7de3a668eb7a49b1319880dde2bbd9031ae5d82f",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
KV(
k: "00000001",
k: "000001",
v: "0001ae2935f1dfd8a24aed7c70df7de3a668eb7a49b1319880dde2bbd9031ae5d82f",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
KV(
k: "00000001",
k: "000001",
v: "0001ae2935f1dfd8a24aed7c70df7de3a668eb7a49b1319880dde2bbd9031ae5d82f",
),
KV(
k: "00000002",
k: "000002",
v: "0001ae2935f1dfd8a24aed7c70df7de3a668eb7a49b1319880dde2bbd9031ae5d82f",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
KV(
k: "00000001",
k: "000001",
v: "0001fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
KV(
k: "00000001",
k: "000001",
v: "0001fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e",
),
KV(
k: "00000002",
k: "000002",
v: "0001fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
KV(
k: "00000001",
k: "000001",
v: "0001fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e",
),
]

View File

@ -1,20 +1,18 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
KV(
k: "00000001",
k: "000001",
v: "0001fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e",
),
KV(
k: "00000002",
k: "000002",
v: "0001fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
]

View File

@ -1,11 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000001",
k: "000001",
v: "0001d7c612c817793191a1e68652121876d6b3bde40f4fa52bc314145ce6e5cdd259",
),
]

View File

@ -1,11 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000002",
k: "000002",
v: "0001d7c612c817793191a1e68652121876d6b3bde40f4fa52bc314145ce6e5cdd259",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "00000000",
k: "000000",
v: "0000",
),
]

View File

@ -1,11 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000001",
k: "000001",
v: "0001d7c612c817793191a1e68652121876d6b3bde40f4fa52bc314145ce6e5cdd259",
),
]

View File

@ -1,11 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 137
expression: cf_data
---
[
KV(
k: "00000002",
k: "000002",
v: "0001d7c612c817793191a1e68652121876d6b3bde40f4fa52bc314145ce6e5cdd259",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "0946edb9c083c9942d92305444527765fad789c438c717783276a9f7fbf61b85",
v: "0000000100000000",
v: "0000010000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "0946edb9c083c9942d92305444527765fad789c438c717783276a9f7fbf61b85",
v: "0000000100000000",
v: "0000010000",
),
KV(
k: "f4b084a7c2fc5a5aa2985f2bcb1d4a9a65562a589d628b0d869c5f1c8dd07489",
v: "0000000200000000",
v: "0000020000",
),
]

View File

@ -1,12 +1,10 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "755f7c7d27a811596e9fae6dd30ca45be86e901d499909de35b6ff1f699f7ef3",
v: "0000000100000000",
v: "0000010000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "755f7c7d27a811596e9fae6dd30ca45be86e901d499909de35b6ff1f699f7ef3",
v: "0000000100000000",
v: "0000010000",
),
KV(
k: "d5b3ccfd5e7828c4b2d221bae3178c500e21d33399c39a2508a0a82d53c02258",
v: "0000000200000000",
v: "0000020000",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "0946edb9c083c9942d92305444527765fad789c438c717783276a9f7fbf61b8500000000",
v: "000000010150c30000000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
v: "0000010150c30000000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
),
KV(
k: "0946edb9c083c9942d92305444527765fad789c438c717783276a9f7fbf61b8501000000",
v: "0000000101d43000000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
v: "00000101d43000000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
),
]

View File

@ -1,24 +1,22 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "0946edb9c083c9942d92305444527765fad789c438c717783276a9f7fbf61b8500000000",
v: "000000010150c30000000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
v: "0000010150c30000000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
),
KV(
k: "0946edb9c083c9942d92305444527765fad789c438c717783276a9f7fbf61b8501000000",
v: "0000000101d43000000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
v: "00000101d43000000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
),
KV(
k: "f4b084a7c2fc5a5aa2985f2bcb1d4a9a65562a589d628b0d869c5f1c8dd0748900000000",
v: "0000000201a0860100000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
v: "00000201a0860100000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
),
KV(
k: "f4b084a7c2fc5a5aa2985f2bcb1d4a9a65562a589d628b0d869c5f1c8dd0748901000000",
v: "0000000201a86100000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
v: "00000201a86100000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
),
]

View File

@ -1,16 +1,14 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "755f7c7d27a811596e9fae6dd30ca45be86e901d499909de35b6ff1f699f7ef300000000",
v: "000000010150c30000000000002321025229e1240a21004cf8338db05679fa34753706e84f6aebba086ba04317fd8f99ac",
v: "0000010150c30000000000002321025229e1240a21004cf8338db05679fa34753706e84f6aebba086ba04317fd8f99ac",
),
KV(
k: "755f7c7d27a811596e9fae6dd30ca45be86e901d499909de35b6ff1f699f7ef301000000",
v: "0000000101d43000000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
v: "00000101d43000000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
),
]

View File

@ -1,24 +1,22 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 125
expression: cf_data
---
[
KV(
k: "755f7c7d27a811596e9fae6dd30ca45be86e901d499909de35b6ff1f699f7ef300000000",
v: "000000010150c30000000000002321025229e1240a21004cf8338db05679fa34753706e84f6aebba086ba04317fd8f99ac",
v: "0000010150c30000000000002321025229e1240a21004cf8338db05679fa34753706e84f6aebba086ba04317fd8f99ac",
),
KV(
k: "755f7c7d27a811596e9fae6dd30ca45be86e901d499909de35b6ff1f699f7ef301000000",
v: "0000000101d43000000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
v: "00000101d43000000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
),
KV(
k: "d5b3ccfd5e7828c4b2d221bae3178c500e21d33399c39a2508a0a82d53c0225800000000",
v: "0000000201a086010000000000232102acce9f6c16986c525fd34759d851ef5b4b85b5019a57bd59747be0ef1ba62523ac",
v: "00000201a086010000000000232102acce9f6c16986c525fd34759d851ef5b4b85b5019a57bd59747be0ef1ba62523ac",
),
KV(
k: "d5b3ccfd5e7828c4b2d221bae3178c500e21d33399c39a2508a0a82d53c0225801000000",
v: "0000000201a86100000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
v: "00000201a86100000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
),
]

View File

@ -15,11 +15,21 @@ use zebra_chain::{
transaction, transparent,
};
use crate::service::finalized_state::disk_format::{FromDisk, IntoDisk, IntoDiskFixedLen};
use crate::service::finalized_state::disk_format::{block::HEIGHT_DISK_BYTES, FromDisk, IntoDisk};
#[cfg(any(test, feature = "proptest-impl"))]
use proptest_derive::Arbitrary;
/// Output transaction locations are stored as a 32 byte transaction hash on disk.
///
/// TODO: change to TransactionLocation to reduce database size and increases lookup performance (#3151)
pub const OUTPUT_TX_HASH_DISK_BYTES: usize = 32;
/// [`OutputIndex`]es are stored as 4 bytes on disk.
///
/// TODO: change to 3 bytes to reduce database size and increases lookup performance (#3151)
pub const OUTPUT_INDEX_DISK_BYTES: usize = 4;
// Transparent types
/// A transaction's index in its block.
@ -97,7 +107,7 @@ impl OutputLocation {
// TODO: serialize the index into a smaller number of bytes (#3152)
// serialize the index in big-endian order (#3150)
impl IntoDisk for OutputIndex {
type Bytes = [u8; 4];
type Bytes = [u8; OUTPUT_INDEX_DISK_BYTES];
fn as_bytes(&self) -> Self::Bytes {
self.0.to_le_bytes()
@ -111,7 +121,7 @@ impl FromDisk for OutputIndex {
}
impl IntoDisk for OutputLocation {
type Bytes = [u8; 36];
type Bytes = [u8; OUTPUT_TX_HASH_DISK_BYTES + OUTPUT_INDEX_DISK_BYTES];
fn as_bytes(&self) -> Self::Bytes {
let hash_bytes = self.hash.as_bytes().to_vec();
@ -123,9 +133,7 @@ impl IntoDisk for OutputLocation {
impl FromDisk for OutputLocation {
fn from_bytes(disk_bytes: impl AsRef<[u8]>) -> Self {
let hash_len = transaction::Hash::fixed_byte_len();
let (hash_bytes, index_bytes) = disk_bytes.as_ref().split_at(hash_len);
let (hash_bytes, index_bytes) = disk_bytes.as_ref().split_at(OUTPUT_TX_HASH_DISK_BYTES);
let hash = transaction::Hash::from_bytes(hash_bytes);
let index = OutputIndex::from_bytes(index_bytes);
@ -152,9 +160,7 @@ impl IntoDisk for transparent::Utxo {
impl FromDisk for transparent::Utxo {
fn from_bytes(bytes: impl AsRef<[u8]>) -> Self {
let height_len = Height::fixed_byte_len();
let (height_bytes, rest_bytes) = bytes.as_ref().split_at(height_len);
let (height_bytes, rest_bytes) = bytes.as_ref().split_at(HEIGHT_DISK_BYTES);
let (coinbase_flag_bytes, output_bytes) = rest_bytes.split_at(1);
let height = Height::from_bytes(height_bytes);

View File

@ -13,7 +13,10 @@ use std::path::Path;
use zebra_chain::parameters::Network;
use crate::{service::finalized_state::disk_db::DiskDb, Config};
use crate::{
service::finalized_state::{disk_db::DiskDb, disk_format::block::MAX_ON_DISK_HEIGHT},
Config,
};
pub mod block;
pub mod chain;
@ -36,9 +39,13 @@ impl ZebraDb {
/// Opens or creates the database at `config.path` for `network`,
/// and returns a shared high-level typed database wrapper.
pub fn new(config: &Config, network: Network) -> ZebraDb {
ZebraDb {
let db = ZebraDb {
db: DiskDb::new(config, network),
}
};
db.check_max_on_disk_tip_height();
db
}
/// Returns the `Path` where the files used by this database are located.
@ -54,6 +61,28 @@ impl ZebraDb {
///
/// See [`DiskDb::shutdown`] for details.
pub(crate) fn shutdown(&mut self, force: bool) {
self.check_max_on_disk_tip_height();
self.db.shutdown(force);
}
/// Check that the on-disk height is well below the maximum supported database height.
///
/// Zebra only supports on-disk heights up to 3 bytes.
///
/// # Logs an Error
///
/// If Zebra is storing block heights that are close to [`MAX_ON_DISK_BLOCK_HEIGHT`].
fn check_max_on_disk_tip_height(&self) {
if let Some((tip_height, tip_hash)) = self.tip() {
if tip_height.0 > MAX_ON_DISK_HEIGHT.0 / 2 {
error!(
?tip_height,
?tip_hash,
?MAX_ON_DISK_HEIGHT,
"unexpectedly large tip height, database format upgrade required",
);
}
}
}
}