mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Improve handling outbound message queues (#825)
* Improve handling outbound message queues * Cleanup queue faster * Calculate queue sizes in background * Force or limit split/merge depending on queue size * Increase validate_ref limit for transaction * Add all changes of public libraries to block size estimation * Don't crash on timeout in GC * Don't import external messages when queue is too big --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
3a595ce849
commit
5e6b67ae96
16 changed files with 727 additions and 111 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "state-serializer.hpp"
|
||||
#include "rldp/rldp.h"
|
||||
#include "token-manager.h"
|
||||
#include "queue-size-counter.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
@ -548,6 +549,18 @@ class ValidatorManagerImpl : public ValidatorManager {
|
|||
|
||||
void log_validator_session_stats(BlockIdExt block_id, validatorsession::ValidatorSessionStats stats) override;
|
||||
|
||||
void get_out_msg_queue_size(BlockIdExt block_id, td::Promise<td::uint32> promise) override {
|
||||
if (queue_size_counter_.empty()) {
|
||||
if (last_masterchain_state_.is_null()) {
|
||||
promise.set_error(td::Status::Error(ErrorCode::notready, "not ready"));
|
||||
return;
|
||||
}
|
||||
queue_size_counter_ = td::actor::create_actor<QueueSizeCounter>("queuesizecounter",
|
||||
last_masterchain_state_, actor_id(this));
|
||||
}
|
||||
td::actor::send_closure(queue_size_counter_, &QueueSizeCounter::get_queue_size, block_id, std::move(promise));
|
||||
}
|
||||
|
||||
private:
|
||||
td::Timestamp resend_shard_blocks_at_;
|
||||
td::Timestamp check_waiters_at_;
|
||||
|
@ -612,6 +625,7 @@ class ValidatorManagerImpl : public ValidatorManager {
|
|||
|
||||
private:
|
||||
std::map<BlockSeqno, WaitList<td::actor::Actor, td::Unit>> shard_client_waiters_;
|
||||
td::actor::ActorOwn<QueueSizeCounter> queue_size_counter_;
|
||||
};
|
||||
|
||||
} // namespace validator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue