1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

enable bloom filters for celldb

This commit is contained in:
Marat S 2025-02-15 16:17:13 +00:00
parent 3c245c6146
commit 34f80e8f1b
7 changed files with 26 additions and 0 deletions

View file

@ -1466,6 +1466,7 @@ td::Status ValidatorEngine::load_global_config() {
}
validator_options_.write().set_celldb_compress_depth(celldb_compress_depth_);
validator_options_.write().set_celldb_in_memory(celldb_in_memory_);
validator_options_.write().set_celldb_disable_bloom_filter(celldb_disable_bloom_filter_);
validator_options_.write().set_max_open_archive_files(max_open_archive_files_);
validator_options_.write().set_archive_preload_period(archive_preload_period_);
validator_options_.write().set_disable_rocksdb_stats(disable_rocksdb_stats_);
@ -4520,6 +4521,12 @@ int main(int argc, char *argv[]) {
[&]() {
acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_in_memory, true); });
});
p.add_option(
'\0', "celldb-disable-bloom-filter",
"disable using bloom filter in CellDb. Enabled bloom filter reduces read latency, but increases memory usage",
[&]() {
acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_disable_bloom_filter, true); });
});
p.add_checked_option(
'\0', "catchain-max-block-delay", "delay before creating a new catchain block, in seconds (default: 0.4)",
[&](td::Slice s) -> td::Status {

View file

@ -218,6 +218,7 @@ class ValidatorEngine : public td::actor::Actor {
bool celldb_direct_io_ = false;
bool celldb_preload_all_ = false;
bool celldb_in_memory_ = false;
bool celldb_disable_bloom_filter_ = false;
td::optional<double> catchain_max_block_delay_, catchain_max_block_delay_slow_;
bool read_config_ = false;
bool started_keyring_ = false;
@ -307,6 +308,9 @@ class ValidatorEngine : public td::actor::Actor {
void set_celldb_in_memory(bool value) {
celldb_in_memory_ = value;
}
void set_celldb_disable_bloom_filter(bool value) {
celldb_disable_bloom_filter_ = value;
}
void set_catchain_max_block_delay(double value) {
catchain_max_block_delay_ = value;
}