decrements minor version and skips inserting subtrees in db

This commit is contained in:
arya2 2023-08-25 14:43:04 -04:00
parent 7d90cfbfaf
commit 0d974ac578
2 changed files with 11 additions and 9 deletions

View File

@ -48,7 +48,7 @@ pub(crate) const DATABASE_FORMAT_VERSION: u64 = 25;
/// - adding new column families,
/// - changing the format of a column family in a compatible way, or
/// - breaking changes with compatibility code in all supported Zebra versions.
pub(crate) const DATABASE_FORMAT_MINOR_VERSION: u64 = 2;
pub(crate) const DATABASE_FORMAT_MINOR_VERSION: u64 = 1;
/// The database format patch version, incremented each time the on-disk database format has a
/// significant format compatibility fix.

View File

@ -348,8 +348,8 @@ impl DiskWriteBatch {
let sapling_tree_cf = db.cf_handle("sapling_note_commitment_tree").unwrap();
let orchard_tree_cf = db.cf_handle("orchard_note_commitment_tree").unwrap();
let sapling_subtree_cf = db.cf_handle("sapling_note_commitment_subtree").unwrap();
let orchard_subtree_cf = db.cf_handle("orchard_note_commitment_subtree").unwrap();
let _sapling_subtree_cf = db.cf_handle("sapling_note_commitment_subtree").unwrap();
let _orchard_subtree_cf = db.cf_handle("orchard_note_commitment_subtree").unwrap();
let height = finalized.verified.height;
let trees = finalized.treestate.note_commitment_trees.clone();
@ -396,13 +396,15 @@ impl DiskWriteBatch {
self.zs_insert(&orchard_tree_cf, height, trees.orchard);
}
if let Some(subtree) = trees.sapling_subtree {
self.zs_insert(&sapling_subtree_cf, subtree.index, subtree.into_data());
}
// TODO: Increment DATABASE_FORMAT_MINOR_VERSION and uncomment these insertions
if let Some(subtree) = trees.orchard_subtree {
self.zs_insert(&orchard_subtree_cf, subtree.index, subtree.into_data());
}
// if let Some(subtree) = trees.sapling_subtree {
// self.zs_insert(&sapling_subtree_cf, subtree.index, subtree.into_data());
// }
// if let Some(subtree) = trees.orchard_subtree {
// self.zs_insert(&orchard_subtree_cf, subtree.index, subtree.into_data());
// }
self.prepare_history_batch(db, finalized)
}