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

Send block broadcasts directly to collators

This commit is contained in:
SpyCheese 2022-09-27 16:33:27 +03:00
parent b0c2c6c525
commit 699a56b951
20 changed files with 143 additions and 26 deletions

View file

@ -127,6 +127,10 @@ void FullNodeShardImpl::create_overlay() {
if (cert_) {
td::actor::send_closure(overlays_, &overlay::Overlays::update_certificate, adnl_id_, overlay_id_, local_id_, cert_);
}
if (!collator_nodes_.empty()) {
td::actor::send_closure(overlays_, &overlay::Overlays::set_priority_broadcast_receivers, adnl_id_, overlay_id_,
collator_nodes_);
}
}
void FullNodeShardImpl::check_broadcast(PublicKeyHash src, td::BufferSlice broadcast, td::Promise<td::Unit> promise) {
@ -1031,6 +1035,15 @@ void FullNodeShardImpl::update_validators(std::vector<PublicKeyHash> public_key_
}
}
void FullNodeShardImpl::update_collators(std::vector<adnl::AdnlNodeIdShort> nodes) {
if (!client_.empty()) {
return;
}
collator_nodes_ = std::move(nodes);
td::actor::send_closure(overlays_, &overlay::Overlays::set_priority_broadcast_receivers, adnl_id_, overlay_id_,
collator_nodes_);
}
void FullNodeShardImpl::reload_neighbours() {
auto P = td::PromiseCreator::lambda([SelfId = actor_id(this)](td::Result<std::vector<adnl::AdnlNodeIdShort>> R) {
if (R.is_error()) {