1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00
This commit is contained in:
Marat 2025-03-05 20:12:45 +01:00 committed by GitHub
commit 0481f61fb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 39 additions and 1 deletions

View file

@ -96,11 +96,17 @@ void CellDbIn::start_up() {
db_options.snapshot_statistics = snapshot_statistics_;
}
db_options.statistics = statistics_;
db_options.use_direct_reads = opts_->get_celldb_direct_io();
db_options.enable_bloom_filter = !opts_->get_celldb_disable_bloom_filter();
db_options.two_level_index_and_filter = db_options.enable_bloom_filter
&& opts_->state_ttl() >= 60 * 60 * 24 * 30; // 30 days
if (opts_->get_celldb_cache_size()) {
db_options.block_cache = td::RocksDb::create_cache(opts_->get_celldb_cache_size().value());
LOG(WARNING) << "Set CellDb block cache size to " << td::format::as_size(opts_->get_celldb_cache_size().value());
} else if (db_options.two_level_index_and_filter && !opts_->get_celldb_in_memory()) {
db_options.block_cache = td::RocksDb::create_cache(16ULL << 30);
LOG(WARNING) << "Set CellDb block cache size to 16GB";
}
db_options.use_direct_reads = opts_->get_celldb_direct_io();
if (opts_->get_celldb_in_memory()) {
td::RocksDbOptions read_db_options;

View file

@ -139,6 +139,9 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
bool get_celldb_in_memory() const override {
return celldb_in_memory_;
}
bool get_celldb_disable_bloom_filter() const override {
return celldb_disable_bloom_filter_;
}
td::optional<double> get_catchain_max_block_delay() const override {
return catchain_max_block_delay_;
}
@ -237,6 +240,9 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
void set_celldb_in_memory(bool value) override {
celldb_in_memory_ = value;
}
void set_celldb_disable_bloom_filter(bool value) override {
celldb_disable_bloom_filter_ = value;
}
void set_catchain_max_block_delay(double value) override {
catchain_max_block_delay_ = value;
}
@ -304,6 +310,7 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
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 state_serializer_enabled_ = true;
td::Ref<CollatorOptions> collator_options_{true};

View file

@ -111,6 +111,7 @@ struct ValidatorManagerOptions : public td::CntObject {
virtual td::optional<td::uint64> get_celldb_cache_size() const = 0;
virtual bool get_celldb_direct_io() const = 0;
virtual bool get_celldb_preload_all() const = 0;
virtual bool get_celldb_disable_bloom_filter() const = 0;
virtual td::optional<double> get_catchain_max_block_delay() const = 0;
virtual td::optional<double> get_catchain_max_block_delay_slow() const = 0;
virtual bool get_state_serializer_enabled() const = 0;
@ -144,6 +145,7 @@ struct ValidatorManagerOptions : public td::CntObject {
virtual void set_celldb_direct_io(bool value) = 0;
virtual void set_celldb_preload_all(bool value) = 0;
virtual void set_celldb_in_memory(bool value) = 0;
virtual void set_celldb_disable_bloom_filter(bool value) = 0;
virtual void set_catchain_max_block_delay(double value) = 0;
virtual void set_catchain_max_block_delay_slow(double value) = 0;
virtual void set_state_serializer_enabled(bool value) = 0;