Skip to content

Commit

Permalink
view update version
Browse files Browse the repository at this point in the history
Signed-off-by: iceseer <[email protected]>
  • Loading branch information
iceseer committed Mar 14, 2024
1 parent 78531e3 commit 48853ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
21 changes: 6 additions & 15 deletions core/network/impl/peer_manager_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,17 +744,6 @@ namespace kagome::network {
validation_protocol->protocolName(),
peer_id,
stream_result.error().message());
auto ps = self->getPeerState(peer_info.id);
if (ps) {
self->tryOpenValidationProtocol(
peer_info, ps->get(), network::CollationVersion::V1);
} else {
SL_TRACE(
self->log_,
"No peer state to open V1 validation protocol {} with {}",
validation_protocol->protocolName(),
peer_id);
}
return;
}

Expand Down Expand Up @@ -839,11 +828,13 @@ namespace kagome::network {
}

void PeerManagerImpl::reserveStatusStreams(const PeerId &peer_id) const {
auto proto_val_vstaging = router_->getValidationProtocolVStaging();
BOOST_ASSERT_MSG(proto_val_vstaging,
"Router did not provide validation protocol vstaging");
if (auto ps = getPeerState(peer_id); ps && ps->get().roles.authority) {
auto proto_val_vstaging = router_->getValidationProtocolVStaging();
BOOST_ASSERT_MSG(proto_val_vstaging,
"Router did not provide validation protocol vstaging");

stream_engine_->reserveStreams(peer_id, proto_val_vstaging);
stream_engine_->reserveStreams(peer_id, proto_val_vstaging);
}
}

void PeerManagerImpl::reserveStreams(const PeerId &peer_id) const {
Expand Down
8 changes: 4 additions & 4 deletions core/parachain/validator/impl/parachain_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ namespace kagome::parachain {
void ParachainProcessorImpl::broadcastViewExcept(
const libp2p::peer::PeerId &peer_id, const network::View &view) const {
auto msg = std::make_shared<
network::WireMessage<network::ValidatorProtocolMessage>>(
network::WireMessage<network::vstaging::ValidatorProtocolMessage>>(
network::ViewUpdate{.view = view});
pm_->getStreamEngine()->broadcast(
router_->getValidationProtocolVStaging(),
Expand Down Expand Up @@ -568,7 +568,7 @@ namespace kagome::parachain {
BOOST_ASSERT(se);

auto message = std::make_shared<
network::WireMessage<network::ValidatorProtocolMessage>>(msg);
network::WireMessage<network::vstaging::ValidatorProtocolMessage>>(msg);
SL_TRACE(
logger_,
"Broadcasting view update to group.(relay_parent={}, group_size={})",
Expand All @@ -587,7 +587,7 @@ namespace kagome::parachain {

void ParachainProcessorImpl::broadcastView(const network::View &view) const {
auto msg = std::make_shared<
network::WireMessage<network::ValidatorProtocolMessage>>(
network::WireMessage<network::vstaging::ValidatorProtocolMessage>>(
network::ViewUpdate{.view = view});
pm_->getStreamEngine()->broadcast(router_->getCollationProtocolVStaging(),
msg);
Expand Down Expand Up @@ -2822,7 +2822,7 @@ namespace kagome::parachain {
peer_id,
protocol,
std::make_shared<
network::WireMessage<network::ValidatorProtocolMessage>>(
network::WireMessage<network::vstaging::ValidatorProtocolMessage>>(
network::ViewUpdate{.view = my_view->get().view}));
}

Expand Down

0 comments on commit 48853ac

Please sign in to comment.