mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add more info to session stats (#973)
* Improve validator session stats * Improve validator session stats Add got_submit_at, collation_cached, validation_cached. Fix stats cleanup. * Fix setting timestamp for cached blocks * Add serialize/deserialize time, serialized size to validator session stats, fix setting is_accepted --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
d2b012c883
commit
9a543c6b28
10 changed files with 309 additions and 68 deletions
|
|
@ -56,6 +56,12 @@ class ValidatorSession : public td::actor::Actor {
|
|||
td::BufferSlice proof() const {
|
||||
return proof_.clone();
|
||||
}
|
||||
bool is_cached() const {
|
||||
return is_cached_;
|
||||
}
|
||||
void set_is_cached(bool value = true) {
|
||||
is_cached_ = value;
|
||||
}
|
||||
CandidateDecision(td::uint32 ok_from) {
|
||||
ok_ = true;
|
||||
ok_from_ = ok_from;
|
||||
|
|
@ -69,6 +75,12 @@ class ValidatorSession : public td::actor::Actor {
|
|||
td::uint32 ok_from_ = 0;
|
||||
std::string reason_;
|
||||
td::BufferSlice proof_;
|
||||
bool is_cached_ = false;
|
||||
};
|
||||
|
||||
struct GeneratedCandidate {
|
||||
BlockCandidate candidate;
|
||||
bool is_cached = false;
|
||||
};
|
||||
|
||||
class Callback {
|
||||
|
|
@ -76,7 +88,7 @@ class ValidatorSession : public td::actor::Actor {
|
|||
virtual void on_candidate(td::uint32 round, PublicKey source, ValidatorSessionRootHash root_hash,
|
||||
td::BufferSlice data, td::BufferSlice collated_data,
|
||||
td::Promise<CandidateDecision> promise) = 0;
|
||||
virtual void on_generate_slot(td::uint32 round, td::Promise<BlockCandidate> promise) = 0;
|
||||
virtual void on_generate_slot(td::uint32 round, td::Promise<GeneratedCandidate> promise) = 0;
|
||||
virtual void on_block_committed(td::uint32 round, PublicKey source, ValidatorSessionRootHash root_hash,
|
||||
ValidatorSessionFileHash file_hash, td::BufferSlice data,
|
||||
std::vector<std::pair<PublicKeyHash, td::BufferSlice>> signatures,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue