Skip to content

Commit

Permalink
feat!: 4k collateral high performance masternode implementation (#5039)
Browse files Browse the repository at this point in the history
## Issue being fixed or feature implemented


## What was done?
Implementation of 4k collateral HPMN.

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
Co-authored-by: PastaPastaPasta <6443210+pastapastapasta@users.noreply.github.com>
Co-authored-by: UdjinM6 <1935069+Udjinm6@users.noreply.github.com>
Co-authored-by: Konstantin Akimov <545784+knst@users.noreply.github.com>
  • Loading branch information
7 people committed Feb 14, 2023
1 parent c8a7e69 commit aa8462b
Show file tree
Hide file tree
Showing 32 changed files with 1,357 additions and 177 deletions.
18 changes: 18 additions & 0 deletions doc/release-notes-5039.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Added RPCs
--------

The following RPCs were added: `protx register_hpmn`, `protx register_fund_hpmn`, `protx register_prepare_hpmn` and `protx update_service_hpmn`.
These HPMN RPCs correspond to the standard masternode RPCs but have the following additional mandatory arguments: `platformNodeID`, `platformP2PPort` and `platformHTTPPort`.
- `platformNodeID`: Platform P2P node ID, derived from P2P public key.
- `platformP2PPort`: TCP port of Dash Platform peer-to-peer communication between nodes (network byte order).
- `platformHTTPPort`: TCP port of Platform HTTP/API interface (network byte order).
Notes:
- `platformNodeID` must be unique across the network.
- `platformP2PPort`, `platformHTTPPort` and the Core port must be distinct.


Updated RPCs
--------

The RPC's `gobject getcurrentvotes` reply is enriched by adding the vote weight at the end of each line. Possible values are 1 or 4. Example:
`"7cb20c883c6093b8489f795b3ec0aad0d9c2c2821610ae9ed938baaf42fec66d": "277e6345359071410ab691c21a3a16f8f46c9229c2f8ec8f028c9a95c0f1c0e7-1:1670019339:yes:funding:4"`
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ BITCOIN_CORE_H = \
cuckoocache.h \
ctpl_stl.h \
cxxtimer.hpp \
evo/dmn_types.h \
evo/cbtx.h \
evo/deterministicmns.h \
evo/dmnstate.h \
Expand Down
11 changes: 10 additions & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ class CMainParams : public CChainParams {
pchMessageStart[2] = 0x6b;
pchMessageStart[3] = 0xbd;
nDefaultPort = 9999;
nDefaultPlatformP2PPort = 26656;
nDefaultPlatformHTTPPort = 443;
nPruneAfterHeight = 100000;
m_assumed_blockchain_size = 45;
m_assumed_chain_state_size = 1;
Expand Down Expand Up @@ -502,6 +504,8 @@ class CTestNetParams : public CChainParams {
pchMessageStart[2] = 0xca;
pchMessageStart[3] = 0xff;
nDefaultPort = 19999;
nDefaultPlatformP2PPort = 22000;
nDefaultPlatformHTTPPort = 22001;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 4;
m_assumed_chain_state_size = 1;
Expand Down Expand Up @@ -710,6 +714,8 @@ class CDevNetParams : public CChainParams {
pchMessageStart[2] = 0xff;
pchMessageStart[3] = 0xce;
nDefaultPort = 19799;
nDefaultPlatformP2PPort = 22100;
nDefaultPlatformHTTPPort = 22101;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 0;
m_assumed_chain_state_size = 0;
Expand Down Expand Up @@ -960,6 +966,8 @@ class CRegTestParams : public CChainParams {
pchMessageStart[2] = 0xb7;
pchMessageStart[3] = 0xdc;
nDefaultPort = 19899;
nDefaultPlatformP2PPort = 22200;
nDefaultPlatformHTTPPort = 22201;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 0;
m_assumed_chain_state_size = 0;
Expand Down Expand Up @@ -1027,10 +1035,11 @@ class CRegTestParams : public CChainParams {
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_INSTANTSEND);
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_V17);
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_DIP0024);
AddLLMQ(Consensus::LLMQType::LLMQ_TEST_PLATFORM);
consensus.llmqTypeChainLocks = Consensus::LLMQType::LLMQ_TEST;
consensus.llmqTypeInstantSend = Consensus::LLMQType::LLMQ_TEST_INSTANTSEND;
consensus.llmqTypeDIP0024InstantSend = Consensus::LLMQType::LLMQ_TEST_DIP0024;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_TEST;
consensus.llmqTypePlatform = Consensus::LLMQType::LLMQ_TEST_PLATFORM;
consensus.llmqTypeMnhf = Consensus::LLMQType::LLMQ_TEST;

UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST);
Expand Down
4 changes: 4 additions & 0 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class CChainParams
const Consensus::Params& GetConsensus() const { return consensus; }
const CMessageHeader::MessageStartChars& MessageStart() const { return pchMessageStart; }
uint16_t GetDefaultPort() const { return nDefaultPort; }
uint16_t GetDefaultPlatformP2PPort() const { return nDefaultPlatformP2PPort; }
uint16_t GetDefaultPlatformHTTPPort() const { return nDefaultPlatformHTTPPort; }

const CBlock& GenesisBlock() const { return genesis; }
const CBlock& DevNetGenesisBlock() const { return devnetGenesis; }
Expand Down Expand Up @@ -145,6 +147,8 @@ class CChainParams
std::vector<std::string> vSporkAddresses;
int nMinSporkKeys;
bool fBIP9CheckMasternodesUpgraded;
uint16_t nDefaultPlatformP2PPort;
uint16_t nDefaultPlatformHTTPPort;

void AddLLMQ(Consensus::LLMQType llmqType);
};
Expand Down

0 comments on commit aa8462b

Please sign in to comment.