mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Out msg queues: improve logs, various small changes
This commit is contained in:
parent
3dce9d11d9
commit
5d79855c94
9 changed files with 106 additions and 79 deletions
|
@ -798,7 +798,9 @@ void ValidatorManagerImpl::wait_neighbor_msg_queue_proofs(
|
|||
if (dst_shard.is_masterchain()) {
|
||||
// We spit queries for masterchain {dst_shard, {block_1, ..., block_n}} into separate queries
|
||||
// {dst_shard, {block_1}}, ..., {dst_shard, {block_n}}
|
||||
// Also, use cache
|
||||
// Also, use cache.
|
||||
// This is performed here and not in OutMsgQueueImporter because it's important to use
|
||||
// cached_msg_queue_to_masterchain_, which is related to the current list of shard block descriptions
|
||||
class Worker : public td::actor::Actor {
|
||||
public:
|
||||
Worker(size_t pending, td::Promise<std::map<BlockIdExt, td::Ref<OutMsgQueueProof>>> promise)
|
||||
|
@ -2958,12 +2960,15 @@ PublicKeyHash ValidatorManagerImpl::get_validator(ShardIdFull shard, td::Ref<Val
|
|||
}
|
||||
|
||||
bool ValidatorManagerImpl::is_shard_collator(ShardIdFull shard) {
|
||||
if (shard.is_masterchain()) {
|
||||
return validating_masterchain();
|
||||
}
|
||||
for (auto &[_, collator_node] : collator_nodes_) {
|
||||
if (collator_node.can_collate_shard(shard)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return is_validator() && opts_->get_collators_list()->self_collate;
|
||||
}
|
||||
|
||||
bool ValidatorManagerImpl::Collator::can_collate_shard(ShardIdFull shard) const {
|
||||
|
@ -3524,7 +3529,7 @@ void ValidatorManagerImpl::del_collator(adnl::AdnlNodeIdShort id, ShardIdFull sh
|
|||
} else {
|
||||
td::actor::send_closure(it->second.actor, &CollatorNode::del_shard, shard);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void ValidatorManagerImpl::get_collation_manager_stats(
|
||||
td::Promise<tl_object_ptr<ton_api::engine_validator_collationManagerStats>> promise) {
|
||||
|
@ -3575,15 +3580,18 @@ void ValidatorManagerImpl::get_collation_manager_stats(
|
|||
}
|
||||
|
||||
void ValidatorManagerImpl::add_out_msg_queue_proof(ShardIdFull dst_shard, td::Ref<OutMsgQueueProof> proof) {
|
||||
if (!collator_nodes_.empty()) {
|
||||
if (is_shard_collator(dst_shard)) {
|
||||
if (out_msg_queue_importer_.empty()) {
|
||||
out_msg_queue_importer_ = td::actor::create_actor<OutMsgQueueImporter>("outmsgqueueimporter", actor_id(this),
|
||||
opts_, last_masterchain_state_);
|
||||
}
|
||||
td::actor::send_closure(out_msg_queue_importer_, &OutMsgQueueImporter::add_out_msg_queue_proof, dst_shard,
|
||||
std::move(proof));
|
||||
} else {
|
||||
VLOG(VALIDATOR_DEBUG) << "Dropping unneeded out msg queue proof to shard " << dst_shard.to_str();
|
||||
}
|
||||
}
|
||||
|
||||
void ValidatorManagerImpl::add_persistent_state_description(td::Ref<PersistentStateDescription> desc) {
|
||||
auto now = (UnixTime)td::Clocks::system();
|
||||
if (desc->end_time <= now) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue