Skip to content

Commit

Permalink
feat: add proposal (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
xinifinity authored Aug 4, 2023
1 parent 87837bf commit e36f99b
Show file tree
Hide file tree
Showing 6 changed files with 632 additions and 127 deletions.
6 changes: 3 additions & 3 deletions firewood/examples/rev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ fn main() {

struct RevisionTracker {
hashes: VecDeque<TrieHash>,
db: Db<Store>,
db: Db<Store, SharedStore>,
}

impl RevisionTracker {
fn new(db: Db<Store>) -> Self {
fn new(db: Db<Store, SharedStore>) -> Self {
Self {
hashes: VecDeque::new(),
db,
Expand Down Expand Up @@ -159,7 +159,7 @@ impl RevisionTracker {
self.hashes.push_front(hash);
}

fn commit_batch(&mut self, batch: WriteBatch<Store>) {
fn commit_batch(&mut self, batch: WriteBatch<Store, SharedStore>) {
batch.commit();
let hash = self.db.kv_root_hash().expect("root-hash should exist");
self.hashes.push_front(hash);
Expand Down
2 changes: 1 addition & 1 deletion firewood/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub use crate::storage::{buffer::DiskBufferConfig, WalConfig};
use typed_builder::TypedBuilder;

/// Database configuration.
#[derive(TypedBuilder, Debug)]
#[derive(Clone, TypedBuilder, Debug)]
pub struct DbConfig {
/// Maximum cached pages for the free list of the item stash.
#[builder(default = 16384)] // 64M total size by default
Expand Down
Loading

0 comments on commit e36f99b

Please sign in to comment.