mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Merge branch 'testnet' into block-generation
This commit is contained in:
commit
a2eb3f3631
45 changed files with 1101 additions and 202 deletions
|
@ -403,6 +403,7 @@ void ValidatorManagerImpl::add_external_message(td::Ref<ExtMessage> msg) {
|
|||
}
|
||||
}
|
||||
void ValidatorManagerImpl::check_external_message(td::BufferSlice data, td::Promise<td::Ref<ExtMessage>> promise) {
|
||||
++ls_stats_check_ext_messages_;
|
||||
auto state = do_get_last_liteserver_state();
|
||||
if (state.is_null()) {
|
||||
promise.set_error(td::Status::Error(ErrorCode::notready, "not ready"));
|
||||
|
@ -1299,7 +1300,7 @@ void ValidatorManagerImpl::write_handle(BlockHandle handle, td::Promise<td::Unit
|
|||
void ValidatorManagerImpl::written_handle(BlockHandle handle, td::Promise<td::Unit> promise) {
|
||||
bool received = handle->received();
|
||||
bool inited_state = handle->received_state();
|
||||
bool inited_proof = handle->inited_proof();
|
||||
bool inited_proof = handle->id().is_masterchain() ? handle->inited_proof() : handle->inited_proof_link();
|
||||
|
||||
if (handle->need_flush()) {
|
||||
handle->flush(actor_id(this), handle, std::move(promise));
|
||||
|
@ -1312,11 +1313,24 @@ void ValidatorManagerImpl::written_handle(BlockHandle handle, td::Promise<td::Un
|
|||
td::actor::send_closure(it->second.actor_, &WaitBlockData::force_read_from_db);
|
||||
}
|
||||
}
|
||||
if (inited_state && inited_proof) {
|
||||
if (inited_state) {
|
||||
auto it = wait_state_.find(handle->id());
|
||||
if (it != wait_state_.end()) {
|
||||
td::actor::send_closure(it->second.actor_, &WaitBlockState::force_read_from_db);
|
||||
}
|
||||
} else {
|
||||
if (handle->inited_proof_link()) {
|
||||
auto it = wait_state_.find(handle->id());
|
||||
if (it != wait_state_.end()) {
|
||||
td::actor::send_closure(it->second.actor_, &WaitBlockState::after_get_proof_link);
|
||||
}
|
||||
}
|
||||
if (handle->id().is_masterchain() && handle->inited_proof()) {
|
||||
auto it = wait_state_.find(handle->id());
|
||||
if (it != wait_state_.end()) {
|
||||
td::actor::send_closure(it->second.actor_, &WaitBlockState::after_get_proof);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
promise.set_value(td::Unit());
|
||||
|
@ -2551,9 +2565,9 @@ void ValidatorManagerImpl::state_serializer_update(BlockSeqno seqno) {
|
|||
void ValidatorManagerImpl::alarm() {
|
||||
try_advance_gc_masterchain_block();
|
||||
alarm_timestamp() = td::Timestamp::in(1.0);
|
||||
if (gc_masterchain_handle_) {
|
||||
td::actor::send_closure(db_, &Db::run_gc, gc_masterchain_handle_->unix_time(),
|
||||
static_cast<UnixTime>(opts_->archive_ttl()));
|
||||
if (last_masterchain_block_handle_ && gc_masterchain_handle_) {
|
||||
td::actor::send_closure(db_, &Db::run_gc, last_masterchain_block_handle_->unix_time(),
|
||||
gc_masterchain_handle_->unix_time(), static_cast<UnixTime>(opts_->archive_ttl()));
|
||||
}
|
||||
if (log_status_at_.is_in_past()) {
|
||||
if (last_masterchain_block_handle_) {
|
||||
|
@ -2633,6 +2647,29 @@ void ValidatorManagerImpl::alarm() {
|
|||
}
|
||||
}
|
||||
alarm_timestamp().relax(check_shard_clients_);
|
||||
|
||||
if (log_ls_stats_at_.is_in_past()) {
|
||||
if (!ls_stats_.empty() || ls_stats_check_ext_messages_ != 0) {
|
||||
td::StringBuilder sb;
|
||||
sb << "Liteserver stats (1 minute):";
|
||||
td::uint32 total = 0;
|
||||
for (const auto &p : ls_stats_) {
|
||||
sb << " " << lite_query_name_by_id(p.first) << ":" << p.second;
|
||||
total += p.second;
|
||||
}
|
||||
if (total > 0) {
|
||||
sb << " TOTAL:" << total;
|
||||
}
|
||||
if (ls_stats_check_ext_messages_ > 0) {
|
||||
sb << " checkExtMessage:" << ls_stats_check_ext_messages_;
|
||||
}
|
||||
LOG(WARNING) << sb.as_cslice();
|
||||
}
|
||||
ls_stats_.clear();
|
||||
ls_stats_check_ext_messages_ = 0;
|
||||
log_ls_stats_at_ = td::Timestamp::in(60.0);
|
||||
}
|
||||
alarm_timestamp().relax(log_ls_stats_at_);
|
||||
}
|
||||
|
||||
void ValidatorManagerImpl::update_shard_client_state(BlockIdExt masterchain_block_id, td::Promise<td::Unit> promise) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue