From f994822a18754342d1edd4e7ea9cbaaac73b5a7d Mon Sep 17 00:00:00 2001 From: dimxy Date: Tue, 28 Mar 2023 01:31:48 +0500 Subject: [PATCH 01/12] remove long running call to CWalletdb from OrderedTxItems in a loop --- src/wallet/wallet.cpp | 10 ++++++---- src/wallet/wallet.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index f5707a14313..05fe037808b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1315,10 +1315,9 @@ int64_t CWallet::IncOrderPosNext(CWalletDB *pwalletdb) return nRet; } -CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, std::string strAccount) +CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, std::string strAccount, CWalletDB *pwalletdbIn) { AssertLockHeld(cs_wallet); // mapWallet - CWalletDB walletdb(strWalletFile); // First: get all CWalletTx and CAccountingEntry into a sorted-by-order multimap. TxItems txOrdered; @@ -1331,12 +1330,15 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); //fprintf(stderr,"ordered iter.%d %s\n",(int32_t)wtx->nOrderPos,wtx->GetHash().GetHex().c_str()); } + + CWalletDB* pwalletdb = pwalletdbIn ? pwalletdbIn : new CWalletDB(strWalletFile); acentries.clear(); - walletdb.ListAccountCreditDebit(strAccount, acentries); + pwalletdb->ListAccountCreditDebit(strAccount, acentries); BOOST_FOREACH(CAccountingEntry& entry, acentries) { txOrdered.insert(make_pair(entry.nOrderPos, TxPair((CWalletTx*)0, &entry))); } + if (!pwalletdbIn) delete pwalletdb; return txOrdered; } @@ -1509,7 +1511,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletD // Tolerate times up to the last timestamp in the wallet not more than 5 minutes into the future int64_t latestTolerated = latestNow + 300; std::list acentries; - TxItems txOrdered = OrderedTxItems(acentries); + TxItems txOrdered = OrderedTxItems(acentries, "", pwalletdb); for (TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it) { CWalletTx *const pwtx = (*it).second.first; diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index ac45158daa8..9ac0c5f630b 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1127,7 +1127,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface * @return multimap of ordered transactions and accounting entries * @warning Returned pointers are *only* valid within the scope of passed acentries */ - TxItems OrderedTxItems(std::list& acentries, std::string strAccount = ""); + TxItems OrderedTxItems(std::list& acentries, std::string strAccount = "", CWalletDB *pwalletdbIn = nullptr); void MarkDirty(); bool UpdateNullifierNoteMap(); From 6b906fd75af1f7472465fa07758e6e7bdf4b4a9d Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Fri, 17 Nov 2023 15:19:20 +0100 Subject: [PATCH 02/12] build: fix build on xenial (16.04) Without -fPIC for libcryptoconditions_core.a build will end with error below on Xenial: ``` /usr/bin/ld: cryptoconditions/libcryptoconditions_core.a(libcryptoconditions_core_a-cryptoconditions.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC cryptoconditions/libcryptoconditions_core.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status ``` --- src/cryptoconditions/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptoconditions/Makefile.am b/src/cryptoconditions/Makefile.am index eab77eeff0f..504abd6e0de 100644 --- a/src/cryptoconditions/Makefile.am +++ b/src/cryptoconditions/Makefile.am @@ -65,7 +65,7 @@ libcryptoconditions_core_a_SOURCES = \ src/asn/per_decoder.c \ src/asn/per_encoder.c \ src/asn/per_opentype.c -libcryptoconditions_core_a_CPPFLAGS=-I. -I./src/include -I./src/asn +libcryptoconditions_core_a_CPPFLAGS=-I. -I./src/include -I./src/asn -fPIC test: bash -c '[ -d .env ] || virtualenv .env -p python3' From 350efc0297682bcf8bce55b0844b83e61df7e0c3 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Thu, 18 Mar 2021 09:34:55 -0300 Subject: [PATCH 03/12] Add chain supply and transparent value to block index. Co-authored-by: Jack Grigg Co-authored-by: Kris Nuttycombe Co-authored-by: Daira Hopwood --- src/chain.h | 41 ++++++++++++++++ src/coins.cpp | 7 ++- src/coins.h | 15 +++++- src/main.cpp | 105 ++++++++++++++++++++++++++++++++++++++++- src/rpc/blockchain.cpp | 50 ++++++++++++++++---- src/txdb.cpp | 2 + 6 files changed, 207 insertions(+), 13 deletions(-) diff --git a/src/chain.h b/src/chain.h index 56bedb0c04a..2c620770008 100644 --- a/src/chain.h +++ b/src/chain.h @@ -39,6 +39,7 @@ extern CCriticalSection cs_main; static const int SPROUT_VALUE_VERSION = 80102; static const int SAPLING_VALUE_VERSION = 80102; +static const int TRANSPARENT_VALUE_VERSION = 80103; // These 5 are declared here to avoid circular dependencies // code used this moved into .cpp @@ -193,6 +194,34 @@ class CBlockIndex //! (memory only) The anchor for the tree state up to the end of this block uint256 hashFinalSproutRoot; + //! The change to the chain supply caused by this block. This is defined as + //! the value of the coinbase outputs in this block, minus fees not claimed + //! by the miner. + //! + //! Will be std::nullopt under the following conditions: + //! - if the block has never been connected to a chain tip + //! - for older blocks until a reindex has taken place + boost::optional nChainSupplyDelta; + + //! (memory only) Total chain supply up to and including this block. + //! + //! Will be std::nullopt until a reindex has taken place, if nChainTx is + //! zero, or if the block has never been connected to a chain tip. + boost::optional nChainTotalSupply; + + //! Change in value in the transparent pool produced by the action of the + //! transparent inputs to and outputs from transactions in this block. + //! + //! Will be std::nullopt for older blocks until a reindex has taken place. + boost::optional nTransparentValue; + + //! (memory only) Total value of the transparent value pool up to and + //! including this block. + //! + //! Will be std::nullopt until a reindex has taken place. + //! Will be std::nullopt if nChainTx is zero. + boost::optional nChainTransparentValue; + //! Change in value held by the Sprout circuit over this block. //! Will be boost::none for older blocks on old nodes until a reindex has taken place. boost::optional nSproutValue; @@ -249,6 +278,11 @@ class CBlockIndex hashSproutAnchor = uint256(); hashFinalSproutRoot = uint256(); nSequenceId = 0; + + nChainSupplyDelta = boost::none; + nChainTotalSupply = boost::none; + nTransparentValue = boost::none; + nChainTransparentValue = boost::none; nSproutValue = boost::none; nChainSproutValue = boost::none; nSaplingValue = 0; @@ -443,6 +477,13 @@ class CDiskBlockIndex : public CBlockIndex READWRITE(nNonce); READWRITE(nSolution); + // Only read/write nTransparentValue if the client version used to create + // this index was storing them. + if ((s.GetType() & SER_DISK) && (nVersion >= TRANSPARENT_VALUE_VERSION)) { + READWRITE(nChainSupplyDelta); + READWRITE(nTransparentValue); + } + // Only read/write nSproutValue if the client version used to create // this index was storing them. if ((s.GetType() & SER_DISK) && (nVersion >= SPROUT_VALUE_VERSION)) { diff --git a/src/coins.cpp b/src/coins.cpp index c2e7ff4c64a..11c4526cbe6 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -590,6 +590,12 @@ const CScript &CCoinsViewCache::GetSpendFor(const CTxIn& input) const * @returns Sum of value of all inputs (scriptSigs), (positive valueBalance or zero) and JoinSplit vpub_new */ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t &interestp,const CTransaction& tx) const +{ + return GetTransparentValueIn(nHeight, interestp, tx) + tx.GetShieldedValueIn(); +} + +// TODO: remove this if it ends up unused +CAmount CCoinsViewCache::GetTransparentValueIn(int32_t nHeight,int64_t &interestp,const CTransaction& tx) const { CAmount value,nResult = 0; interestp = 0; @@ -617,7 +623,6 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t &interestp,const CTr } #endif } - nResult += tx.GetShieldedValueIn(); return nResult; } diff --git a/src/coins.h b/src/coins.h index d26dd792de7..5f6beae4235 100644 --- a/src/coins.h +++ b/src/coins.h @@ -562,11 +562,22 @@ class CCoinsViewCache : public CCoinsViewBacked * so may not be able to calculate this. * @param[in] nHeight the chain height * @param[out] interestp the interest found - * @param[in] tx transaction for which we are checking input total - * @returns Sum of value of all inputs (scriptSigs), (positive valueBalance or zero) and JoinSplit vpub_new + * @param[in] tx transaction for which we are checking input total + * @return Sum of value of all inputs (scriptSigs), JoinSplit vpub_new, and + * positive values of valueBalanceSapling, and valueBalanceOrchard. */ CAmount GetValueIn(int32_t nHeight,int64_t &interestp,const CTransaction& tx) const; + /** + * Amount of coins coming in to a transaction in the transparent inputs. + * + * @param[in] nHeight the chain height + * @param[out] interestp the interest found + * @param[in] tx transaction for which we are checking input total + * @return Sum of value of all inputs (scriptSigs) + */ + CAmount GetTransparentValueIn(int32_t nHeight,int64_t &interestp,const CTransaction& tx) const; + //! Check whether all prevouts of the transaction are present in the UTXO set represented by this view bool HaveInputs(const CTransaction& tx) const; diff --git a/src/main.cpp b/src/main.cpp index a3468c3d636..9ec525bde8a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3506,6 +3506,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // Grab the consensus branch ID for the block's height auto consensusBranchId = CurrentEpochBranchId(pindex->nHeight, Params().GetConsensus()); + CAmount chainSupplyDelta = 0; + CAmount transparentValueDelta = 0; std::vector txdata; txdata.reserve(block.vtx.size()); // Required so that pointers to individual PrecomputedTransactionData don't get invalidated for (unsigned int i = 0; i < block.vtx.size(); i++) @@ -3525,6 +3527,12 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return state.DoS(100, error("ConnectBlock(): inputs missing/spent"), REJECT_INVALID, "bad-txns-inputs-missingorspent"); } + + for (const auto& input : tx.vin) { + const auto prevout = view.GetOutputFor(input); + transparentValueDelta -= prevout.nValue; + } + // are the JoinSplit's requirements met? if (!view.HaveJoinSplitRequirements(tx)) return state.DoS(100, error("ConnectBlock(): JoinSplit requirements not met"), @@ -3579,9 +3587,21 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin fprintf(stderr,"valueout %.8f too big\n",(double)valueout/COIN); return state.DoS(100, error("ConnectBlock(): GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); } - if (!tx.IsCoinBase()) + if (tx.IsCoinBase()) { - nFees += (stakeTxValue= view.GetValueIn(chainActive.Tip()->nHeight,interest,tx) - valueout); + // Add the output value of the coinbase transaction to the chain supply + // delta. This includes fees, which are then canceled out by the fee + // subtractions in the other branch of this conditional. + chainSupplyDelta += tx.GetValueOut(); + } else { + const auto txFee = (stakeTxValue= view.GetValueIn(chainActive.Tip()->nHeight,interest,tx) - valueout); + nFees += txFee; + + // Fees from a transaction do not go into an output of the transaction, + // and therefore decrease the chain supply. If the miner claims them, + // they will be re-added in the other branch of this conditional. + chainSupplyDelta -= txFee; + sum += interest; std::vector vChecks; @@ -3632,6 +3652,10 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin sapling_tree.append(outputDescription.cm); } + for (const auto& out : tx.vout) { + transparentValueDelta += out.nValue; + } + vPos.push_back(std::make_pair(tx.GetHash(), pos)); pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION); } @@ -3643,6 +3667,27 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin view.PushAnchor(sprout_tree); view.PushAnchor(sapling_tree); if (!fJustCheck) { + // Update pindex with the net change in transparent value and the chain's total + // transparent value. + pindex->nChainSupplyDelta = chainSupplyDelta; + pindex->nTransparentValue = transparentValueDelta; + if (pindex->pprev) { + if (pindex->pprev->nChainTotalSupply) { + pindex->nChainTotalSupply = *pindex->pprev->nChainTotalSupply + chainSupplyDelta; + } else { + pindex->nChainTotalSupply = boost::none; + } + + if (pindex->pprev->nChainTransparentValue) { + pindex->nChainTransparentValue = *pindex->pprev->nChainTransparentValue + transparentValueDelta; + } else { + pindex->nChainTransparentValue = boost::none; + } + } else { + pindex->nChainTotalSupply = chainSupplyDelta; + pindex->nChainTransparentValue = transparentValueDelta; + } + pindex->hashFinalSproutRoot = sprout_tree.root(); } blockundo.old_sprout_tree_root = old_sprout_tree_root; @@ -4694,9 +4739,22 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl { pindexNew->nTx = block.vtx.size(); pindexNew->nChainTx = 0; + + // the following values are computed here only for the genesis block + CAmount chainSupplyDelta = 0; + CAmount transparentValueDelta = 0; + CAmount sproutValue = 0; CAmount saplingValue = 0; for (auto tx : block.vtx) { + // For the genesis block only, compute the chain supply delta and the transparent + // output total. + if (pindexNew->pprev == nullptr) { + chainSupplyDelta = tx.GetValueOut(); + for (const auto& out : tx.vout) { + transparentValueDelta += out.nValue; + } + } // Negative valueBalance "takes" money from the transparent value pool // and adds it to the Sapling value pool. Positive valueBalance "gives" // money to the transparent value pool, removing from the Sapling value @@ -4708,6 +4766,20 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl sproutValue -= js.vpub_new; } } + + // These values can only be computed here for the genesis block. + // For all other blocks, we update them in ConnectBlock instead. + if (pindexNew->pprev == nullptr) { + pindexNew->nChainSupplyDelta = chainSupplyDelta; + pindexNew->nTransparentValue = transparentValueDelta; + } else { + pindexNew->nChainSupplyDelta = boost::none; + pindexNew->nTransparentValue = boost::none; + } + + pindexNew->nChainTotalSupply = boost::none; + pindexNew->nChainTransparentValue = boost::none; + pindexNew->nSproutValue = sproutValue; pindexNew->nChainSproutValue = boost::none; pindexNew->nSaplingValue = saplingValue; @@ -4729,18 +4801,29 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl CBlockIndex *pindex = queue.front(); queue.pop_front(); pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx; + if (pindex->pprev) { + // Transparent value and chain total supply are added to the + // block index only in `ConnectBlock`, because that's the only + // place that we have a valid coins view with which to compute + // the transparent input value and fees. + + // Calculate the block's effect on the Sprout chain value pool balance. if (pindex->pprev->nChainSproutValue && pindex->nSproutValue) { pindex->nChainSproutValue = *pindex->pprev->nChainSproutValue + *pindex->nSproutValue; } else { pindex->nChainSproutValue = boost::none; } + + // calculate the block's effect on the chain's net Sapling value if (pindex->pprev->nChainSaplingValue) { pindex->nChainSaplingValue = *pindex->pprev->nChainSaplingValue + pindex->nSaplingValue; } else { pindex->nChainSaplingValue = boost::none; } } else { + pindex->nChainTotalSupply = pindex->nChainSupplyDelta; + pindex->nChainTransparentValue = pindex->nTransparentValue; pindex->nChainSproutValue = pindex->nSproutValue; pindex->nChainSaplingValue = pindex->nSaplingValue; } @@ -6048,11 +6131,25 @@ bool static LoadBlockIndexDB() if (pindex->pprev) { if (pindex->pprev->nChainTx) { pindex->nChainTx = pindex->pprev->nChainTx + pindex->nTx; + + if (pindex->pprev->nChainTotalSupply && pindex->nChainSupplyDelta) { + pindex->nChainTotalSupply = *pindex->pprev->nChainTotalSupply + *pindex->nChainSupplyDelta; + } else { + pindex->nChainTotalSupply = boost::none; + } + + if (pindex->pprev->nChainTransparentValue && pindex->nTransparentValue) { + pindex->nChainTransparentValue = *pindex->pprev->nChainTransparentValue + *pindex->nTransparentValue; + } else { + pindex->nChainTransparentValue = boost::none; + } + if (pindex->pprev->nChainSproutValue && pindex->nSproutValue) { pindex->nChainSproutValue = *pindex->pprev->nChainSproutValue + *pindex->nSproutValue; } else { pindex->nChainSproutValue = boost::none; } + if (pindex->pprev->nChainSaplingValue) { pindex->nChainSaplingValue = *pindex->pprev->nChainSaplingValue + pindex->nSaplingValue; } else { @@ -6060,12 +6157,16 @@ bool static LoadBlockIndexDB() } } else { pindex->nChainTx = 0; + pindex->nChainTotalSupply = boost::none; + pindex->nChainTransparentValue = boost::none; pindex->nChainSproutValue = boost::none; pindex->nChainSaplingValue = boost::none; mapBlocksUnlinked.insert(std::make_pair(pindex->pprev, pindex)); } } else { pindex->nChainTx = pindex->nTx; + pindex->nChainTotalSupply = pindex->nChainSupplyDelta; + pindex->nChainTransparentValue = pindex->nTransparentValue; pindex->nChainSproutValue = pindex->nSproutValue; pindex->nChainSaplingValue = pindex->nSaplingValue; } diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 3eb9b11422d..9d9a9a31f00 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -119,12 +119,14 @@ double GetNetworkDifficulty(const CBlockIndex* blockindex) } static UniValue ValuePoolDesc( - const std::string &name, + const boost::optional name, const boost::optional chainValue, const boost::optional valueDelta) { UniValue rv(UniValue::VOBJ); - rv.push_back(Pair("id", name)); + if (name.is_initialized()) { + rv.pushKV("id", name.value()); + } rv.push_back(Pair("monitored", (bool)chainValue)); if (chainValue) { rv.push_back(Pair("chainValue", ValueFromAmount(*chainValue))); @@ -335,11 +337,11 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx result.push_back(Pair("difficulty", GetDifficulty(blockindex))); result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex())); result.push_back(Pair("anchor", blockindex->hashFinalSproutRoot.GetHex())); - result.push_back(Pair("blocktype", "mined")); - + result.pushKV("chainSupply", ValuePoolDesc(boost::none, blockindex->nChainTotalSupply, blockindex->nChainSupplyDelta)); UniValue valuePools(UniValue::VARR); - valuePools.push_back(ValuePoolDesc("sprout", blockindex->nChainSproutValue, blockindex->nSproutValue)); - valuePools.push_back(ValuePoolDesc("sapling", blockindex->nChainSaplingValue, blockindex->nSaplingValue)); + valuePools.push_back(ValuePoolDesc(std::string("transparent"), blockindex->nChainTransparentValue, blockindex->nTransparentValue)); + valuePools.push_back(ValuePoolDesc(std::string("sprout"), blockindex->nChainSproutValue, blockindex->nSproutValue)); + valuePools.push_back(ValuePoolDesc(std::string("sapling"), blockindex->nChainSaplingValue, blockindex->nSaplingValue)); result.push_back(Pair("valuePools", valuePools)); if (blockindex->pprev) @@ -854,6 +856,23 @@ UniValue getblock(const UniValue& params, bool fHelp, const CPubKey& mypk) " \"nonce\" : n, (numeric) The nonce\n" " \"bits\" : \"1d00ffff\", (string) The bits\n" " \"difficulty\" : x.xxx, (numeric) The difficulty\n" + " \"chainSupply\": { (object) information about the total supply\n" + " \"monitored\": xx, (boolean) true if the total supply is being monitored\n" + " \"chainValue\": xxxxxx, (numeric, optional) total chain supply\n" + " \"chainValueZat\": xxxxxx, (numeric, optional) total chain supply in satoshis\n" + " \"valueDelta\": xxxxxx, (numeric, optional) change to the chain supply produced by this block\n" + " \"valueDeltaZat\": xxxxxx, (numeric, optional) change to the chain supply produced by this block, in satoshis\n" + " }\n" + " \"valuePools\": [ (array) information about each value pool\n" + " {\n" + " \"id\": \"xxxx\", (string) name of the pool\n" + " \"monitored\": xx, (boolean) true if the pool is being monitored\n" + " \"chainValue\": xxxxxx, (numeric, optional) total amount in the pool\n" + " \"chainValueZat\": xxxxxx, (numeric, optional) total amount in the pool in satoshis\n" + " \"valueDelta\": xxxxxx, (numeric, optional) change to the amount in the pool produced by this block\n" + " \"valueDeltaZat\": xxxxxx, (numeric, optional) change to the amount in the pool produced by this block, in satoshis\n" + " }, ...\n" + " ]\n" " \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n" " \"nextblockhash\" : \"hash\" (string) The hash of the next block\n" "}\n" @@ -1339,6 +1358,19 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp, const CPubKey& my " \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n" " \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n" " \"commitments\": xxxxxx, (numeric) the current number of note commitments in the commitment tree\n" + " \"chainSupply\": { (object) information about the total supply\n" + " \"monitored\": xx, (boolean) true if the total supply is being monitored\n" + " \"chainValue\": xxxxxx, (numeric, optional) total chain supply\n" + " \"chainValueZat\": xxxxxx, (numeric, optional) total chain supply in satoshis\n" + " }\n" + " \"valuePools\": [ (array) information about each value pool\n" + " {\n" + " \"id\": \"xxxx\", (string) name of the pool\n" + " \"monitored\": xx, (boolean) true if the pool is being monitored\n" + " \"chainValue\": xxxxxx, (numeric, optional) total amount in the pool\n" + " \"chainValueZat\": xxxxxx, (numeric, optional) total amount in the pool in satoshis\n" + " }, ...\n" + " ]\n" " \"softforks\": [ (array) status of softforks in progress\n" " {\n" " \"id\": \"xxxx\", (string) name of softfork\n" @@ -1394,9 +1426,11 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp, const CPubKey& my obj.push_back(Pair("commitments", static_cast(tree.size()))); CBlockIndex* tip = chainActive.Tip(); + obj.pushKV("chainSupply", ValuePoolDesc(boost::none, tip->nChainTotalSupply, boost::none)); UniValue valuePools(UniValue::VARR); - valuePools.push_back(ValuePoolDesc("sprout", tip->nChainSproutValue, boost::none)); - valuePools.push_back(ValuePoolDesc("sapling", tip->nChainSaplingValue, boost::none)); + valuePools.push_back(ValuePoolDesc(std::string("transparent"), tip->nChainTransparentValue, boost::none)); + valuePools.push_back(ValuePoolDesc(std::string("sprout"), tip->nChainSproutValue, boost::none)); + valuePools.push_back(ValuePoolDesc(std::string("sapling"), tip->nChainSaplingValue, boost::none)); obj.push_back(Pair("valuePools", valuePools)); const Consensus::Params& consensusParams = Params().GetConsensus(); diff --git a/src/txdb.cpp b/src/txdb.cpp index b87d3487439..7e3857b6e27 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -738,6 +738,8 @@ bool CBlockTreeDB::LoadBlockIndexGuts() pindexNew->nStatus = diskindex.nStatus; pindexNew->nCachedBranchId = diskindex.nCachedBranchId; pindexNew->nTx = diskindex.nTx; + pindexNew->nChainSupplyDelta = diskindex.nChainSupplyDelta; + pindexNew->nTransparentValue = diskindex.nTransparentValue; pindexNew->nSproutValue = diskindex.nSproutValue; pindexNew->nSaplingValue = diskindex.nSaplingValue; pindexNew->segid = diskindex.segid; From 080e7bc12373f426d913b8d9372e4e2fe21edfaf Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 20 Nov 2023 16:05:13 +0100 Subject: [PATCH 04/12] fix transparent pool addition for unspendable outputs --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 9ec525bde8a..24ecff8d92b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3653,7 +3653,10 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } for (const auto& out : tx.vout) { - transparentValueDelta += out.nValue; + // If the outputs are unspendable, we should not include them in the transparent pool + if (!out.scriptPubKey.IsOpReturn()) { + transparentValueDelta += out.nValue; + } } vPos.push_back(std::make_pair(tx.GetHash(), pos)); From 38822d9601fa80ebda35a3d57bbd33b21146936c Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 20 Nov 2023 16:10:36 +0100 Subject: [PATCH 05/12] chain.h: change std::nullopt to boost::none in comments --- src/chain.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chain.h b/src/chain.h index 2c620770008..e5801f10d2c 100644 --- a/src/chain.h +++ b/src/chain.h @@ -198,28 +198,28 @@ class CBlockIndex //! the value of the coinbase outputs in this block, minus fees not claimed //! by the miner. //! - //! Will be std::nullopt under the following conditions: + //! Will be boost::none under the following conditions: //! - if the block has never been connected to a chain tip //! - for older blocks until a reindex has taken place boost::optional nChainSupplyDelta; //! (memory only) Total chain supply up to and including this block. //! - //! Will be std::nullopt until a reindex has taken place, if nChainTx is + //! Will be boost::none until a reindex has taken place, if nChainTx is //! zero, or if the block has never been connected to a chain tip. boost::optional nChainTotalSupply; //! Change in value in the transparent pool produced by the action of the //! transparent inputs to and outputs from transactions in this block. //! - //! Will be std::nullopt for older blocks until a reindex has taken place. + //! Will be boost::none for older blocks until a reindex has taken place. boost::optional nTransparentValue; //! (memory only) Total value of the transparent value pool up to and //! including this block. //! - //! Will be std::nullopt until a reindex has taken place. - //! Will be std::nullopt if nChainTx is zero. + //! Will be boost::none until a reindex has taken place. + //! Will be boost::none if nChainTx is zero. boost::optional nChainTransparentValue; //! Change in value held by the Sprout circuit over this block. From 3b673f0591e54fcd0ff0bfef455cd9c4a6adc462 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 20 Nov 2023 17:11:11 +0100 Subject: [PATCH 06/12] introduce burned coins value pool burned coins refer to the value sent for OP_RETURN scripts: ``` "vout": [ ... { "value": 2.00000000, "valueZat": 200000000, "n": 1, "scriptPubKey": { "asm": "OP_RETURN 6465636b6572", "hex": "6a066465636b6572", "type": "nulldata" } } ], "vjoinsplit": [ ] ``` burned coins are also excluded from transparent pool. --- src/chain.h | 19 +++++++++++++++++++ src/chainparams.cpp | 2 +- src/main.cpp | 35 ++++++++++++++++++++++++++++++++--- src/rpc/blockchain.cpp | 2 ++ src/txdb.cpp | 1 + 5 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/chain.h b/src/chain.h index e5801f10d2c..9eef9f61e0f 100644 --- a/src/chain.h +++ b/src/chain.h @@ -40,6 +40,7 @@ extern CCriticalSection cs_main; static const int SPROUT_VALUE_VERSION = 80102; static const int SAPLING_VALUE_VERSION = 80102; static const int TRANSPARENT_VALUE_VERSION = 80103; +static const int BURNED_VALUE_VERSION = 80104; // These 5 are declared here to avoid circular dependencies // code used this moved into .cpp @@ -222,6 +223,16 @@ class CBlockIndex //! Will be boost::none if nChainTx is zero. boost::optional nChainTransparentValue; + // This refers to the number of coins burned in this block, + // essentially making them unspendable (due to the OP_RETURN scripts value). + //! + //! For older blocks, this will be boost::none until a reindexing has occurred. + boost::optional nBurnedAmountDelta; + + //! (memory only) Total value of the burned coins up to and + //! including this block. + boost::optional nChainTotalBurned; + //! Change in value held by the Sprout circuit over this block. //! Will be boost::none for older blocks on old nodes until a reindex has taken place. boost::optional nSproutValue; @@ -283,6 +294,8 @@ class CBlockIndex nChainTotalSupply = boost::none; nTransparentValue = boost::none; nChainTransparentValue = boost::none; + nBurnedAmountDelta = boost::none; + nChainTotalBurned = boost::none; nSproutValue = boost::none; nChainSproutValue = boost::none; nSaplingValue = 0; @@ -484,6 +497,12 @@ class CDiskBlockIndex : public CBlockIndex READWRITE(nTransparentValue); } + // Only read/write nBurnedAmountDelta if the client version used to create + // this index was storing them. + if ((s.GetType() & SER_DISK) && (nVersion >= BURNED_VALUE_VERSION)) { + READWRITE(nBurnedAmountDelta); + } + // Only read/write nSproutValue if the client version used to create // this index was storing them. if ((s.GetType() & SER_DISK) && (nVersion >= SPROUT_VALUE_VERSION)) { diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 206bbceb204..f20cc355e0b 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -212,7 +212,7 @@ class CMainParams : public CChainParams { vFixedSeeds = std::vector(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); - fMiningRequiresPeers = true; + fMiningRequiresPeers = false; fDefaultConsistencyChecks = false; fRequireStandard = true; fMineBlocksOnDemand = false; diff --git a/src/main.cpp b/src/main.cpp index 24ecff8d92b..8b03baac5b2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3508,6 +3508,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin CAmount chainSupplyDelta = 0; CAmount transparentValueDelta = 0; + CAmount burnedAmountDelta = 0; std::vector txdata; txdata.reserve(block.vtx.size()); // Required so that pointers to individual PrecomputedTransactionData don't get invalidated for (unsigned int i = 0; i < block.vtx.size(); i++) @@ -3653,9 +3654,12 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } for (const auto& out : tx.vout) { - // If the outputs are unspendable, we should not include them in the transparent pool - if (!out.scriptPubKey.IsOpReturn()) { + if (!out.scriptPubKey.IsUnspendable()) { transparentValueDelta += out.nValue; + } else { + // If the outputs are unspendable, we should not include them in the transparent pool, + // but include in the burned amount calculations + burnedAmountDelta += out.nValue; } } @@ -3674,6 +3678,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // transparent value. pindex->nChainSupplyDelta = chainSupplyDelta; pindex->nTransparentValue = transparentValueDelta; + pindex->nBurnedAmountDelta = burnedAmountDelta; if (pindex->pprev) { if (pindex->pprev->nChainTotalSupply) { pindex->nChainTotalSupply = *pindex->pprev->nChainTotalSupply + chainSupplyDelta; @@ -3686,9 +3691,16 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } else { pindex->nChainTransparentValue = boost::none; } + + if (pindex->pprev->nChainTotalBurned) { + pindex->nChainTotalBurned = *pindex->pprev->nChainTotalBurned + burnedAmountDelta; + } else { + pindex->nChainTotalBurned = boost::none; + } } else { pindex->nChainTotalSupply = chainSupplyDelta; pindex->nChainTransparentValue = transparentValueDelta; + pindex->nChainTotalBurned = burnedAmountDelta; } pindex->hashFinalSproutRoot = sprout_tree.root(); @@ -4746,6 +4758,7 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl // the following values are computed here only for the genesis block CAmount chainSupplyDelta = 0; CAmount transparentValueDelta = 0; + CAmount burnedAmountDelta = 0; CAmount sproutValue = 0; CAmount saplingValue = 0; @@ -4755,7 +4768,11 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl if (pindexNew->pprev == nullptr) { chainSupplyDelta = tx.GetValueOut(); for (const auto& out : tx.vout) { - transparentValueDelta += out.nValue; + if (!out.scriptPubKey.IsUnspendable()) { + transparentValueDelta += out.nValue; + } else { + burnedAmountDelta += out.nValue; + } } } // Negative valueBalance "takes" money from the transparent value pool @@ -4775,13 +4792,16 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl if (pindexNew->pprev == nullptr) { pindexNew->nChainSupplyDelta = chainSupplyDelta; pindexNew->nTransparentValue = transparentValueDelta; + pindexNew->nBurnedAmountDelta = burnedAmountDelta; } else { pindexNew->nChainSupplyDelta = boost::none; pindexNew->nTransparentValue = boost::none; + pindexNew->nBurnedAmountDelta = boost::none; } pindexNew->nChainTotalSupply = boost::none; pindexNew->nChainTransparentValue = boost::none; + pindexNew->nChainTotalBurned = boost::none; pindexNew->nSproutValue = sproutValue; pindexNew->nChainSproutValue = boost::none; @@ -4827,6 +4847,7 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl } else { pindex->nChainTotalSupply = pindex->nChainSupplyDelta; pindex->nChainTransparentValue = pindex->nTransparentValue; + pindex->nChainTotalBurned = pindex->nBurnedAmountDelta; pindex->nChainSproutValue = pindex->nSproutValue; pindex->nChainSaplingValue = pindex->nSaplingValue; } @@ -6147,6 +6168,12 @@ bool static LoadBlockIndexDB() pindex->nChainTransparentValue = boost::none; } + if (pindex->pprev->nChainTotalBurned && pindex->nBurnedAmountDelta) { + pindex->nChainTotalBurned = *pindex->pprev->nChainTotalBurned + *pindex->nBurnedAmountDelta; + } else { + pindex->nChainTotalBurned = boost::none; + } + if (pindex->pprev->nChainSproutValue && pindex->nSproutValue) { pindex->nChainSproutValue = *pindex->pprev->nChainSproutValue + *pindex->nSproutValue; } else { @@ -6162,6 +6189,7 @@ bool static LoadBlockIndexDB() pindex->nChainTx = 0; pindex->nChainTotalSupply = boost::none; pindex->nChainTransparentValue = boost::none; + pindex->nChainTotalBurned = boost::none; pindex->nChainSproutValue = boost::none; pindex->nChainSaplingValue = boost::none; mapBlocksUnlinked.insert(std::make_pair(pindex->pprev, pindex)); @@ -6170,6 +6198,7 @@ bool static LoadBlockIndexDB() pindex->nChainTx = pindex->nTx; pindex->nChainTotalSupply = pindex->nChainSupplyDelta; pindex->nChainTransparentValue = pindex->nTransparentValue; + pindex->nChainTotalBurned = pindex->nBurnedAmountDelta; pindex->nChainSproutValue = pindex->nSproutValue; pindex->nChainSaplingValue = pindex->nSaplingValue; } diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 9d9a9a31f00..88355bb5e65 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -342,6 +342,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx valuePools.push_back(ValuePoolDesc(std::string("transparent"), blockindex->nChainTransparentValue, blockindex->nTransparentValue)); valuePools.push_back(ValuePoolDesc(std::string("sprout"), blockindex->nChainSproutValue, blockindex->nSproutValue)); valuePools.push_back(ValuePoolDesc(std::string("sapling"), blockindex->nChainSaplingValue, blockindex->nSaplingValue)); + valuePools.push_back(ValuePoolDesc(std::string("burned"), blockindex->nChainTotalBurned, blockindex->nBurnedAmountDelta)); result.push_back(Pair("valuePools", valuePools)); if (blockindex->pprev) @@ -1431,6 +1432,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp, const CPubKey& my valuePools.push_back(ValuePoolDesc(std::string("transparent"), tip->nChainTransparentValue, boost::none)); valuePools.push_back(ValuePoolDesc(std::string("sprout"), tip->nChainSproutValue, boost::none)); valuePools.push_back(ValuePoolDesc(std::string("sapling"), tip->nChainSaplingValue, boost::none)); + valuePools.push_back(ValuePoolDesc(std::string("burned"), tip->nChainTotalBurned, boost::none)); obj.push_back(Pair("valuePools", valuePools)); const Consensus::Params& consensusParams = Params().GetConsensus(); diff --git a/src/txdb.cpp b/src/txdb.cpp index 7e3857b6e27..357943285f7 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -740,6 +740,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts() pindexNew->nTx = diskindex.nTx; pindexNew->nChainSupplyDelta = diskindex.nChainSupplyDelta; pindexNew->nTransparentValue = diskindex.nTransparentValue; + pindexNew->nBurnedAmountDelta = diskindex.nBurnedAmountDelta; pindexNew->nSproutValue = diskindex.nSproutValue; pindexNew->nSaplingValue = diskindex.nSaplingValue; pindexNew->segid = diskindex.segid; From 7b697e36943fcf415cbaf780e7154105e8be6681 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Wed, 29 Nov 2023 14:27:32 +0100 Subject: [PATCH 07/12] bump version [0.8.1.4] this update activates burned coins value pool, see: BURNED_VALUE_VERSION --- configure.ac | 2 +- src/clientversion.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 4a99208dac3..a654ff3b722 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 8) define(_CLIENT_VERSION_REVISION, 1) -define(_CLIENT_VERSION_BUILD, 2) +define(_CLIENT_VERSION_BUILD, 4) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) define(_CLIENT_VERSION_IS_RELEASE, true) diff --git a/src/clientversion.h b/src/clientversion.h index 95beac6e3b7..b92ce4f37dd 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -33,7 +33,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 8 #define CLIENT_VERSION_REVISION 1 -#define CLIENT_VERSION_BUILD 2 +#define CLIENT_VERSION_BUILD 4 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true From 0d37ff3a3d8cc781a012448af03b7191d77abd9e Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Fri, 1 Dec 2023 19:00:53 +0100 Subject: [PATCH 08/12] revert fMiningRequiresPeers change on CMainParams The change was made solely for debugging purposes and was accidentally included in the PR. We are now reverting that change. --- src/chainparams.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f20cc355e0b..206bbceb204 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -212,7 +212,7 @@ class CMainParams : public CChainParams { vFixedSeeds = std::vector(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); - fMiningRequiresPeers = false; + fMiningRequiresPeers = true; fDefaultConsistencyChecks = false; fRequireStandard = true; fMineBlocksOnDemand = false; From 6deae3e0e40ea5c22e98127b6db7c85d147e9641 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Fri, 1 Dec 2023 19:16:37 +0100 Subject: [PATCH 09/12] remove unused CompareBlocksByHeightMain comparator --- src/main.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8b03baac5b2..0c30306074d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2145,20 +2145,6 @@ bool GetAddressUnspent(uint160 addressHash, int type, return true; } -struct CompareBlocksByHeightMain -{ - bool operator()(const CBlockIndex* a, const CBlockIndex* b) const - { - /* Make sure that unequal blocks with the same height do not compare - equal. Use the pointers themselves to make a distinction. */ - - if (a->nHeight != b->nHeight) - return (a->nHeight > b->nHeight); - - return a < b; - } -}; - /**** * @brief add a transaction to the mempool * @param[in] tx the transaction From 64a823261a4e832c1bc4824d1e0de666cd9bd849 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Thu, 25 Jan 2024 20:31:04 +0100 Subject: [PATCH 10/12] update assetchains.{json,old} to actual version get rid of using THC chain name in ParseArgumentsTests --- src/assetchains.json | 104 +++++----------------------- src/assetchains.old | 1 - src/test-komodo/test_parse_args.cpp | 4 +- 3 files changed, 21 insertions(+), 88 deletions(-) diff --git a/src/assetchains.json b/src/assetchains.json index 675f96ddcc9..d6d685f4bc8 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -1,12 +1,4 @@ [ - { - "ac_name": "BET", - "ac_supply": "999999" - }, - { - "ac_name": "BOTS", - "ac_supply": "999999" - }, { "ac_name": "CCL", "ac_supply": "200000000", @@ -14,7 +6,7 @@ "ac_cc": "2", "addressindex": "1", "spentindex": "1", - "addnode": ["142.93.136.89", "195.201.22.89"] + "addnode": ["209.222.101.247", "103.195.100.32", "142.93.136.89", "195.201.22.89", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { "ac_name": "CLC", @@ -27,70 +19,46 @@ "ac_snapshot":"1440", "ac_pubkey":"02df9bda7bfe2bcaa938b29a399fb0ba58cfb6cc3ddc0001062a600f60a8237ad9", "ac_adaptivepow":"6", - "addnode": ["node.cryptocollider.com"] + "addnode": ["209.222.101.247", "103.195.100.32", "node.cryptocollider.com", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { - "ac_name": "CRYPTO", - "ac_supply": "999999" - }, - { - "ac_name": "DEX", - "ac_supply": "999999" + "ac_name": "DOC", + "ac_supply": "90000000000", + "ac_reward": "100000000", + "ac_cc": "3", + "ac_staked": "10", + "addnode": ["209.222.101.247", "103.195.100.32", "65.21.77.109", "65.21.51.47", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { "ac_name": "GLEEC", "ac_supply": "210000000", "ac_public": "1", "ac_staked": "100", - "addnode":["95.217.161.126"] - }, - { - "ac_name": "HODL", - "ac_supply": "9999999" + "addnode": ["209.222.101.247", "103.195.100.32", "95.217.161.126", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { "ac_name": "ILN", "ac_supply": "10000000000", "ac_cc": "2", - "addnode": ["51.75.122.83"] - }, - { - "ac_name": "JUMBLR", - "ac_supply": "999999" + "addnode": ["209.222.101.247", "103.195.100.32", "51.75.122.83", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { "ac_name": "KOIN", "ac_supply": "125000000", - "addnode": ["3.0.32.10"] - }, - { - "ac_name": "MESH", - "ac_supply": "1000007", - "ac_ccactivate": "320000" - }, - { - "ac_name": "MGW", - "ac_supply": "999999" + "addnode": ["209.222.101.247", "103.195.100.32", "3.0.32.10", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { - "ac_name": "MORTY", + "ac_name": "MARTY", "ac_supply": "90000000000", "ac_reward": "100000000", "ac_cc": "3", "ac_staked": "10", - "addnode": ["138.201.136.145", "95.217.44.58"] - }, - { - "ac_name": "MSHARK", - "ac_supply": "1400000" + "addnode": ["209.222.101.247", "103.195.100.32", "65.21.77.109", "65.21.51.47", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { "ac_name": "NINJA", - "ac_supply": "100000000" - }, - { - "ac_name": "PANGEA", - "ac_supply": "999999" + "ac_supply": "100000000", + "addnode": ["209.222.101.247", "103.195.100.32", "209.222.101.247", "103.195.100.32", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { "ac_name": "PIRATE", @@ -98,45 +66,11 @@ "ac_reward": "25600000000", "ac_halving": "77777", "ac_private": "1", - "addnode": ["88.99.212.81"] - }, - { - "ac_name": "REVS", - "ac_supply": "1300000" - }, - { - "ac_name": "RICK", - "ac_supply": "90000000000", - "ac_reward": "100000000", - "ac_cc": "3", - "ac_staked": "10", - "addnode": ["138.201.136.145", "95.217.44.58"] + "addnode": ["209.222.101.247", "103.195.100.32", "88.99.212.81", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] }, { "ac_name": "SUPERNET", - "ac_supply": "816061" - }, - { - "ac_name": "THC", - "ac_supply": "251253103", - "ac_reward": "360000000,300000000,240000000,180000000,150000000,90000000,0", - "ac_staked": "100", - "ac_eras": "7", - "ac_end": "500001,1000001,1500001,2000001,2500001,4500001,0", - "ac_perc": "233333333", - "ac_cc": "2", - "ac_ccenable": "229,236,240", - "ac_script": "2ea22c8020987fad30df055db6fd922c3a57e55d76601229ed3da3b31340112e773df3d0d28103120c008203000401ccb8", - "ac_founders": "150", - "ac_cbmaturity": "1", - "ac_sapling": "1", - "earlytxid": "7e4a76259e99c9379551389e9f757fc5f46c33ae922a8644dc2b187af2a6adc1", - "addnode": ["157.230.45.184", "165.22.52.123"] - }, - { - "ac_name": "ZILLA", - "ac_supply": "11000000", - "ac_sapling": "5000000", - "addnode": ["51.68.215.104"] + "ac_supply": "816061", + "addnode": ["209.222.101.247", "103.195.100.32", "209.222.101.247", "103.195.100.32", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"] } -] +] \ No newline at end of file diff --git a/src/assetchains.old b/src/assetchains.old index f5fd18f43cd..8801a6ab1fb 100755 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -13,4 +13,3 @@ komodod -pubkey=$pubkey -ac_name=MARTY -ac_supply=90000000000 -ac_reward=1000000 komodod -pubkey=$pubkey -ac_name=NINJA -ac_supply=100000000 -addnode=95.213.238.98 -addnode=209.222.101.247 -addnode=103.195.100.32 $1 & komodod -pubkey=$pubkey -ac_name=PIRATE -ac_supply=0 -ac_reward=25600000000 -ac_halving=77777 -ac_private=1 -addnode=88.99.212.81 -addnode=209.222.101.247 -addnode=103.195.100.32 $1 & komodod -pubkey=$pubkey -ac_name=SUPERNET -ac_supply=816061 -addnode=95.213.238.98 -addnode=209.222.101.247 -addnode=103.195.100.32 $1 & -komodod -pubkey=$pubkey -ac_name=THC -ac_supply=251253103 -ac_reward=360000000,300000000,240000000,180000000,150000000,90000000,0 -ac_staked=100 -ac_eras=7 -ac_end=500001,1000001,1500001,2000001,2500001,4500001,0 -ac_perc=233333333 -ac_cc=2 -ac_ccenable=229,236,240 -ac_script=2ea22c8020987fad30df055db6fd922c3a57e55d76601229ed3da3b31340112e773df3d0d28103120c008203000401ccb8 -ac_founders=150 -ac_cbmaturity=1 -ac_sapling=1 -addnode=157.230.45.184 -addnode=165.22.52.123 -earlytxid=7e4a76259e99c9379551389e9f757fc5f46c33ae922a8644dc2b187af2a6adc1 -addnode=209.222.101.247 -addnode=103.195.100.32 $1 & diff --git a/src/test-komodo/test_parse_args.cpp b/src/test-komodo/test_parse_args.cpp index 2e6738c6b8c..4c5af653fa3 100644 --- a/src/test-komodo/test_parse_args.cpp +++ b/src/test-komodo/test_parse_args.cpp @@ -154,7 +154,7 @@ namespace ParseArgumentsTests { {"NINJA", "-ac_name=NINJA -ac_supply=100000000 -addnode=209.222.101.247 -addnode=103.195.100.32 -addnode=209.222.101.247 -addnode=103.195.100.32 -addnode=15.235.204.174 -addnode=148.113.1.52 -addnode=65.21.77.109 -addnode=89.19.26.211 -addnode=89.19.26.212"}, {"PIRATE", "-ac_name=PIRATE -ac_supply=0 -ac_reward=25600000000 -ac_halving=77777 -ac_private=1 -addnode=209.222.101.247 -addnode=103.195.100.32 -addnode=88.99.212.81 -addnode=15.235.204.174 -addnode=148.113.1.52 -addnode=65.21.77.109 -addnode=89.19.26.211 -addnode=89.19.26.212"}, {"SUPERNET", "-ac_name=SUPERNET -ac_supply=816061 -addnode=209.222.101.247 -addnode=103.195.100.32 -addnode=209.222.101.247 -addnode=103.195.100.32 -addnode=15.235.204.174 -addnode=148.113.1.52 -addnode=65.21.77.109 -addnode=89.19.26.211 -addnode=89.19.26.212"}, - {"THC", "-ac_name=THC -ac_supply=251253103 -ac_reward=360000000,300000000,240000000,180000000,150000000,90000000,0 -ac_staked=100 -ac_eras=7 -ac_end=500001,1000001,1500001,2000001,2500001,4500001,0 -ac_perc=233333333 -ac_cc=2 -ac_ccenable=229,236,240 -ac_script=2ea22c8020987fad30df055db6fd922c3a57e55d76601229ed3da3b31340112e773df3d0d28103120c008203000401ccb8 -ac_founders=150 -ac_cbmaturity=1 -ac_sapling=1 -earlytxid=7e4a76259e99c9379551389e9f757fc5f46c33ae922a8644dc2b187af2a6adc1 -addnode=209.222.101.247 -addnode=103.195.100.32 -addnode=157.230.45.184 -addnode=165.22.52.123 -addnode=15.235.204.174 -addnode=148.113.1.52 -addnode=65.21.77.109 -addnode=89.19.26.211 -addnode=89.19.26.212"}, + {"ERA7", "-ac_name=ERA7 -ac_supply=7777777 -ac_reward=700000000,600000000,500000000,400000000,300000000,200000000,0 -ac_staked=100 -ac_eras=7 -ac_end=1000000,2000000,3000000,4000000,5000000,6000000,0 -ac_cc=2 -ac_ccenable=229,236,240 -ac_cbmaturity=1 -ac_sapling=1"}, {"TXX001", "-ac_name=TXX001 -ac_sapling=1 -ac_founders=1 -ac_reward=0,1125000000,562500000 -ac_end=128,340000,5422111 -ac_blocktime=150 -ac_supply=6178674 -ac_halving=129,340000,840000 -ac_cc=2 -ac_cclib=txx001 -ac_ccenable=228,234,235,236,241 -ac_perc=11111111 -ac_eras=3 -ac_script=76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac -clientname=GoldenSandtrout -addnode=188.165.212.101 -addnode=136.243.227.142 -addnode=5.9.224.250",} }; @@ -170,7 +170,7 @@ namespace ParseArgumentsTests { { "NINJA", {"NINJA", 8426, 8427, -1301311821} }, { "PIRATE", {"PIRATE", 45452, 45453, 397860952} }, { "SUPERNET", {"SUPERNET", 11340, 11341, -1190058922} }, - { "THC", {"THC", 36789, 36790, -1111205507} }, + { "ERA7", {"ERA7", 37332, 37333, -1314352964} }, { "TXX001", {"TXX001", 55965, 55966, 951479465} }, }; From 562ff9695870589ecdfad18dc19ee173d355bb74 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 29 Jan 2024 19:40:08 +0100 Subject: [PATCH 11/12] bump version [0.8.2] --- configure.ac | 4 ++-- src/clientversion.h | 4 ++-- src/rpc/misc.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index a654ff3b722..e23e4646054 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 8) -define(_CLIENT_VERSION_REVISION, 1) -define(_CLIENT_VERSION_BUILD, 4) +define(_CLIENT_VERSION_REVISION, 2) +define(_CLIENT_VERSION_BUILD, 0) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) define(_CLIENT_VERSION_IS_RELEASE, true) diff --git a/src/clientversion.h b/src/clientversion.h index b92ce4f37dd..10dfc80bf48 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -32,8 +32,8 @@ //! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 8 -#define CLIENT_VERSION_REVISION 1 -#define CLIENT_VERSION_BUILD 4 +#define CLIENT_VERSION_REVISION 2 +#define CLIENT_VERSION_BUILD 0 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 59b74b11d75..ff1deca9bb9 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -81,7 +81,7 @@ int8_t StakedNotaryID(std::string ¬aryname, char *Raddress); uint64_t komodo_notarypayamount(int32_t nHeight, int64_t notarycount); int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);*/ -#define KOMODO_VERSION "0.8.1" +#define KOMODO_VERSION "0.8.2" extern uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT; extern uint32_t ASSETCHAINS_CC; extern uint32_t ASSETCHAINS_MAGIC,ASSETCHAINS_ALGO; From ad995c0c72cf9b8fba1974736f8384dd0edd253c Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 29 Jan 2024 19:41:15 +0100 Subject: [PATCH 12/12] bump copyright year --- configure.ac | 2 +- src/clientversion.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index e23e4646054..50c29db8f3a 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ define(_CLIENT_VERSION_BUILD, 0) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) define(_CLIENT_VERSION_IS_RELEASE, true) -define(_COPYRIGHT_YEAR, 2023) +define(_COPYRIGHT_YEAR, 2024) AC_INIT([Komodo],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_SUFFIX(_ZC_BUILD_VAL)],[https://github.com/KomodoPlatform/komodo/issues],[komodo]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) diff --git a/src/clientversion.h b/src/clientversion.h index 10dfc80bf48..952b67c4ab9 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -42,7 +42,7 @@ * Copyright year (2009-this) * Todo: update this when changing our copyright comments in the source */ -#define COPYRIGHT_YEAR 2023 +#define COPYRIGHT_YEAR 2024 #endif //HAVE_CONFIG_H