mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Merge pull request #689 from ton-blockchain/isolated-queue-update
Isolated queue update
This commit is contained in:
commit
6b0968097a
3 changed files with 11 additions and 3 deletions
|
@ -73,7 +73,7 @@ class Collator final : public td::actor::Actor {
|
||||||
Ref<ValidatorSet> validator_set_;
|
Ref<ValidatorSet> validator_set_;
|
||||||
td::actor::ActorId<ValidatorManager> manager;
|
td::actor::ActorId<ValidatorManager> manager;
|
||||||
td::Timestamp timeout;
|
td::Timestamp timeout;
|
||||||
td::Timestamp soft_timeout_, medium_timeout_;
|
td::Timestamp queue_cleanup_timeout_, soft_timeout_, medium_timeout_;
|
||||||
td::Promise<BlockCandidate> main_promise;
|
td::Promise<BlockCandidate> main_promise;
|
||||||
ton::BlockSeqno last_block_seqno{0};
|
ton::BlockSeqno last_block_seqno{0};
|
||||||
ton::BlockSeqno prev_mc_block_seqno{0};
|
ton::BlockSeqno prev_mc_block_seqno{0};
|
||||||
|
|
|
@ -67,6 +67,8 @@ Collator::Collator(ShardIdFull shard, bool is_hardfork, UnixTime min_ts, BlockId
|
||||||
, validator_set_(std::move(validator_set))
|
, validator_set_(std::move(validator_set))
|
||||||
, manager(manager)
|
, manager(manager)
|
||||||
, timeout(timeout)
|
, timeout(timeout)
|
||||||
|
// default timeout is 10 seconds, declared in validator/validator-group.cpp:generate_block_candidate:run_collate_query
|
||||||
|
, queue_cleanup_timeout_(td::Timestamp::at(timeout.at() - 5.0))
|
||||||
, soft_timeout_(td::Timestamp::at(timeout.at() - 3.0))
|
, soft_timeout_(td::Timestamp::at(timeout.at() - 3.0))
|
||||||
, medium_timeout_(td::Timestamp::at(timeout.at() - 1.5))
|
, medium_timeout_(td::Timestamp::at(timeout.at() - 1.5))
|
||||||
, main_promise(std::move(promise))
|
, main_promise(std::move(promise))
|
||||||
|
@ -1814,6 +1816,11 @@ bool Collator::out_msg_queue_cleanup() {
|
||||||
auto res = out_msg_queue_->filter([&](vm::CellSlice& cs, td::ConstBitPtr key, int n) -> int {
|
auto res = out_msg_queue_->filter([&](vm::CellSlice& cs, td::ConstBitPtr key, int n) -> int {
|
||||||
assert(n == 352);
|
assert(n == 352);
|
||||||
// LOG(DEBUG) << "key is " << key.to_hex(n);
|
// LOG(DEBUG) << "key is " << key.to_hex(n);
|
||||||
|
if (queue_cleanup_timeout_.is_in_past(td::Timestamp::now())) {
|
||||||
|
LOG(WARNING) << "cleaning up outbound queue takes too long, ending";
|
||||||
|
outq_cleanup_partial_ = true;
|
||||||
|
return (1 << 30) + 1; // retain all remaining outbound queue entries including this one without processing
|
||||||
|
}
|
||||||
if (block_full_) {
|
if (block_full_) {
|
||||||
LOG(WARNING) << "BLOCK FULL while cleaning up outbound queue, cleanup completed only partially";
|
LOG(WARNING) << "BLOCK FULL while cleaning up outbound queue, cleanup completed only partially";
|
||||||
outq_cleanup_partial_ = true;
|
outq_cleanup_partial_ = true;
|
||||||
|
|
|
@ -5540,9 +5540,10 @@ bool ValidateQuery::try_validate() {
|
||||||
if (!check_in_queue()) {
|
if (!check_in_queue()) {
|
||||||
return reject_query("cannot check inbound message queues");
|
return reject_query("cannot check inbound message queues");
|
||||||
}
|
}
|
||||||
if (!check_delivered_dequeued()) {
|
// Excessive check: validity of message in queue is checked elsewhere
|
||||||
|
/*if (!check_delivered_dequeued()) {
|
||||||
return reject_query("cannot check delivery status of all outbound messages");
|
return reject_query("cannot check delivery status of all outbound messages");
|
||||||
}
|
}*/
|
||||||
if (!check_transactions()) {
|
if (!check_transactions()) {
|
||||||
return reject_query("invalid collection of account transactions in ShardAccountBlocks");
|
return reject_query("invalid collection of account transactions in ShardAccountBlocks");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue