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

Disable state serializer on masterchain validators (#1129)

This commit is contained in:
SpyCheese 2024-08-27 18:10:17 +03:00 committed by GitHub
parent 16a2ced4d3
commit 6038147afe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 64 additions and 33 deletions

View file

@ -37,6 +37,7 @@ class AsyncStateSerializer : public td::actor::Actor {
bool saved_to_db_ = true;
td::Ref<ValidatorManagerOptions> opts_;
bool auto_disabled_ = false;
td::CancellationTokenSource cancellation_token_source_;
UnixTime last_known_key_block_ts_ = 0;
@ -48,11 +49,14 @@ class AsyncStateSerializer : public td::actor::Actor {
bool have_masterchain_state_ = false;
std::vector<BlockIdExt> shards_;
std::vector<std::pair<std::string, ShardIdFull>> previous_state_files_;
std::shared_ptr<std::map<td::Bits256, td::Ref<vm::Cell>>> previous_state_cache_;
std::vector<ShardIdFull> previous_state_cur_shards_;
struct PreviousStateCache {
std::vector<std::pair<std::string, ShardIdFull>> state_files;
std::shared_ptr<std::map<td::Bits256, td::Ref<vm::Cell>>> cache;
std::vector<ShardIdFull> cur_shards;
void prepare_previous_state_cache(ShardIdFull shard);
void prepare_cache(ShardIdFull shard);
};
std::shared_ptr<PreviousStateCache> previous_state_cache_;
public:
AsyncStateSerializer(BlockIdExt block_id, td::Ref<ValidatorManagerOptions> opts,
@ -105,6 +109,7 @@ class AsyncStateSerializer : public td::actor::Actor {
void success_handler();
void update_options(td::Ref<ValidatorManagerOptions> opts);
void auto_disable_serializer(bool disabled);
};
} // namespace validator