mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add CollatorNode and make validators request blocks from it
This commit is contained in:
parent
996c23e506
commit
53270a00e6
25 changed files with 577 additions and 33 deletions
|
@ -248,9 +248,11 @@ void ShardClient::get_processed_masterchain_block_id(td::Promise<BlockIdExt> pro
|
|||
|
||||
void ShardClient::build_shard_overlays() {
|
||||
auto v = masterchain_state_->get_shards();
|
||||
std::set<WorkchainId> workchains;
|
||||
|
||||
for (auto &x : v) {
|
||||
auto shard = x->shard();
|
||||
workchains.insert(shard.workchain);
|
||||
if (opts_->need_monitor(shard)) {
|
||||
auto d = masterchain_state_->soft_min_split_depth(shard.workchain);
|
||||
auto l = shard_prefix_length(shard.shard);
|
||||
|
@ -264,6 +266,20 @@ void ShardClient::build_shard_overlays() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto &wpair : masterchain_state_->get_workchain_list()) {
|
||||
ton::WorkchainId wc = wpair.first;
|
||||
const block::WorkchainInfo *winfo = wpair.second.get();
|
||||
if (workchains.count(wc) == 0 && winfo->active && winfo->enabled_since <= masterchain_state_->get_unix_time()) {
|
||||
auto shard = ShardIdFull(wc);
|
||||
if (opts_->need_monitor(shard) && created_overlays_.count(shard) == 0) {
|
||||
td::actor::send_closure(manager_, &ValidatorManager::subscribe_to_shard, shard);
|
||||
BlockIdExt block_id(shard.workchain, shard.shard, 0, winfo->zerostate_root_hash, winfo->zerostate_file_hash);
|
||||
td::actor::send_closure_later(manager_, &ValidatorManager::wait_block_state_short, block_id, 0,
|
||||
td::Timestamp::in(5.0), [](td::Result<td::Ref<ShardState>>) {});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShardClient::force_update_shard_client(BlockHandle handle, td::Promise<td::Unit> promise) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue