Skip to content

Commit eba2f36

Browse files
Store state trie in SQLite
This means that writes of blocks and writes to state can be kept in sync, because the write barriers that SQLite provides will apply to both forms of data. This should eliminate inconsistencies between the two data stores. Note that I also renamed the SQL database from `blockdata.db` to `db.sqlite3`.
1 parent dd2bede commit eba2f36

File tree

4 files changed

+74
-104
lines changed

4 files changed

+74
-104
lines changed

eth-trie.rs/src/db.rs

-7
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ pub trait DB: Send + Sync {
3636
Ok(())
3737
}
3838

39-
/// Flush data to the DB from the cache.
40-
fn flush(&self) -> Result<(), Self::Error>;
41-
4239
#[cfg(test)]
4340
fn len(&self) -> Result<usize, Self::Error>;
4441
#[cfg(test)]
@@ -84,10 +81,6 @@ impl DB for MemoryDB {
8481
Ok(())
8582
}
8683

87-
fn flush(&self) -> Result<(), Self::Error> {
88-
Ok(())
89-
}
90-
9184
#[cfg(test)]
9285
fn len(&self) -> Result<usize, Self::Error> {
9386
Ok(self.storage.try_read().unwrap().len())

z2/src/zq1/db.rs

-4
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ impl DB for StateDatabase {
107107

108108
Ok(())
109109
}
110-
111-
fn flush(&self) -> Result<(), Self::Error> {
112-
Ok(())
113-
}
114110
}
115111

116112
pub struct Db {

0 commit comments

Comments
 (0)