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

Add "lastgcdmasterchainstate" to validator stats (#1154)

This commit is contained in:
SpyCheese 2024-09-05 13:04:57 +03:00 committed by GitHub
parent e35b34de22
commit cb69f307e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 39 additions and 0 deletions

View file

@ -188,12 +188,17 @@ void CellDbIn::store_cell(BlockIdExt block_id, td::Ref<vm::Cell> cell, td::Promi
if (!opts_->get_disable_rocksdb_stats()) {
cell_db_statistics_.store_cell_time_.insert(timer.elapsed() * 1e6);
}
LOG(DEBUG) << "Stored state " << block_id.to_str();
}
void CellDbIn::get_cell_db_reader(td::Promise<std::shared_ptr<vm::CellDbReader>> promise) {
promise.set_result(boc_->get_cell_db_reader());
}
void CellDbIn::get_last_deleted_mc_state(td::Promise<BlockSeqno> promise) {
promise.set_result(last_deleted_mc_state_);
}
void CellDbIn::flush_db_stats() {
if (opts_->get_disable_rocksdb_stats()) {
return;
@ -320,6 +325,10 @@ void CellDbIn::gc_cont2(BlockHandle handle) {
if (!opts_->get_disable_rocksdb_stats()) {
cell_db_statistics_.gc_cell_time_.insert(timer.elapsed() * 1e6);
}
if (handle->id().is_masterchain()) {
last_deleted_mc_state_ = handle->id().seqno();
}
LOG(DEBUG) << "Deleted state " << handle->id().to_str();
}
void CellDbIn::skip_gc() {
@ -453,6 +462,10 @@ void CellDb::get_cell_db_reader(td::Promise<std::shared_ptr<vm::CellDbReader>> p
td::actor::send_closure(cell_db_, &CellDbIn::get_cell_db_reader, std::move(promise));
}
void CellDb::get_last_deleted_mc_state(td::Promise<BlockSeqno> promise) {
td::actor::send_closure(cell_db_, &CellDbIn::get_last_deleted_mc_state, std::move(promise));
}
void CellDb::start_up() {
CellDbBase::start_up();
boc_ = vm::DynamicBagOfCellsDb::create();