Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Add integer version number used in network protocol. Resolves #687
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiszczak committed Nov 14, 2017
1 parent d1ab9c3 commit 6752c15
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
6 changes: 5 additions & 1 deletion plugins/net_plugin/include/eos/net_plugin/protocol.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @file
* @copyright defined in eos/LICENSE.txt
*/
#pragma once
#include <eos/chain/block.hpp>
#include <eos/chain/types.hpp>
Expand All @@ -8,7 +12,7 @@ namespace eosio {
using namespace fc;

struct handshake_message {
int16_t network_version = 0;
int16_t network_version = 0; ///< derived from git commit hash, not sequential
chain_id_type chain_id; ///< used to identify chain
fc::sha256 node_id; ///< used to identify peers and prevent self-connect
string p2p_address;
Expand Down
3 changes: 1 addition & 2 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ namespace eosio {
constexpr auto def_conn_retry_wait = std::chrono::seconds (30);
constexpr auto def_txn_expire_wait = std::chrono::seconds (3);
constexpr auto def_resp_expected_wait = std::chrono::seconds (1);
constexpr auto def_network_version = 0;
constexpr auto def_sync_rec_span = 10;
constexpr auto def_max_just_send = 1300 * 3; // "mtu" * 3
constexpr auto def_send_whole_blocks = true;
Expand Down Expand Up @@ -2102,7 +2101,7 @@ namespace eosio {
sync_manager::logger.set_log_level(logl);
}

my->network_version = def_network_version;
my->network_version = (uint16_t)app().version_int();
my->send_whole_blocks = def_send_whole_blocks;

my->sync_master.reset( new sync_manager( def_sync_rec_span ) );
Expand Down
4 changes: 3 additions & 1 deletion programs/eosc/config.hpp.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/** @file
* @copyright defined in eos/LICENSE.txt
**/
*
* \warning This file is machine generated. DO NOT EDIT. See config.hpp.in for changes.
*/

namespace eosio { namespace client { namespace config {
constexpr char version_str[] = "${eosc_BUILD_VERSION}";
Expand Down
17 changes: 17 additions & 0 deletions programs/eosd/config.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @file
* @copyright defined in eos/LICENSE.txt
*
* \warning This file is machine generated. DO NOT EDIT. See config.hpp.in for changes.
*/
#pragma once

#ifndef CONFIG_HPP_IN
#define CONFIG_HPP_IN

namespace eosio { namespace eosd { namespace config {
constexpr char version_str[] = "${eosd_BUILD_VERSION}";
constexpr uint64_t version_int = 0x${eosd_BUILD_VERSION};
}}}

#endif // CONFIG_HPP_IN
16 changes: 16 additions & 0 deletions programs/launcher/config.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @file
* @copyright defined in eos/LICENSE.txt
*
* \warning This file is machine generated. DO NOT EDIT. See config.hpp.in for changes.
*/
#pragma once

#ifndef CONFIG_HPP_IN
#define CONFIG_HPP_IN

namespace eosio { namespace launcher { namespace config {
constexpr char version_str[] = "${launcher_BUILD_VERSION}";
}}}

#endif // CONFIG_HPP_IN

0 comments on commit 6752c15

Please sign in to comment.