1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

func/fift: bugfixes

This commit is contained in:
ton 2019-10-09 20:00:54 +04:00
parent f67f5d879b
commit 38c3e39066
41 changed files with 248 additions and 99 deletions

View file

@ -596,17 +596,17 @@ void FullNodeShardImpl::download_block(BlockIdExt id, td::uint32 priority, td::T
void FullNodeShardImpl::download_zero_state(BlockIdExt id, td::uint32 priority, td::Timestamp timeout,
td::Promise<td::BufferSlice> promise) {
td::actor::create_actor<DownloadState>("downloadstatereq", id, BlockIdExt{}, adnl_id_, overlay_id_,
adnl::AdnlNodeIdShort::zero(), priority, timeout, validator_manager_, rldp_,
overlays_, adnl_, client_, std::move(promise))
td::actor::create_actor<DownloadState>(PSTRING() << "downloadstatereq" << id.id.to_str(), id, BlockIdExt{}, adnl_id_,
overlay_id_, adnl::AdnlNodeIdShort::zero(), priority, timeout,
validator_manager_, rldp_, overlays_, adnl_, client_, std::move(promise))
.release();
}
void FullNodeShardImpl::download_persistent_state(BlockIdExt id, BlockIdExt masterchain_block_id, td::uint32 priority,
td::Timestamp timeout, td::Promise<td::BufferSlice> promise) {
td::actor::create_actor<DownloadState>("downloadstatereq", id, masterchain_block_id, adnl_id_, overlay_id_,
adnl::AdnlNodeIdShort::zero(), priority, timeout, validator_manager_, rldp_,
overlays_, adnl_, client_, std::move(promise))
td::actor::create_actor<DownloadState>(PSTRING() << "downloadstatereq" << id.id.to_str(), id, masterchain_block_id,
adnl_id_, overlay_id_, adnl::AdnlNodeIdShort::zero(), priority, timeout,
validator_manager_, rldp_, overlays_, adnl_, client_, std::move(promise))
.release();
}

View file

@ -32,6 +32,7 @@ namespace ton {
namespace validator {
void ValidatorManagerMasterchainReiniter::start_up() {
LOG(INFO) << "init_block_id=" << block_id_;
CHECK(block_id_.is_masterchain());
CHECK(block_id_.id.shard == shardIdAll);
CHECK(block_id_.seqno() >= opts_->get_last_fork_masterchain_seqno());
@ -83,7 +84,9 @@ void ValidatorManagerMasterchainReiniter::download_proof_link() {
auto P = td::PromiseCreator::lambda([SelfId = actor_id(this)](td::Result<td::BufferSlice> R) {
if (R.is_error()) {
LOG(WARNING) << "failed to download proof link: " << R.move_as_error();
td::actor::send_closure(SelfId, &ValidatorManagerMasterchainReiniter::download_proof_link);
delay_action(
[SelfId]() { td::actor::send_closure(SelfId, &ValidatorManagerMasterchainReiniter::download_proof_link); },
td::Timestamp::in(1.0));
} else {
td::actor::send_closure(SelfId, &ValidatorManagerMasterchainReiniter::downloaded_proof_link, R.move_as_ok());
}
@ -208,6 +211,10 @@ void ValidatorManagerMasterchainReiniter::choose_masterchain_state() {
p = key_blocks_[key_blocks_.size() - 2 - i];
}
LOG(INFO) << "key block candidate: seqno=" << h->id().seqno()
<< " is_persistent=" << (!p || ValidatorManager::is_persistent_state(h->unix_time(), p->unix_time()))
<< " ttl=" << ValidatorManager::persistent_state_ttl(h->unix_time())
<< " syncbefore=" << opts_->sync_blocks_before();
if (!p || ValidatorManager::is_persistent_state(h->unix_time(), p->unix_time())) {
auto ttl = ValidatorManager::persistent_state_ttl(h->unix_time());
if (ttl > td::Clocks::system() + opts_->sync_blocks_before()) {

View file

@ -172,12 +172,12 @@ void DownloadState::got_block_state_description(td::BufferSlice data) {
create_serialize_tl_object<ton_api::tonNode_downloadZeroState>(create_tl_block_id(block_id_));
if (client_.empty()) {
td::actor::send_closure(overlays_, &overlay::Overlays::send_query_via, download_from_, local_id_,
overlay_id_, "download state", std::move(P), timeout_, std::move(query),
FullNode::max_state_size(), rldp_);
overlay_id_, "download state", std::move(P), td::Timestamp::in(3.0),
std::move(query), FullNode::max_state_size(), rldp_);
} else {
td::actor::send_closure(client_, &adnl::AdnlExtClient::send_query, "download state",
create_serialize_tl_object_suffix<ton_api::tonNode_query>(std::move(query)),
timeout_, std::move(P));
td::Timestamp::in(3.0), std::move(P));
}
}));
}
@ -213,12 +213,12 @@ void DownloadState::got_block_state_part(td::BufferSlice data, td::uint32 reques
create_tl_block_id(block_id_), create_tl_block_id(masterchain_block_id_), sum_, part_size);
if (client_.empty()) {
td::actor::send_closure(overlays_, &overlay::Overlays::send_query_via, download_from_, local_id_, overlay_id_,
"download state", std::move(P), timeout_, std::move(query), FullNode::max_state_size(),
rldp_);
"download state", std::move(P), td::Timestamp::in(10.0), std::move(query),
FullNode::max_state_size(), rldp_);
} else {
td::actor::send_closure(client_, &adnl::AdnlExtClient::send_query, "download state",
create_serialize_tl_object_suffix<ton_api::tonNode_query>(std::move(query)), timeout_,
std::move(P));
create_serialize_tl_object_suffix<ton_api::tonNode_query>(std::move(query)),
td::Timestamp::in(10.0), std::move(P));
}
}