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

Prepare for block version 11 hard-fork on testnet #1787

Merged
merged 3 commits into from
Jul 7, 2020
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
6 changes: 1 addition & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4101,11 +4101,7 @@ bool LoadBlockIndex(bool fAllowNew)
// Temporary transition to version 2 beacons after the block version 11
// hard-fork:
//
try {
g_v11_legacy_beacon_days = std::stoi(GetArg("-v11beacondays", ""));
} catch (...) {
g_v11_legacy_beacon_days = 365 * 100; // Big number that won't wrap.
}
g_v11_legacy_beacon_days = 7;
}

LogPrintf("Mode=%s", fTestNet ? "TestNet" : "Prod");
Expand Down
17 changes: 5 additions & 12 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,9 @@ inline bool IsV10Enabled(int nHeight)

inline int32_t GetV11Threshold()
{
// Returns "never" before planned intro of bv11.
try {
return fTestNet
// Temporary: configure testnet v11 height via parameter before
// releasing v11 to regular testnet:
//
? std::stoi(GetArg("-v11height", ""))
: std::numeric_limits<int32_t>::max();
} catch (...) {
return std::numeric_limits<int32_t>::max();
}
return fTestNet
? 1301500
: std::numeric_limits<int32_t>::max();
}

inline bool IsV11Enabled(int nHeight)
Expand Down Expand Up @@ -636,10 +628,11 @@ class CTransaction
READWRITE(vin);
READWRITE(vout);
READWRITE(nLockTime);
READWRITE(hashBoinc);

if (nVersion >= 2) {
READWRITE(vContracts);
} else {
READWRITE(hashBoinc);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/neuralnet/contract/payload.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ enum class ContractType
UNKNOWN, //!< An invalid, non-standard, or empty contract type.
BEACON, //!< Beacon advertisement or deletion.
CLAIM, //!< Gridcoin block reward claim context.
MESSAGE, //!< A user-supplied string. No associated protocol behavior.
POLL, //!< Submission of a new poll.
PROJECT, //!< Project whitelist addition or removal.
PROTOCOL, //!< Network control message or configuration directive.
Expand Down
2 changes: 1 addition & 1 deletion src/test/neuralnet/contract_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ struct TestMessage
{
std::vector<unsigned char> serialized {
0x02, 0x00, 0x00, 0x00, // Version: 32-bit int (little-endian)
0x04, // Type: PROJECT
0x05, // Type: PROJECT
0x01, // Action: ADD
0x01, 0x00, 0x00, 0x00, // Project contract version
0x04, // Length of the project name
Expand Down