Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase minimum supported protocol version to 17 #2683

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nano/node/active_transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void nano::active_transactions::request_confirm (nano::unique_lock<std::mutex> &

// Only representatives ready to receive batched confirm_req
nano::confirmation_solicitor solicitor (node.network, node.network_params.network);
solicitor.prepare (node.rep_crawler.principal_representatives (std::numeric_limits<size_t>::max (), node.network_params.protocol.tcp_realtime_protocol_version_min));
solicitor.prepare (node.rep_crawler.principal_representatives (std::numeric_limits<size_t>::max ()));

bool const representative_l (node.config.enable_voting && node.wallets.rep_counts ().voting > 0);
std::vector<nano::block_hash> hashes_generation_l;
Expand Down
18 changes: 4 additions & 14 deletions nano/node/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,8 @@ void nano::network::flood_block_many (std::deque<std::shared_ptr<nano::block>> b
void nano::network::send_confirm_req (std::shared_ptr<nano::transport::channel> channel_a, std::shared_ptr<nano::block> block_a)
{
// Confirmation request with hash + root
if (channel_a->get_network_version () >= node.network_params.protocol.tcp_realtime_protocol_version_min)
{
nano::confirm_req req (block_a->hash (), block_a->root ());
channel_a->send (req);
}
// Confirmation request with full block
else
{
nano::confirm_req req (block_a);
channel_a->send (req);
}
nano::confirm_req req (block_a->hash (), block_a->root ());
channel_a->send (req);
}

void nano::network::broadcast_confirm_req (std::shared_ptr<nano::block> block_a)
Expand Down Expand Up @@ -635,14 +626,13 @@ nano::tcp_endpoint nano::network::bootstrap_peer (bool lazy_bootstrap)
{
nano::tcp_endpoint result (boost::asio::ip::address_v6::any (), 0);
bool use_udp_peer (nano::random_pool::generate_word32 (0, 1));
auto protocol_min (lazy_bootstrap ? node.network_params.protocol.protocol_version_bootstrap_lazy_min : node.network_params.protocol.protocol_version_bootstrap_min);
if (use_udp_peer || tcp_channels.size () == 0)
{
result = udp_channels.bootstrap_peer (protocol_min);
result = udp_channels.bootstrap_peer (node.network_params.protocol.protocol_version_bootstrap_min);
}
if (result == nano::tcp_endpoint (boost::asio::ip::address_v6::any (), 0))
{
result = tcp_channels.bootstrap_peer (protocol_min);
result = tcp_channels.bootstrap_peer (node.network_params.protocol.protocol_version_bootstrap_min);
}
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion nano/node/transport/tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ void nano::transport::tcp_channels::ongoing_keepalive ()
size_t random_count (std::min (static_cast<size_t> (6), static_cast<size_t> (std::ceil (std::sqrt (node.network.udp_channels.size ())))));
for (auto i (0); i <= random_count; ++i)
{
auto tcp_endpoint (node.network.udp_channels.bootstrap_peer (node.network_params.protocol.tcp_realtime_protocol_version_min));
auto tcp_endpoint (node.network.udp_channels.bootstrap_peer (node.network_params.protocol.protocol_version_min));
if (tcp_endpoint != invalid_endpoint && find_channel (tcp_endpoint) == nullptr)
{
start_tcp (nano::transport::map_tcp_to_endpoint (tcp_endpoint));
Expand Down
10 changes: 2 additions & 8 deletions nano/secure/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,10 @@ class protocol_constants
uint8_t protocol_version = 0x12;

/** Minimum accepted protocol version */
uint8_t protocol_version_min = 0x10;
uint8_t protocol_version_min = 0x11;

/** Do not bootstrap from nodes older than this version. */
uint8_t protocol_version_bootstrap_min = 0x10;

/** Do not lazy bootstrap from nodes older than this version. */
uint8_t protocol_version_bootstrap_lazy_min = 0x10;

/** Do not start TCP realtime network connections to nodes older than this version */
uint8_t tcp_realtime_protocol_version_min = 0x11;
uint8_t protocol_version_bootstrap_min = 0x11;

/** Do not request telemetry metrics to nodes older than this version */
uint8_t telemetry_protocol_version_min = 0x12;
Expand Down