Skip to content
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
32 changes: 30 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,34 @@
"unordered_map": "cpp",
"unordered_set": "cpp",
"variant": "cpp",
"algorithm": "cpp"
"algorithm": "cpp",
"coroutine": "cpp",
"xmemory": "cpp",
"charconv": "cpp",
"resumable": "cpp",
"format": "cpp",
"forward_list": "cpp",
"functional": "cpp",
"iterator": "cpp",
"ranges": "cpp",
"span": "cpp",
"stop_token": "cpp",
"utility": "cpp",
"valarray": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
}
}
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Brief Specifications

* Coin Name: StakeCubeCoin
* Coin Ticker: SCC
* Consensus: PoW/MN (x11)
* Consensus: PoW/MN (FiroPow)
* MN Collateral: 1000 SCC
* Block reward: 0.5 - 9 SCC
* MN reward: 70%
Expand All @@ -26,9 +26,9 @@ Brief Specifications
What is StakeCubeCoin (SCC)?
-------------------------

StakeCubeCoin is a fork of the Dash codebase; which uses a combination of x11-PoW and Deterministic Masternodes to secure the cryptocurrency's network and blockchain.
StakeCubeCoin is a fork of the Dash codebase; which uses a combination of FiroPow-PoW and Deterministic Masternodes to secure the cryptocurrency's network and blockchain.

The StakeCubeCoin blockchain is further secured by Masternodes, which enforce ChainLocks and InstantSend for an extremely fast, secure network monitored by 1000s of Masternodes, constantly producing secure quorums.
The StakeCubeCoin blockchain is further secured by Masternodes, which enforce ChainLocks and InstantSend for a high-speed, secure network monitored by 1000s of Masternodes, constantly producing secure quorums.

The first consecutive blocks contain the coins allocated for the user coin swap (From the MUE codebase), destined for holders of the previous PoS/MN version of StakeCubeCoin.

Expand All @@ -40,13 +40,13 @@ A total of 1,000 SCC is required to run a masternode;
Issue Tracker
------------

The integrated GitHub issue tracker is used for this project. Upon running into an issue, please submit it [here](https://github.com/stakecube/StakeCubeCoin/issues).
The integrated GitHub issue tracker is used for this project. When you encounter an issue, please submit it [here](https://github.com/stakecube/StakeCubeCoin/issues).


Documentation
-------------

The documentation is a work-in-progress. It is located in the doc folder.
The documentation is a work in progress. It is located in the doc folder.

Additionally, you may join the StakeCube discord server for direct support from the StakeCube team and community:
https://discord.gg/zB3xBhe
Expand All @@ -58,5 +58,5 @@ License
StakeCubeCoin is released under the terms of the MIT license.
See COPYING for more information or see https://opensource.org/licenses/MIT.

StakeCubeCoin is derived from code developed by the Dashpay team (https://github.com/dashpay/dash) and where possible, have left all copyright notices and trademarks untouched.
StakeCubeCoin is derived from code developed by the Dashpay team (https://github.com/dashpay/dash) and where possible, has left all copyright notices and trademarks untouched.

8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 3)
define(_CLIENT_VERSION_MINOR, 3)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_REVISION, 9)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2022)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_HOLDERS,[The %s developers])
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[SCC Core]])
AC_INIT([SCC Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_REVISION, m4_if(_CLIENT_VERSION_BUILD, [0], [], _CLIENT_VERSION_BUILD))m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/stakecube/StakeCubeCoin/issues],[stakecube],[https://stakecube.net/])
Expand Down Expand Up @@ -1390,7 +1390,7 @@ fi

if test x$use_boost = xyes; then


BOOST_LIBS="$BOOST_LDFLAGS $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB"

dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/immer.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package=immer
$(package)_version=v0.6.2
$(package)_download_path=https://github.com/arximboldi/immer/archive
$(package)_download_path=https://github.com/arximboldi/immer/archive/refs/tags
$(package)_download_file=$($(package)_version).tar.gz
$(package)_file_name=$(package)-$($(package)_download_file)
$(package)_sha256_hash=c3bb8847034437dee64adacb04e1e0163ae640b596c582eb4c0aa1d7c6447cd7
Expand Down
48 changes: 41 additions & 7 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 2420; // 60% of 4032
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5; // this corresponds to 10 periods

// Deployment of decreased proposal fee, script addresses for Governance Proposals
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nStartTime = 1635724800; // Nov 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdStart = 80;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdMin = 60;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nFalloffCoeff = 5; // this corresponds to 10 periods

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0000000000000000000000000000000000000000000000902015d2c183b40ba9"); // Blk 484,917

Expand Down Expand Up @@ -344,7 +353,8 @@ class CMainParams : public CChainParams {
nPoolMaxParticipants = 5;
nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour

vSporkAddresses = {"sJbcSRccZQfmgjeW28uEEh9PswngZj1RXb"};
vSporkAddressesV1 = {"sJbcSRccZQfmgjeW28uEEh9PswngZj1RXb"};
vSporkAddressesV2 = {"sRSMpxfoejLYu7Y7Jd44MPfK76ap6cnXUR"};
nMinSporkKeys = 1;
fBIP9CheckMasternodesUpgraded = true;

Expand Down Expand Up @@ -396,13 +406,25 @@ class CMainParams : public CChainParams {
{412200, uint256S("0000000000001bf066316f9a8da865f3e16f4770d3a36fd007253d0c07599c65")},
{432200, uint256S("0000000000004914b4bf906e1e1b869338cdd61b249cab868d4b8640e1dee35c")},
{452200, uint256S("0000000000001aacd70727211dbac4a888d34f423497da206d1cad9492ec4594")},
{472200, uint256S("00000000000003163bd40055b06f813615f104e2f67f910bc5814d731f9afa20")}
{472200, uint256S("00000000000003163bd40055b06f813615f104e2f67f910bc5814d731f9afa20")},
// Historical refs
{500000, uint256S("000000000001020e80eb983cc1f16f22676544c3f89ca374c8f92f260d89800a")},
{550000, uint256S("00000000005333d7f47a5ea1275e14edf813a69259e7cc0d023c7cd655fb2517")},
{550500, uint256S("000000000061cc0cf09219cad0b6ea9843a593d58d50130e9ca5aed254bdb4e7")},
{551500, uint256S("0000000000832d63fb60c46529eb1bca584b0a019e18a18cb2255abf745d3671")},
// Post team re-org
{555000, uint256S("0000000001a965f5f2bd59b114f53d0d61f21649a686c675028639cdad64c665")},
{600000, uint256S("00000000004428e377917ebf1b5e256baed842139c57f4c199712ae2607284db")},
{650000, uint256S("0000000002a791bd190def7536560777a6105f6a682c6bbab899a3781b2b44b3")},
{700000, uint256S("000000000361299a95ea6a73d9a202a94893b3ec4fb441330740e20f9748cf36")},
{703355, uint256S("0000000002354cfaeb716435d7cfa632651f32ea22ef9796d25b893e264b2ea5")},
{703363, uint256S("00000000013b1c713a1ae71e6328f0f21efa08c7b8432d40bce681e4588645c4")}
}
};

chainTxData = ChainTxData{
1647874171, // * UNIX timestamp of last known number of transactions (Block 1)
646614, // * total number of transactions between genesis and that timestamp
1692077442, // * UNIX timestamp of last known number of transactions (Block 1)
703363, // * total number of transactions between genesis and that timestamp
// (the tx=... number in the SetBestChain debug.log lines)
0.0153 // * estimated number of transactions per second after that timestamp
};
Expand Down Expand Up @@ -502,6 +524,15 @@ class CTestNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nThresholdMin = 60; // 60% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0020].nFalloffCoeff = 5; // this corresponds to 10 periods

// Deployment of decreased proposal fee, script addresses for Governance Proposals
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].bit = 7;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nStartTime = 1635724800; // Nov 1st, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdStart = 80;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nThresholdMin = 60;
consensus.vDeployments[Consensus::DEPLOYMENT_GOV_FEE].nFalloffCoeff = 5; // this corresponds to 10 periods

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("00"); // 470000

Expand Down Expand Up @@ -564,7 +595,8 @@ class CTestNetParams : public CChainParams {
nPoolMaxParticipants = 20;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes

vSporkAddresses = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
vSporkAddressesV1 = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
vSporkAddressesV2 = {"yaBHHsZP4MthVVexFXiLgzUw7mwzxY9KRF"};
nMinSporkKeys = 1;
fBIP9CheckMasternodesUpgraded = true;

Expand Down Expand Up @@ -753,7 +785,8 @@ class CDevNetParams : public CChainParams {
nPoolMaxParticipants = 20;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes

vSporkAddresses = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
vSporkAddressesV1 = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
vSporkAddressesV2 = {"yaBHHsZP4MthVVexFXiLgzUw7mwzxY9KRF"};
nMinSporkKeys = 1;
// devnets are started with no blocks and no MN, so we can't check for upgraded MN (as there are none)
fBIP9CheckMasternodesUpgraded = false;
Expand Down Expand Up @@ -931,7 +964,8 @@ class CRegTestParams : public CChainParams {
nPoolMaxParticipants = 20;

// privKey: cP4EKFyJsHT39LDqgdcB43Y3YXjNyjb5Fuas1GQSeAtjnZWmZEQK
vSporkAddresses = {"yj949n1UH6fDhw6HtVE5VMj2iSTaSWBMcW"};
vSporkAddressesV1 = {"yj949n1UH6fDhw6HtVE5VMj2iSTaSWBMcW"};
vSporkAddressesV2 = {"yj949n1UH6fDhw6HtVE5VMj2iSTaSWBMcW"};
nMinSporkKeys = 1;
// regtest usually has no masternodes in most tests, so don't check for upgraged MNs
fBIP9CheckMasternodesUpgraded = false;
Expand Down
6 changes: 4 additions & 2 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class CChainParams
int PoolMinParticipants() const { return nPoolMinParticipants; }
int PoolMaxParticipants() const { return nPoolMaxParticipants; }
int FulfilledRequestExpireTime() const { return nFulfilledRequestExpireTime; }
const std::vector<std::string>& SporkAddresses() const { return vSporkAddresses; }
const std::vector<std::string>& SporkAddressesV1() const { return vSporkAddressesV1; }
const std::vector<std::string>& SporkAddressesV2() const { return vSporkAddressesV2; }
int MinSporkKeys() const { return nMinSporkKeys; }
bool BIP9CheckMasternodesUpgraded() const { return fBIP9CheckMasternodesUpgraded; }
const Consensus::LLMQParams& GetLLMQ(Consensus::LLMQType llmqType) const;
Expand Down Expand Up @@ -141,7 +142,8 @@ class CChainParams
int nPoolMinParticipants;
int nPoolMaxParticipants;
int nFulfilledRequestExpireTime;
std::vector<std::string> vSporkAddresses;
std::vector<std::string> vSporkAddressesV1;
std::vector<std::string> vSporkAddressesV2;
int nMinSporkKeys;
bool fBIP9CheckMasternodesUpgraded;

Expand Down
36 changes: 35 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ bool AppInitMain(InitInterfaces& interfaces)
if (gArgs.IsArgSet("-sporkaddr")) {
vSporkAddresses = gArgs.GetArgs("-sporkaddr");
} else {
vSporkAddresses = Params().SporkAddresses();
vSporkAddresses = Params().SporkAddressesV1();
}
for (const auto& address: vSporkAddresses) {
if (!sporkManager.SetSporkAddress(address)) {
Expand Down Expand Up @@ -2486,6 +2486,40 @@ bool AppInitMain(InitInterfaces& interfaces)
return false;
}


// ********************************************************* Step 12.1: uprade sporks

if (chain_active_height >= 750000 && chainparams.NetworkIDString() == CBaseChainParams::MAIN) {
std::vector<std::string> vSporkAddresses;
if (gArgs.IsArgSet("-sporkaddr")) {
vSporkAddresses = gArgs.GetArgs("-sporkaddr");
} else {
vSporkAddresses = Params().SporkAddressesV2();
}
sporkManager.ClearSporkAddresses();
for (const auto& address : vSporkAddresses) {
if (!sporkManager.SetSporkAddress(address)) {
return InitError(_("Invalid spork address specified with -sporkaddr").translated);
}
}
LogPrintf("Using V2 Spork Addresses\n");
}
if (chain_active_height >= 7500 && chainparams.NetworkIDString() == CBaseChainParams::TESTNET) {
std::vector<std::string> vSporkAddresses;
if (gArgs.IsArgSet("-sporkaddr")) {
vSporkAddresses = gArgs.GetArgs("-sporkaddr");
} else {
vSporkAddresses = Params().SporkAddressesV2();
}
sporkManager.ClearSporkAddresses();
for (const auto& address : vSporkAddresses) {
if (!sporkManager.SetSporkAddress(address)) {
return InitError(_("Invalid spork address specified with -sporkaddr").translated);
}
}
LogPrintf("Using V2 Spork Addresses\n");
}

// ********************************************************* Step 13: finished

SetRPCWarmupFinished();
Expand Down
2 changes: 1 addition & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);
if (nHeight == 491409) {
if (nHeight == 491409 && chainparams.NetworkIDString() == CBaseChainParams::MAIN) {
pblock->nBits = chainparams.GetConsensus().nInitialPPDifficulty;
} else {
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, chainparams.GetConsensus());
Expand Down
6 changes: 6 additions & 0 deletions src/spork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ bool CSporkManager::GetSporkByHash(const uint256& hash, CSporkMessage& sporkRet)
return true;
}

void CSporkManager::ClearSporkAddresses()
{
LOCK(cs);
setSporkPubKeyIDs.clear();
}

bool CSporkManager::SetSporkAddress(const std::string& strAddress)
{
LOCK(cs);
Expand Down
6 changes: 6 additions & 0 deletions src/spork.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ class CSporkManager
*/
bool GetSporkByHash(const uint256& hash, CSporkMessage &sporkRet) const;

/**
* ClearSporkAddresses is used to clear the spork listing due to a change.
* use wisely.
*/
void ClearSporkAddresses();

/**
* SetSporkAddress is used to set a public key ID which will be used to
* verify spork signatures.
Expand Down
6 changes: 6 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,12 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
return state.DoS(50, false, REJECT_INVALID, "invalid-progpow-epoch", false, "invalid epoch number");
}

/*uint256 exp_mix_hash{}, final_hash;
final_hash = block.GetProgPowHashFull(exp_mix_hash);
if (exp_mix_hash != block.mix_hash) {
return state.DoS(50, false, REJECT_INVALID, "invalid-mixhash", false, "mix_hash validity failed");
}*/

// verify that the view's current state corresponds to the previous block
uint256 hashPrevBlock = pindex->pprev == nullptr ? uint256() : pindex->pprev->GetBlockHash();
assert(hashPrevBlock == view.GetBestBlock());
Expand Down