Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Bloomchain #1014

Merged
merged 24 commits into from
May 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
710ea4e
use bloomchain crate in blockchain module. remove obsole chainfilter …
debris May 4, 2016
60476f3
update database version to 6.0
debris May 4, 2016
6b6276b
removed redundant line
debris May 4, 2016
a3740fa
Merge branch 'master' of github.com:ethcore/parity into bloomchain
debris May 12, 2016
0eddbf5
Merge branch 'master' into bloomchain
debris May 16, 2016
a5c59ec
Merge branch 'master' of github.com:ethcore/parity into bloomchain
debris May 19, 2016
2b8cf7a
simple db migration
debris May 23, 2016
ed3d77b
make migration slightly more functional
debris May 23, 2016
1eb2c65
Merge branch 'migration' into bloomchain
debris May 23, 2016
a03e63f
bloomchain migration
debris May 23, 2016
321e0bf
migration version is just a single unsigned integer
debris May 24, 2016
180fe4c
Merge branch 'migration' into bloomchain_migration
debris May 24, 2016
6cda079
updated migration v6
debris May 24, 2016
bac4dbe
Merge branch 'master' of github.com:ethcore/parity into migration
debris May 24, 2016
61ea749
parity migration
debris May 24, 2016
a506c64
Merge branch 'db_migration' into bloomchain_migration
debris May 24, 2016
de7e7fa
db migration
debris May 24, 2016
7b3a253
removed hardcoded migration dir
debris May 25, 2016
6ea0dc5
Merge branch 'master' of github.com:ethcore/parity into bloomchain
debris May 25, 2016
0531edc
Merge branch 'master' of github.com:ethcore/parity into bloomchain
debris May 25, 2016
1c0c4a4
replace ptr::copy with clone_from_slice, removed potential endianess …
debris May 25, 2016
e94b580
Merge branch 'master' into bloomchain
debris May 26, 2016
fe4264d
removed superfluous line
debris May 26, 2016
bd504ef
blockchains log blooms config is not exposed any more
debris May 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 76 additions & 107 deletions ethcore/src/blockchain/blockchain.rs

Large diffs are not rendered by default.

102 changes: 0 additions & 102 deletions ethcore/src/blockchain/bloom_indexer.rs

This file was deleted.

6 changes: 3 additions & 3 deletions ethcore/src/blockchain/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub struct CacheSize {
pub block_details: usize,
/// Transaction addresses cache size.
pub transaction_addresses: usize,
/// Logs cache size.
pub block_logs: usize,
/// Blooms cache size.
pub blocks_blooms: usize,
/// Block receipts size.
Expand All @@ -33,5 +31,7 @@ pub struct CacheSize {

impl CacheSize {
/// Total amount used by the cache.
pub fn total(&self) -> usize { self.blocks + self.block_details + self.transaction_addresses + self.block_logs + self.blocks_blooms }
pub fn total(&self) -> usize {
self.blocks + self.block_details + self.transaction_addresses + self.blocks_blooms + self.block_receipts
}
}
33 changes: 17 additions & 16 deletions ethcore/src/chainfilter/mod.rs → ethcore/src/blockchain/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

//! Multilevel blockchain bloom filter.

mod bloomindex;
mod chainfilter;
mod indexer;

#[cfg(test)]
mod tests;

pub use self::bloomindex::BloomIndex;
pub use self::chainfilter::ChainFilter;
use util::hash::H2048;
//! Blockchain configuration.

/// Blockchain configuration.
#[derive(Debug)]
pub struct Config {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it really sensible to place runtime options (_cache_size) with database-persistent options (log_blooms)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option (log_blooms) can be configurable now. Syncing from scratch could be done with different number of levels and elements_per_index. There is no cli for it yet, but I'm willing to add it someday.

/// Preferred cache size in bytes.
pub pref_cache_size: usize,
/// Maximum cache size in bytes.
pub max_cache_size: usize,
}

/// Types implementing this trait provide read access for bloom filters database.
pub trait FilterDataSource {
/// returns reference to log at given position if it exists
fn bloom_at_index(&self, index: &BloomIndex) -> Option<H2048>;
impl Default for Config {
fn default() -> Self {
Config {
pref_cache_size: 1 << 14,
max_cache_size: 1 << 20,
}
}
}

Loading