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

Improve validator session stats (#1117)

* Improve validator session stats

* Collator stats: block limits, number of processed external messages
* Collator and validator work time
* Last key block seqno
* Approvers and signers

* End validator session stats
This commit is contained in:
SpyCheese 2024-08-20 19:54:16 +03:00 committed by EmelyanenkoK
parent b70090dae3
commit dc26c3be67
21 changed files with 373 additions and 27 deletions

View file

@ -96,6 +96,7 @@ class CatChain : public td::actor::Actor {
virtual void send_query_via(const PublicKeyHash &dst, std::string name, td::Promise<td::BufferSlice> promise,
td::Timestamp timeout, td::BufferSlice query, td::uint64 max_answer_size,
td::actor::ActorId<adnl::AdnlSenderInterface> via) = 0;
virtual void get_source_heights(td::Promise<std::vector<CatChainBlockHeight>> promise) = 0;
virtual void destroy() = 0;
static td::actor::ActorOwn<CatChain> create(std::unique_ptr<Callback> callback, const CatChainOptions &opts,

View file

@ -115,6 +115,15 @@ class CatChainImpl : public CatChain {
td::actor::send_closure(receiver_, &CatChainReceiverInterface::send_custom_query_data_via, dst, name,
std::move(promise), timeout, std::move(query), max_answer_size, via);
}
void get_source_heights(td::Promise<std::vector<CatChainBlockHeight>> promise) override {
std::vector<CatChainBlockHeight> heights(top_source_blocks_.size(), 0);
for (size_t i = 0; i < top_source_blocks_.size(); ++i) {
if (top_source_blocks_[i]) {
heights[i] = top_source_blocks_[i]->height();
}
}
promise.set_result(std::move(heights));
}
void destroy() override;
CatChainImpl(std::unique_ptr<Callback> callback, const CatChainOptions &opts,
td::actor::ActorId<keyring::Keyring> keyring, td::actor::ActorId<adnl::Adnl> adnl,