Skip to content

Commit

Permalink
Merge pull request #174 from AXErunners/development
Browse files Browse the repository at this point in the history
Release 1.4.0.1
  • Loading branch information
charlesrocket committed Jun 1, 2019
2 parents 932a799 + 6325d49 commit bf77327
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 165 deletions.
4 changes: 3 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<p align="center"><img src="https://github.com/AXErunners/media/raw/master/axe-logo256.png"/></p>

[![Build Status](https://travis-ci.org/AXErunners/axe.svg?branch=master)](https://travis-ci.org/AXErunners/axe)
`M`: [![Build Status](https://travis-ci.org/AXErunners/axe.svg?branch=master)](https://travis-ci.org/AXErunners/axe)

`D`: [![Build Status](https://travis-ci.org/AXErunners/axe.svg?branch=development)](https://travis-ci.org/AXErunners/axe)
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 4)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ PROJECT_NAME = "Axe Core"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.4.0.0
PROJECT_NUMBER = 1.4.0.1

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
6 changes: 3 additions & 3 deletions doc/man/axe-cli.1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.10.
.TH AXE-CLI "1" "May 2019" "axe-cli v1.4.0.0" "User Commands"
.TH AXE-CLI "1" "May 2019" "axe-cli v1.4.0.1" "User Commands"
.SH NAME
axe-cli \- manual page for axe-cli v1.4.0.0
axe-cli \- manual page for axe-cli v1.4.0.1
.SH DESCRIPTION
Axe Core RPC client version v1.4.0.0
Axe Core RPC client version v1.4.0.1
.SS "Usage:"
.TP
axe\-cli [options] <command> [params]
Expand Down
6 changes: 3 additions & 3 deletions doc/man/axe-qt.1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.10.
.TH AXE-QT "1" "May 2019" "axe-qt v1.4.0.0" "User Commands"
.TH AXE-QT "1" "May 2019" "axe-qt v1.4.0.1" "User Commands"
.SH NAME
axe-qt \- manual page for axe-qt v1.4.0.0
axe-qt \- manual page for axe-qt v1.4.0.1
.SH DESCRIPTION
Axe Core version v1.4.0.0 (64\-bit)
Axe Core version v1.4.0.1 (64\-bit)
Usage:
.IP
axe\-qt [command\-line options]
Expand Down
6 changes: 3 additions & 3 deletions doc/man/axe-tx.1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.10.
.TH AXE-TX "1" "May 2019" "axe-tx v1.4.0.0" "User Commands"
.TH AXE-TX "1" "May 2019" "axe-tx v1.4.0.1" "User Commands"
.SH NAME
axe-tx \- manual page for axe-tx v1.4.0.0
axe-tx \- manual page for axe-tx v1.4.0.1
.SH DESCRIPTION
Axe Core axe\-tx utility version v1.4.0.0
Axe Core axe\-tx utility version v1.4.0.1
.SS "Usage:"
.TP
axe\-tx [options] <hex\-tx> [commands]
Expand Down
6 changes: 3 additions & 3 deletions doc/man/axed.1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.10.
.TH AXED "1" "May 2019" "axed v1.4.0.0" "User Commands"
.TH AXED "1" "May 2019" "axed v1.4.0.1" "User Commands"
.SH NAME
axed \- manual page for axed v1.4.0.0
axed \- manual page for axed v1.4.0.1
.SH DESCRIPTION
Axe Core Daemon version v1.4.0.0
Axe Core Daemon version v1.4.0.1
.SS "Usage:"
.TP
axed [options]
Expand Down
139 changes: 16 additions & 123 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Axe Core version 1.4.0.0
Axe Core version 1.4.0.1
==========================

Release is now available from:
Expand Down Expand Up @@ -42,125 +42,18 @@ recommended unless you have some serious issues with version 1.4.
Notable changes
===============

DIP0004 - Coinbase Payload v2
-----------------------------
Coinbase Payload v2 introduces new field `merkleRootQuorums` which represents the merkle root of
all the hashes of the final quorum commitments of all active LLMQ sets. This allows SPV clients
to verify active LLMQ sets and use this information to further verify ChainLocks and LLMQ-based
InstantSend messages. Coinbase Payload v2 relies on DIP0008 (bit 4) activation.

https://github.com/axerunners/dips/blob/master/dip-0004.md#calculating-the-merkle-root-of-the-active-llmqs

DIP0008 - ChainLocks
--------------------
This version introduces ChainLocks, a technology for near-instant confirmation of blocks and
finding near-instant consensus on the longest valid/accepted chain. ChainLocks leverages LLMQ
Signing Requests/Sessions to accomplish this. ChainLocks relies on DIP0008 (bit 4) activation and
`SPORK_19_CHAINLOCKS_ENABLED` spork.

Read more: https://github.com/axerunners/dips/blob/master/dip-0008.md

DIP0010 - LLMQ-based InstantSend
--------------------------------
InstantSend is a feature to allow instant confirmations of payments. It works by locking transaction
inputs through masternode quorums. It has been present in Axe for a few years and been proven to work.
Nevertheless, there are some limits which could theoretically be removed in the old system but doing so
would have created risks in terms of scalability and security.

We introduce LLMQ-based InstantSend which is designed to be much more scalable without sacrificing
security and which allows all transactions to be treated as InstantSend transactions. The old system
differentiated transactions as InstantSend transactions by using the P2P message “ix” instead of “tx”.
Since this distinction is not required in the new system, the P2P message “ix” will be removed after
DIP0008 deployment (for now, transactions sent via "ix" message will be relayed further via "tx" message).

Read more: https://github.com/axerunners/dips/blob/master/dip-0010.md

Network
------
Legacy messages `mnw`, `mnwb`, `mnget`, `mnb`, `mnp`, `dseg`, `mnv`, `qdcommit` and their corresponding
inventory types (7, 10, 14, 15, 19, 22) are no longer suported.

Message `version` is extended with a 256 bit field - a challenge sent to a masternode. Masternode which
received such a challenge must reply with new p2p message `mnauth` directly after `verack`. This `mnauth`
message must include a signed challenge that was previously sent via `version`.

Mining
------
Due to changes in coinbase payload this version requires for miners to signal their readiness via
BIP9-like mechanism - by setting bit 4 of the block version to 1. Note that if your mining software
simply uses `coinbase_payload` field from `getblocktemplate` RPC and doesn't construct coinbase payload
manually then there should be no changes to your mining software required. We however encourage pools
and solo-miners to check their software compatibility on testnet to ensure flawless migration.

PrivateSend
-----------
The wallet will try to create and consume denoms a bit more accurately now. It will also only create a
limited number of inputs for each denominated amount to prevent bloating itself with mostly the smallest
denoms. You can control this number of inputs via new `-privatesenddenoms` cmd-line option (default is 300).

InstantSend
-----------
Legacy InstantSend is going to be superseded by the newly implemented LLMQ-based one once DIP0008 (bit 4)
is active and `SPORK_20_INSTANTSEND_LLMQ_BASED` spork is ON.

Sporks
------
There are two new sporks introduced in this version - `SPORK_19_CHAINLOCKS_ENABLED` and
`SPORK_20_INSTANTSEND_LLMQ_BASED`. `SPORK_17_QUORUM_DKG_ENABLED` was introduced in v0.13 but was kept OFF.
It will be turned on once 80% masternodes are upgraded to v1.4 which will enable DKG and DKG-based PoSe.

QR codes
--------
Wallet can now show QR codes for addresses in the address book, receiving addresses and addresses identified
in transactions list (right click -> "Show QR-code").

RPC changes
-----------
There are a few changes in existing RPC interfaces in this release:
- for blockchain based RPC commands `instantlock` will say `true` if the transaction
was locked via LLMQ based ChainLocks (for backwards compatibility reasons)
- `prioritisetransaction` no longer allows adjusting priority
- `getgovernanceinfo` no longer has `masternodewatchdogmaxseconds` and `sentinelpingmaxseconds` fields
- `masternodelist` no longer supports `activeseconds`, `daemon`, `lastseen`, `protocol`, `keyid`, `rank`
and `sentinel` modes, new mode - `pubkeyoperator`
- `masternode count` no longer has `ps_compatible` and `qualify` fields and `ps` and `qualify` modes
- `masternode winner` and `masternode current` no longer have `protocol`, `lastseen` and `activeseconds`
fields, new field - `proTxHash`
- `debug` supports new categories: `chainlocks`, `llmq`, `llmq-dkg`, `llmq-sigs`
- `mnsync` no longer has `IsMasternodeListSynced` and `IsWinnersListSynced` fields
- various RPCs that had `instantlock` field have `chainlock` (excluding mempool RPCs) and
`instantlock_internal` fields now

There are also new RPC commands:
- `bls fromsecret` parses a BLS secret key and returns the secret/public key pair
- `quorum` is a set of commands for quorums/LLMQs e.g. `list` to show active quorums (by default,
can specify different `count`) or `info` to shows detailed information about some specific quorum
etc., see `help quorum`

Few RPC commands are no longer supported: `estimatepriority`, `estimatesmartpriority`,
`gobject getvotes`, `masternode start-*`, `masternode genkey`, `masternode list-conf`, `masternode check`,
`masternodebroadcast`, `sentinelping`

See `help command` in rpc for more info.

ZMQ changes
-----------
Added two new messages `hashchainlock` and `rawchainlock` which return the hash of the chainlocked block
or the raw block itself respectively.

Command-line options
--------------------

Changes in existing cmd-line options:
- `-bip9params` supports optional `window` and `threshold` values now

New cmd-line options:
- `-watchquorums`
- `-privatesenddenoms`
- `-dip3params` (regtest-only)
- `-llmqchainlocks` (devnet-only)

Few cmd-line options are no longer supported: `-limitfreerelay`, `-relaypriority`, `-blockprioritysize`,
`-sendfreetransactions`, `-mnconf`, `-mnconflock`, `-masternodeprivkey`

See `Help -> Command-line options` in Qt wallet or `axed --help` for more info.
Fixed governance votes pruning for invalid masternodes
------------------------------------------------------
A community member reported a possible attack that involves DoSing masternodes to force the network
to prune all governance votes from this masternodes. This could be used to manipulate vote outcomes.

This vulnerability is currently not possible to execute as LLMQ DKGs and PoSe have not activated yet on
mainnet. This version includes a fix that requires to have at least 51% masternodes to upgrade to
1.4.0.1, after which superblock trigger voting will automatically fix the discrepancies between
old and new nodes. This also means that we will postpone activation of LLMQ DKGs and thus PoSe until
at least 51% of masternodes have upgraded to 1.4.0.1.

Fixed a rare memory/db leak in LLMQ based InstantSend
-----------------------------------------------------
We fixed a rare memory/db leak in LLMQ based InstantSend leak which would only occur when reorganizations
would happen.
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 4
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 1

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
8 changes: 0 additions & 8 deletions src/governance-object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,6 @@ bool CGovernanceObject::IsValidLocally(std::string& strError, bool& fMissingMast
strError = "Failed to find Masternode by UTXO, missing masternode=" + strOutpoint;
return false;
}
if (!mnList.IsMNValid(dmn)) {
if (mnList.IsMNPoSeBanned(dmn)) {
strError = "Masternode is POSE_BANNED, masternode=" + strOutpoint;
} else {
strError = "Masternode is invalid for unknown reason, masternode=" + strOutpoint;
}
return false;
}

// Check that we have a valid MN signature
if (!CheckSignature(dmn->pdmnState->pubKeyOperator)) {
Expand Down
1 change: 1 addition & 0 deletions src/governance-object.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CGovernanceVote;

static const int MIN_GOVERNANCE_PEER_PROTO_VERSION = 70213;
static const int GOVERNANCE_FILTER_PROTO_VERSION = 70206;
static const int GOVERNANCE_POSE_BANNED_VOTES_VERSION = 70215;

static const double GOVERNANCE_FILTER_FP_RATE = 0.001;

Expand Down
17 changes: 15 additions & 2 deletions src/governance-vote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,21 @@ void CGovernanceVote::Relay(CConnman& connman) const
return;
}

auto mnList = deterministicMNManager->GetListAtChainTip();
auto dmn = mnList.GetMNByCollateral(masternodeOutpoint);
if (!dmn) {
return;
}

// When this vote is from non-valid (PoSe banned) MN, we should only announce it to v0.14.0.1 nodes as older nodes
// will ban us otherwise.
int minVersion = MIN_GOVERNANCE_PEER_PROTO_VERSION;
if (!mnList.IsMNValid(dmn)) {
minVersion = GOVERNANCE_POSE_BANNED_VOTES_VERSION;
}

CInv inv(MSG_GOVERNANCE_OBJECT_VOTE, GetHash());
connman.RelayInv(inv, MIN_GOVERNANCE_PEER_PROTO_VERSION);
connman.RelayInv(inv, minVersion);
}

void CGovernanceVote::UpdateHash() const
Expand Down Expand Up @@ -258,7 +271,7 @@ bool CGovernanceVote::IsValid(bool useVotingKey) const
return false;
}

auto dmn = deterministicMNManager->GetListAtChainTip().GetValidMNByCollateral(masternodeOutpoint);
auto dmn = deterministicMNManager->GetListAtChainTip().GetMNByCollateral(masternodeOutpoint);
if (!dmn) {
LogPrint("gobject", "CGovernanceVote::IsValid -- Unknown Masternode - %s\n", masternodeOutpoint.ToStringShort());
return false;
Expand Down
12 changes: 7 additions & 5 deletions src/llmq/quorums_instantsend.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019 The Axe Core developers
// Copyright (c) 2019 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http:https://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -937,11 +937,12 @@ void CInstantSendManager::SyncTransaction(const CTransaction& tx, const CBlockIn
}

bool inMempool = mempool.get(tx.GetHash()) != nullptr;
bool isDisconnect = pindex && posInBlock == CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK;

// Are we called from validation.cpp/MemPoolConflictRemovalTracker?
// TODO refactor this when we backport the BlockConnected signal from Bitcoin, as it gives better info about
// conflicted TXs
bool isConflictRemoved = !pindex && posInBlock == CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK && !inMempool;
bool isConflictRemoved = isDisconnect && !inMempool;

if (isConflictRemoved) {
LOCK(cs);
Expand All @@ -956,8 +957,9 @@ void CInstantSendManager::SyncTransaction(const CTransaction& tx, const CBlockIn

// update DB about when an IS lock was mined
if (!islockHash.IsNull() && pindex) {
if (posInBlock == CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK) {
db.RemoveInstantSendLockMined(islockHash, pindex->nHeight);
if (isDisconnect) {
// SyncTransaction is called with pprev
db.RemoveInstantSendLockMined(islockHash, pindex->nHeight + 1);
} else {
db.WriteInstantSendLockMined(islockHash, pindex->nHeight);
}
Expand All @@ -977,7 +979,7 @@ void CInstantSendManager::SyncTransaction(const CTransaction& tx, const CBlockIn
if (!chainlocked && islockHash.IsNull()) {
// TX is not locked, so make sure it is tracked
AddNonLockedTx(MakeTransactionRef(tx));
nonLockedTxs.at(tx.GetHash()).pindexMined = posInBlock != CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK ? pindex : nullptr;
nonLockedTxs.at(tx.GetHash()).pindexMined = !isDisconnect ? pindex : nullptr;
} else {
// TX is locked, so make sure we don't track it anymore
RemoveNonLockedTx(tx.GetHash(), true);
Expand Down
Loading

0 comments on commit bf77327

Please sign in to comment.