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

Add --fast-state-serializer flag and responding to AdnlMessageCreateChannel with Nop (#1096)

* Add --fast-state-serializer and tools for jemalloc

* Disable fast state serializer by default unless RAM is >= 90GB
* Print jemalloc stats once a minute
* Dump jemalloc profile on request

* Respond to AdnlMessageCreateChannel with Nop

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2024-08-07 14:25:45 +03:00 committed by GitHub
parent 8714477ccb
commit e985ac0358
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 166 additions and 2 deletions

View file

@ -253,6 +253,9 @@ class CachedCellDbReader : public vm::CellDbReader {
};
void AsyncStateSerializer::prepare_previous_state_cache(ShardIdFull shard) {
if (!opts_->get_fast_state_serializer_enabled()) {
return;
}
std::vector<ShardIdFull> prev_shards;
for (const auto& [_, prev_shard] : previous_state_files_) {
if (shard_intersects(shard, prev_shard)) {

View file

@ -147,6 +147,9 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
td::Ref<CollatorOptions> get_collator_options() const override {
return collator_options_;
}
bool get_fast_state_serializer_enabled() const override {
return fast_state_serializer_enabled_;
}
void set_zero_block_id(BlockIdExt block_id) override {
zero_block_id_ = block_id;
@ -233,6 +236,9 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
void set_collator_options(td::Ref<CollatorOptions> value) override {
collator_options_ = std::move(value);
}
void set_fast_state_serializer_enabled(bool value) override {
fast_state_serializer_enabled_ = value;
}
ValidatorManagerOptionsImpl *make_copy() const override {
return new ValidatorManagerOptionsImpl(*this);
@ -286,6 +292,7 @@ struct ValidatorManagerOptionsImpl : public ValidatorManagerOptions {
td::optional<double> catchain_max_block_delay_;
bool state_serializer_enabled_ = true;
td::Ref<CollatorOptions> collator_options_{true};
bool fast_state_serializer_enabled_ = false;
};
} // namespace validator

View file

@ -107,6 +107,7 @@ struct ValidatorManagerOptions : public td::CntObject {
virtual td::optional<double> get_catchain_max_block_delay() const = 0;
virtual bool get_state_serializer_enabled() const = 0;
virtual td::Ref<CollatorOptions> get_collator_options() const = 0;
virtual bool get_fast_state_serializer_enabled() const = 0;
virtual void set_zero_block_id(BlockIdExt block_id) = 0;
virtual void set_init_block_id(BlockIdExt block_id) = 0;
@ -137,6 +138,7 @@ struct ValidatorManagerOptions : public td::CntObject {
virtual void set_catchain_max_block_delay(double value) = 0;
virtual void set_state_serializer_enabled(bool value) = 0;
virtual void set_collator_options(td::Ref<CollatorOptions> value) = 0;
virtual void set_fast_state_serializer_enabled(bool value) = 0;
static td::Ref<ValidatorManagerOptions> create(
BlockIdExt zero_block_id, BlockIdExt init_block_id,