mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Merge branch 'testnet' into block-generation
This commit is contained in:
commit
eb41e1a10e
10 changed files with 165 additions and 148 deletions
|
@ -1432,6 +1432,11 @@ td::Status ValidatorEngine::load_global_config() {
|
|||
if (celldb_cache_size_) {
|
||||
validator_options_.write().set_celldb_cache_size(celldb_cache_size_.value());
|
||||
}
|
||||
if (!celldb_cache_size_ || celldb_cache_size_.value() < (30ULL << 30)) {
|
||||
celldb_direct_io_ = false;
|
||||
}
|
||||
validator_options_.write().set_celldb_direct_io(celldb_direct_io_);
|
||||
validator_options_.write().set_celldb_preload_all(celldb_preload_all_);
|
||||
if (catchain_max_block_delay_) {
|
||||
validator_options_.write().set_catchain_max_block_delay(catchain_max_block_delay_.value());
|
||||
}
|
||||
|
@ -4285,8 +4290,7 @@ int main(int argc, char *argv[]) {
|
|||
acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_nonfinal_ls_queries_enabled); });
|
||||
});
|
||||
p.add_checked_option(
|
||||
'\0', "celldb-cache-size",
|
||||
"block cache size for RocksDb in CellDb, in bytes (default: 1G cache shared by archive DB)",
|
||||
'\0', "celldb-cache-size", "block cache size for RocksDb in CellDb, in bytes (default: 50G)",
|
||||
[&](td::Slice s) -> td::Status {
|
||||
TRY_RESULT(v, td::to_integer_safe<td::uint64>(s));
|
||||
if (v == 0) {
|
||||
|
@ -4295,6 +4299,13 @@ int main(int argc, char *argv[]) {
|
|||
acts.push_back([&x, v]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_cache_size, v); });
|
||||
return td::Status::OK();
|
||||
});
|
||||
p.add_option(
|
||||
'\0', "celldb-no-direct-io", "disable direct I/O mode for RocksDb in CellDb (forced when celldb cache is < 30G)",
|
||||
[&]() { acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_direct_io, false); }); });
|
||||
p.add_option(
|
||||
'\0', "celldb-no-preload-all",
|
||||
"disable preloading all cells from CellDb on startup (enabled by default)",
|
||||
[&]() { acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_preload_all, false); }); });
|
||||
p.add_checked_option(
|
||||
'\0', "catchain-max-block-delay", "delay before creating a new catchain block, in seconds (default: 0.5)",
|
||||
[&](td::Slice s) -> td::Status {
|
||||
|
|
|
@ -223,7 +223,9 @@ class ValidatorEngine : public td::actor::Actor {
|
|||
double archive_preload_period_ = 0.0;
|
||||
bool disable_rocksdb_stats_ = false;
|
||||
bool nonfinal_ls_queries_enabled_ = false;
|
||||
td::optional<td::uint64> celldb_cache_size_;
|
||||
td::optional<td::uint64> celldb_cache_size_ = 50LL << 30;
|
||||
bool celldb_direct_io_ = true;
|
||||
bool celldb_preload_all_ = true;
|
||||
td::optional<double> catchain_max_block_delay_;
|
||||
bool read_config_ = false;
|
||||
bool started_keyring_ = false;
|
||||
|
@ -303,6 +305,12 @@ class ValidatorEngine : public td::actor::Actor {
|
|||
void set_celldb_cache_size(td::uint64 value) {
|
||||
celldb_cache_size_ = value;
|
||||
}
|
||||
void set_celldb_direct_io(bool value) {
|
||||
celldb_direct_io_ = value;
|
||||
}
|
||||
void set_celldb_preload_all(bool value) {
|
||||
celldb_preload_all_ = value;
|
||||
}
|
||||
void set_catchain_max_block_delay(double value) {
|
||||
catchain_max_block_delay_ = value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue