Merge pull request #1069 from Doy-lee/Version700

Valiant Vidar 7.0.0
This commit is contained in:
Doyle 2020-03-13 13:27:58 +11:00 committed by GitHub
commit 6a0043ad00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 17 deletions

View file

@ -1936,18 +1936,6 @@ namespace service_nodes
}
#endif
struct proof_version
{
uint8_t hardfork;
std::array<uint16_t, 3> version;
};
static constexpr proof_version hf_min_loki_versions[] = {
{cryptonote::network_version_14_blink, {6,1,0}},
{cryptonote::network_version_13_enforce_checkpoints, {5,1,0}},
{cryptonote::network_version_12_checkpointing, {4,0,3}},
};
template <typename T>
static bool update_val(T &val, const T &to) {
if (val != to) {
@ -2025,7 +2013,7 @@ namespace service_nodes
if ((proof.timestamp < now - UPTIME_PROOF_BUFFER_IN_SECONDS) || (proof.timestamp > now + UPTIME_PROOF_BUFFER_IN_SECONDS))
REJECT_PROOF("timestamp is too far from now");
for (auto &min : hf_min_loki_versions)
for (auto const &min : MIN_UPTIME_PROOF_VERSIONS)
if (hf_version >= min.hardfork && proof.snode_version < min.version)
REJECT_PROOF("v" << min.version[0] << "." << min.version[1] << "." << min.version[2] << "+ loki version is required for v" << std::to_string(hf_version) << "+ network proofs");

View file

@ -113,6 +113,20 @@ namespace service_nodes {
constexpr std::array<int, 3> MIN_STORAGE_SERVER_VERSION{{2, 0, 0}};
constexpr std::array<int, 3> MIN_LOKINET_VERSION{{0, 6, 1}};
// The minimum accepted version number, broadcasted by Service Nodes via uptime proofs for each hardfork
struct proof_version
{
uint8_t hardfork;
std::array<uint16_t, 3> version;
};
constexpr proof_version MIN_UPTIME_PROOF_VERSIONS[] = {
{cryptonote::network_version_15_lns, {7,0,0}},
{cryptonote::network_version_14_blink, {6,1,0}},
{cryptonote::network_version_13_enforce_checkpoints, {5,1,0}},
{cryptonote::network_version_12_checkpointing, {4,0,3}},
};
using swarm_id_t = uint64_t;
constexpr swarm_id_t UNASSIGNED_SWARM_ID = UINT64_MAX;

View file

@ -1,13 +1,13 @@
#define DEF_LOKI_VERSION_MAJOR 6
#define DEF_LOKI_VERSION_MINOR 1
#define DEF_LOKI_VERSION_PATCH 4
#define DEF_LOKI_VERSION_MAJOR 7
#define DEF_LOKI_VERSION_MINOR 0
#define DEF_LOKI_VERSION_PATCH 0
#define LOKI_STRINGIFY2(val) #val
#define LOKI_STRINGIFY(val) LOKI_STRINGIFY2(val)
#define DEF_LOKI_VERSION_STR LOKI_STRINGIFY(DEF_LOKI_VERSION_MAJOR) "." LOKI_STRINGIFY(DEF_LOKI_VERSION_MINOR) "." LOKI_STRINGIFY(DEF_LOKI_VERSION_PATCH)
#define DEF_LOKI_VERSION_TAG "@VERSIONTAG@"
#define DEF_LOKI_RELEASE_NAME "Nimble Nerthus"
#define DEF_LOKI_RELEASE_NAME "Valiant Vidar"
#define DEF_LOKI_VERSION_FULL DEF_LOKI_VERSION_STR "-" DEF_LOKI_VERSION_TAG
#include "version.h"