mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
tonNode.getOutMsgQueueProof query in public shard overlays (#1413)
* tonNode.getOutMsgQueueProof query in public shard overlays * Allow responding to getOutMsgQueueProof requests one at a time only
This commit is contained in:
parent
9ae88d87e3
commit
7bc50e63d7
37 changed files with 729 additions and 51 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "td/actor/MultiPromise.h"
|
||||
#include "full-node.h"
|
||||
#include "common/delay.h"
|
||||
#include "impl/out-msg-queue-proof.hpp"
|
||||
#include "td/utils/Random.h"
|
||||
#include "ton/ton-tl.hpp"
|
||||
|
||||
|
@ -430,6 +431,24 @@ void FullNodeImpl::download_archive(BlockSeqno masterchain_seqno, ShardIdFull sh
|
|||
timeout, std::move(promise));
|
||||
}
|
||||
|
||||
void FullNodeImpl::download_out_msg_queue_proof(ShardIdFull dst_shard, std::vector<BlockIdExt> blocks,
|
||||
block::ImportedMsgQueueLimits limits, td::Timestamp timeout,
|
||||
td::Promise<std::vector<td::Ref<OutMsgQueueProof>>> promise) {
|
||||
if (blocks.empty()) {
|
||||
promise.set_value({});
|
||||
return;
|
||||
}
|
||||
// All blocks are expected to have the same minsplit shard prefix
|
||||
auto shard = get_shard(blocks[0].shard_full());
|
||||
if (shard.empty()) {
|
||||
VLOG(FULL_NODE_WARNING) << "dropping download msg queue query to unknown shard";
|
||||
promise.set_error(td::Status::Error(ErrorCode::notready, "shard not ready"));
|
||||
return;
|
||||
}
|
||||
td::actor::send_closure(shard, &FullNodeShard::download_out_msg_queue_proof, dst_shard, std::move(blocks), limits,
|
||||
timeout, std::move(promise));
|
||||
}
|
||||
|
||||
td::actor::ActorId<FullNodeShard> FullNodeImpl::get_shard(ShardIdFull shard) {
|
||||
if (shard.is_masterchain()) {
|
||||
return shards_[ShardIdFull{masterchainId}].actor.get();
|
||||
|
@ -557,6 +576,11 @@ void FullNodeImpl::process_block_candidate_broadcast(BlockIdExt block_id, Catcha
|
|||
std::move(data));
|
||||
}
|
||||
|
||||
void FullNodeImpl::get_out_msg_queue_query_token(td::Promise<std::unique_ptr<ActionToken>> promise) {
|
||||
td::actor::send_closure(out_msg_queue_query_token_manager_, &TokenManager::get_token, 1, 0, td::Timestamp::in(10.0),
|
||||
std::move(promise));
|
||||
}
|
||||
|
||||
void FullNodeImpl::set_validator_telemetry_filename(std::string value) {
|
||||
validator_telemetry_filename_ = std::move(value);
|
||||
update_validator_telemetry_collector();
|
||||
|
@ -645,6 +669,12 @@ void FullNodeImpl::start_up() {
|
|||
td::actor::send_closure(id_, &FullNodeImpl::download_archive, masterchain_seqno, shard_prefix, std::move(tmp_dir),
|
||||
timeout, std::move(promise));
|
||||
}
|
||||
void download_out_msg_queue_proof(ShardIdFull dst_shard, std::vector<BlockIdExt> blocks,
|
||||
block::ImportedMsgQueueLimits limits, td::Timestamp timeout,
|
||||
td::Promise<std::vector<td::Ref<OutMsgQueueProof>>> promise) override {
|
||||
td::actor::send_closure(id_, &FullNodeImpl::download_out_msg_queue_proof, dst_shard, std::move(blocks), limits,
|
||||
timeout, std::move(promise));
|
||||
}
|
||||
|
||||
void new_key_block(BlockHandle handle) override {
|
||||
td::actor::send_closure(id_, &FullNodeImpl::new_key_block, std::move(handle));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue