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

"getcollatoroptionsjson" command in validator console (#1059)

* "getcollatoroptionsjson" command in validator console

* Improve state serializer

Use previous persistent state to speed up reading
This commit is contained in:
SpyCheese 2024-07-17 15:10:55 +03:00 committed by GitHub
parent 00cd053dbc
commit b9e89d4c66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 353 additions and 80 deletions

View file

@ -308,6 +308,11 @@ void ValidatorManagerImpl::get_persistent_state_slice(BlockIdExt block_id, Block
std::move(promise));
}
void ValidatorManagerImpl::get_previous_persistent_state_files(
BlockSeqno cur_mc_seqno, td::Promise<std::vector<std::pair<std::string, ShardIdFull>>> promise) {
td::actor::send_closure(db_, &Db::get_previous_persistent_state_files, cur_mc_seqno, std::move(promise));
}
void ValidatorManagerImpl::get_block_proof(BlockHandle handle, td::Promise<td::BufferSlice> promise) {
auto P = td::PromiseCreator::lambda([promise = std::move(promise)](td::Result<td::Ref<Proof>> R) mutable {
if (R.is_error()) {
@ -1714,6 +1719,8 @@ void ValidatorManagerImpl::read_gc_list(std::vector<ValidatorSessionId> list) {
serializer_ =
td::actor::create_actor<AsyncStateSerializer>("serializer", last_key_block_handle_->id(), opts_, actor_id(this));
td::actor::send_closure(serializer_, &AsyncStateSerializer::update_last_known_key_block_ts,
last_key_block_handle_->unix_time());
if (last_masterchain_block_handle_->inited_next_left()) {
auto b = last_masterchain_block_handle_->one_next(true);
@ -1903,6 +1910,8 @@ void ValidatorManagerImpl::new_masterchain_block() {
last_known_key_block_handle_ = last_key_block_handle_;
callback_->new_key_block(last_key_block_handle_);
}
td::actor::send_closure(serializer_, &AsyncStateSerializer::update_last_known_key_block_ts,
last_key_block_handle_->unix_time());
}
update_shards();