diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14694ba0f78..a6deadb502a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ stages: ######################################################################################################################## variables: - VERSION: 1.0.10-1 + VERSION: 1.0.11 VERUS_CLI_ARM64_LINUX: Verus-CLI-Linux-v${VERSION}-arm64.tar.gz VERUS_CLI_LINUX_X86_64: Verus-CLI-Linux-v${VERSION}-x86_64.tar.gz diff --git a/README.md b/README.md index 6b3b5ae8710..5e13eadc924 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -## VerusCoin version 1.0.10-1 +## VerusCoin version 1.0.11 Arguably the world's most advanced technology, zero knowledge privacy enabled, multi-chain blockchain protocol, Verus Public Blockchains as a Service (PBaaS) combines Sapling zero knowledge technology with an intelligent, multi-chain, provable protocol, using interchain smart transactions. Verus PBaaS also enables merge mining and cross-chain staking with a completely original, combined proof of stake/proof of work consensus algorithm, Proof of Power, that can be mined on CPUs and mobile phones, and also solves the nothing at stake problem. With this and its approach towards CPU mining and ASICs, Verus Coin strives to be one of the most naturally decentralizing and attack resistant blockchain networks in existence. diff --git a/doc/man/verus-cli/linux/README.txt b/doc/man/verus-cli/linux/README.txt index 92d60176194..a1ebcb4ee15 100644 --- a/doc/man/verus-cli/linux/README.txt +++ b/doc/man/verus-cli/linux/README.txt @@ -1,5 +1,5 @@ -VerusCoin Command Line Tools v1.0.10-1 +VerusCoin Command Line Tools v1.0.11 Contents: verusd - VerusCoin daemon diff --git a/doc/man/verus-cli/mac/README.txt b/doc/man/verus-cli/mac/README.txt index 0530100166c..a5fe3baf5f0 100644 --- a/doc/man/verus-cli/mac/README.txt +++ b/doc/man/verus-cli/mac/README.txt @@ -1,5 +1,5 @@ -VerusCoin Command Line Tools v1.0.10-1 +VerusCoin Command Line Tools v1.0.11 Contents: verusd - VerusCoin daemon. diff --git a/doc/man/verus-cli/windows/README.txt b/doc/man/verus-cli/windows/README.txt index ff01e3e39c5..ef0ba408875 100644 --- a/doc/man/verus-cli/windows/README.txt +++ b/doc/man/verus-cli/windows/README.txt @@ -1,5 +1,5 @@ -VerusCoin Command Line Tools v1.0.10-1 +VerusCoin Command Line Tools v1.0.11 Contents: verusd.exe - VerusCoin daemon diff --git a/src/deprecation.h b/src/deprecation.h index 5db1ec44035..5d375d85213 100644 --- a/src/deprecation.h +++ b/src/deprecation.h @@ -9,7 +9,7 @@ // * Shut down 52 weeks' worth of blocks after the estimated release block height. // * A warning is shown during the 2 months' worth of blocks prior to shut down. -static const int APPROX_RELEASE_HEIGHT = 2585000; +static const int APPROX_RELEASE_HEIGHT = 2588000; static const int WEEKS_UNTIL_DEPRECATION = 52; static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 60 * 24); diff --git a/src/pbaas/notarization.cpp b/src/pbaas/notarization.cpp index 7f8afde9fbf..185a8abcc6f 100644 --- a/src/pbaas/notarization.cpp +++ b/src/pbaas/notarization.cpp @@ -1155,7 +1155,7 @@ bool CPBaaSNotarization::NextNotarizationInfo(const CCurrencyDefinition &sourceS proofRoots.count(VERUS_CHAINID) && proofRoots.find(VERUS_CHAINID)->second.rootHeight >= ConnectedChains.GetZeroViaHeight(PBAAS_TESTMODE)) || (ConnectedChains.CheckZeroViaOnlyPostLaunch(currentHeight)); - + bool clearConvert = ConnectedChains.CheckClearConvert(notaHeight); CTransferDestination notaryPayee; @@ -1982,6 +1982,14 @@ UniValue CChainNotarizationData::ToUniValue(const std::vector GetPriorReferen } else { - CObjectFinalization lastOf; + std::vector lastOfs; + std::vector lastNotarizationIndexes; lastLocalNotarization = lastNotarization; - if (!lastLocalNotarization.FindEarnedNotarization(lastOf, &lastNotarizationAddressEntry)) + if (!lastLocalNotarization.FindEarnedNotarizations(lastOfs, &lastNotarizationIndexes) || + !lastNotarizationIndexes.size()) { lastLocalNotarization = lastNotarization = CPBaaSNotarization(); } + else if (lastNotarizationIndexes.size() > 1) + { + std::set evidenceCheckTypes; + + // we need to select between multiple priors, and to do that, we + // see if there is commitment/challenge evidence that matches one by checking if the + // commitments match the respective entropyhash + evidenceCheckTypes.insert(CHAINOBJ_COMMITMENTDATA); + CCrossChainProof commitmentProof(evidence.GetSelectEvidence(evidenceCheckTypes)); + + evidenceCheckTypes.clear(); + evidenceCheckTypes.insert(CHAINOBJ_PROOF_ROOT); + CCrossChainProof rootProof(evidence.GetSelectEvidence(evidenceCheckTypes)); + + if (commitmentProof.chainObjects.size() && + rootProof.chainObjects.size()) + { + CTransaction notarizationTx; + uint256 nBlkHash; + // make sure the one we find has a matching proof + for (auto &oneIndex : lastNotarizationIndexes) + { + if (!myGetTransaction(oneIndex.first.txhash, notarizationTx, nBlkHash)) + { + LogPrint("notarization", "Error retrieving notarization transaction\n"); + continue; + } + std::vector<__uint128_t> checkCommitments; + uint256 blockTypes = ((CChainObject *)commitmentProof.chainObjects[0])->object.GetSmallCommitments(checkCommitments); + if (lastLocalNotarization.CheckEntropyHashMatch(nBlkHash, + checkCommitments, + lastLocalNotarization.currencyID, + (lastLocalNotarization.proofRoots.count(lastLocalNotarization.currencyID) ? + lastLocalNotarization.proofRoots[lastLocalNotarization.currencyID].rootHeight : + 1), + ((CChainObject *)rootProof.chainObjects[0])->object.rootHeight)) + { + lastNotarizationAddressEntry = oneIndex; + break; + } + } + } + else + { + lastNotarizationAddressEntry = lastNotarizationIndexes.back(); + } + } + else + { + lastNotarizationAddressEntry = lastNotarizationIndexes.back(); + } } std::get<2>(retVal) = CUTXORef(lastNotarizationAddressEntry.first.txhash, lastNotarizationAddressEntry.first.index); @@ -3018,9 +3079,9 @@ CPBaaSNotarization IsValidPrimaryChainEvidence(const CCurrencyDefinition &extern if (ccProof.chainObjects.size() > 2 && ((CChainObject *)ccProof.chainObjects[0])->object.vdxfd == CNotaryEvidence::PrimaryProofKey() && ccProof.chainObjects[1]->objectType == CHAINOBJ_PROOF_ROOT && - ((CChainObject *)ccProof.chainObjects[0])->object != provenNotarization.proofRoots[provenNotarization.currencyID]) + ((CChainObject *)ccProof.chainObjects[1])->object != provenNotarization.proofRoots[provenNotarization.currencyID]) { - challengeProofRoot = ((CChainObject *)ccProof.chainObjects[0])->object; + challengeProofRoot = ((CChainObject *)ccProof.chainObjects[1])->object; continue; } else if (crossChainProofCount < 2 && // must be first, added on final confirmation @@ -3120,10 +3181,9 @@ CPBaaSNotarization IsValidPrimaryChainEvidence(const CCurrencyDefinition &extern lastNotarization.proofRoots.count(ASSETCHAINS_CHAINID) && checkHeight <= chainActive.Height() && (lastNotarization.IsBlockOneNotarization() || - (provenNotarization.proofRoots[ASSETCHAINS_CHAINID].rootHeight - + ((provenNotarization.proofRoots[ASSETCHAINS_CHAINID].rootHeight - lastNotarization.proofRoots[ASSETCHAINS_CHAINID].rootHeight) >= - (chainActive[provenNotarization.proofRoots[ASSETCHAINS_CHAINID].rootHeight]->nBits >= - CPBaaSNotarization::GetAdjustedNotarizationModulo(ConnectedChains.ThisChain().blockNotarizationModulo, + CPBaaSNotarization::GetAdjustedNotarizationModulo(ConnectedChains.ThisChain().blockNotarizationModulo, lastConfirmedHeight, height)))) { @@ -3167,9 +3227,68 @@ CPBaaSNotarization IsValidPrimaryChainEvidence(const CCurrencyDefinition &extern } else { - CObjectFinalization lastOf; + std::vector lastOfs; + std::vector lastNotarizationIndexes; lastLocalNotarization = lastNotarization; - if (!lastLocalNotarization.FindEarnedNotarization(lastOf, &lastNotarizationAddressEntry)) + + if (!lastLocalNotarization.FindEarnedNotarizations(lastOfs, &lastNotarizationIndexes) || + !lastNotarizationIndexes.size()) + { + lastLocalNotarization = lastNotarization = CPBaaSNotarization(); + } + else if (lastNotarizationIndexes.size() > 1) + { + std::set evidenceCheckTypes; + + // we need to select between multiple priors, and to do that, we + // see if there is commitment/challenge evidence that matches one by checking if the + // commitments match the respective entropyhash + evidenceCheckTypes.insert(CHAINOBJ_COMMITMENTDATA); + CCrossChainProof commitmentProof(evidence.GetSelectEvidence(evidenceCheckTypes)); + + evidenceCheckTypes.clear(); + evidenceCheckTypes.insert(CHAINOBJ_PROOF_ROOT); + CCrossChainProof rootProof(evidence.GetSelectEvidence(evidenceCheckTypes)); + + if (commitmentProof.chainObjects.size() && + rootProof.chainObjects.size()) + { + futureProofRoot = ((CChainObject *)rootProof.chainObjects[0])->object; + CTransaction notarizationTx; + uint256 nBlkHash; + // make sure the one we find has a matching proof + for (auto &oneIndex : lastNotarizationIndexes) + { + if (!myGetTransaction(oneIndex.first.txhash, notarizationTx, nBlkHash)) + { + LogPrint("notarization", "Error retrieving notarization transaction\n"); + continue; + } + std::vector<__uint128_t> checkCommitments; + uint256 blockTypes = ((CChainObject *)commitmentProof.chainObjects[0])->object.GetSmallCommitments(checkCommitments); + if (lastLocalNotarization.CheckEntropyHashMatch(nBlkHash, + checkCommitments, + lastLocalNotarization.currencyID, + (lastLocalNotarization.proofRoots.count(lastLocalNotarization.currencyID) ? + lastLocalNotarization.proofRoots[lastLocalNotarization.currencyID].rootHeight : + 1), + futureProofRoot.rootHeight)) + { + lastNotarizationAddressEntry = oneIndex; + } + } + } + else + { + lastNotarizationAddressEntry = lastNotarizationIndexes.back(); + } + } + else + { + lastNotarizationAddressEntry = lastNotarizationIndexes.back(); + } + + if (!lastNotarizationIndexes.size()) { lastLocalNotarization = lastNotarization = CPBaaSNotarization(); } @@ -3414,7 +3533,7 @@ CPBaaSNotarization IsValidPrimaryChainEvidence(const CCurrencyDefinition &extern } else { - validBasicEvidence = (lastLocalNotarization.IsValid() && lastLocalNotarization.IsPreLaunch()) || !challengeProofRoot.IsValid(); + validBasicEvidence = lastLocalNotarization.IsValid() || !challengeProofRoot.IsValid(); proofState = validateEarned ? (validBasicEvidence ? EXPECT_NOTHING : EXPECT_COMMITMENT_PROOF) : EXPECT_FINALIZATION_PROOF; } } @@ -5180,6 +5299,38 @@ std::vector GetGoodNodes(int maxNum) return retVal; } +bool CPBaaSNotarization::CheckEntropyHashMatch(const uint256 &entropyHash, + const CHashCommitments &commitments, + const uint160 ¤cyID, + uint32_t startingHeight, + uint32_t endHeight) +{ + uint32_t rangeLen = endHeight - startingHeight; + + std::vector<__uint128_t> checkCommitments; + uint256 blockTypes = commitments.GetSmallCommitments(checkCommitments); + auto commitmentRanges = CPBaaSNotarization::GetBlockCommitmentRanges(startingHeight, endHeight, entropyHash); + + int checkIndex = 0; + bool mismatchIndex = false; + for (auto &oneRange : commitmentRanges) + { + for (uint32_t loop = oneRange.first; loop <= oneRange.second; loop++, checkIndex++) + { + if (loop != ((uint32_t)checkCommitments[checkIndex]) >> 1) + { + mismatchIndex = true; + break; + } + } + if (mismatchIndex) + { + break; + } + } + return !mismatchIndex; +} + std::vector> CPBaaSNotarization::GetBlockCommitmentRanges(uint32_t fromHeight, uint32_t toHeight, uint256 entropy) { @@ -8307,6 +8458,98 @@ bool CPBaaSNotarization::FindFinalizedIndexByVDXFKey(const uint160 ¬arization return true; } +bool CPBaaSNotarization::FindFinalizedIndexesByVDXFKey(const uint160 ¬arizationIdxKey, + std::vector &confirmedFinalization, + std::vector &earnedNotarizationIndex) +{ + bool retVal = false; + BlockMap::iterator blockIt; + std::vector addressIndex; + if (!GetAddressIndex(notarizationIdxKey, CScript::P2IDX, addressIndex) || !addressIndex.size()) + { + if (LogAcceptCategory("verbose")) + { + LogPrint("notarization", "No transaction data for index key - not necessarily an error\n"); + } + return retVal; + } + + CTransaction notarizationTx; + CPBaaSNotarization foundNotarization; + uint256 nBlkHash; + COptCCParams nP; + + for (auto &oneIndexEntry : addressIndex) + { + if (oneIndexEntry.first.spending) + { + continue; + } + if (!myGetTransaction(oneIndexEntry.first.txhash, notarizationTx, nBlkHash) || + oneIndexEntry.first.index >= notarizationTx.vout.size() || + nBlkHash.IsNull() || + (blockIt = mapBlockIndex.find(nBlkHash)) == mapBlockIndex.end() || + !chainActive.Contains(blockIt->second) || + !(notarizationTx.vout[oneIndexEntry.first.index].scriptPubKey.IsPayToCryptoCondition(nP) && + nP.IsValid() && + (nP.evalCode == EVAL_ACCEPTEDNOTARIZATION || nP.evalCode == EVAL_EARNEDNOTARIZATION) && + nP.vData.size() && + (foundNotarization = CPBaaSNotarization(nP.vData[0])).IsValid())) + { + LogPrint("notarization", "Valid notarization not found for index key\n"); + continue; + } + earnedNotarizationIndex.push_back(oneIndexEntry); + } + if (!earnedNotarizationIndex.size()) + { + LogPrint("notarization", "Unable to locate transaction for index key\n"); + return retVal; + } + + for (int i = 0; i < earnedNotarizationIndex.size(); i++) + { + confirmedFinalization.push_back(CObjectFinalization()); + uint160 finalizedNotarizationKey = CCrossChainRPCData::GetConditionID(CObjectFinalization::ObjectFinalizationFinalizedKey(), + earnedNotarizationIndex[i].first.txhash, + earnedNotarizationIndex[i].first.index); + + addressIndex.clear(); + if (!GetAddressIndex(finalizedNotarizationKey, CScript::P2IDX, addressIndex) || + !addressIndex.size()) + { + continue; + } + + CAddressIndexDbEntry finalizationIndex; + CTransaction finalizationTx; + uint256 blkHash; + COptCCParams fP; + + for (auto &oneIndexEntry : addressIndex) + { + if (oneIndexEntry.first.spending) + { + continue; + } + if (!myGetTransaction(finalizationIndex.first.txhash, finalizationTx, blkHash) || + finalizationIndex.first.index >= finalizationTx.vout.size() || + blkHash.IsNull() || + (blockIt = mapBlockIndex.find(blkHash)) == mapBlockIndex.end() || + !chainActive.Contains(blockIt->second) || + !(finalizationTx.vout[finalizationIndex.first.index].scriptPubKey.IsPayToCryptoCondition(fP) && + fP.IsValid() && + fP.evalCode == EVAL_FINALIZE_NOTARIZATION && + fP.vData.size() && + (confirmedFinalization[i] = CObjectFinalization(fP.vData[0])).IsValid())) + { + LogPrint("notarization", "Invalid finalization transaction for index key\n"); + } + } + } + return true; +} + bool CPBaaSNotarization::FindEarnedNotarization(CObjectFinalization &confirmedFinalization, CAddressIndexDbEntry *pEarnedNotarizationIndex) const { CAddressIndexDbEntry __earnedNotarizationIndex; @@ -8338,6 +8581,37 @@ bool CPBaaSNotarization::FindEarnedNotarization(CObjectFinalization &confirmedFi return FindFinalizedIndexByVDXFKey(notarizationIdxKey, confirmedFinalization, earnedNotarizationIndex); } +bool CPBaaSNotarization::FindEarnedNotarizations(std::vector &confirmedFinalizations, std::vector *pEarnedNotarizationIndex) const +{ + std::vector __earnedNotarizationIndex; + std::vector &earnedNotarizationIndex = pEarnedNotarizationIndex ? *pEarnedNotarizationIndex : __earnedNotarizationIndex; + + bool retVal = false; + CPBaaSNotarization checkNotarization = *this; + if (checkNotarization.IsMirror()) + { + if (!checkNotarization.SetMirror(false)) + { + LogPrintf("Unable to interpret notarization data for notarization:\n%s\n", checkNotarization.ToUniValue().write(1,2).c_str()); + printf("Unable to interpret notarization data for notarization:\n%s\n", checkNotarization.ToUniValue().write(1,2).c_str()); + return retVal; + } + } + + if (LogAcceptCategory("notarization") && LogAcceptCategory("verbose")) + { + std::vector checkHex = ::AsVector(checkNotarization); + LogPrintf("%s: hex of notarization: %s\n", __func__, HexBytes(&(checkHex[0]), checkHex.size()).c_str()); + printf("%s: hex of notarization: %s\n", __func__, HexBytes(&(checkHex[0]), checkHex.size()).c_str()); + } + + CNativeHashWriter hw; + hw << checkNotarization; + uint256 objHash = hw.GetHash(); + uint160 notarizationIdxKey = CCrossChainRPCData::GetConditionID(currencyID, CPBaaSNotarization::EarnedNotarizationKey(), objHash); + return FindFinalizedIndexesByVDXFKey(notarizationIdxKey, confirmedFinalizations, earnedNotarizationIndex); +} + // look for finalized notarizations either on chain or in the mempool, which are eligible for submission // and submit them to the notary chain, referring to the last on the notary chain that we agree with. std::vector CPBaaSNotarization::SubmitFinalizedNotarizations(const CRPCChainData &externalSystem, diff --git a/src/pbaas/pbaas.cpp b/src/pbaas/pbaas.cpp index 6cc81edd3cd..3378a9aee28 100644 --- a/src/pbaas/pbaas.cpp +++ b/src/pbaas/pbaas.cpp @@ -637,7 +637,7 @@ bool PrecheckCrossChainImport(const CTransaction &tx, int32_t outNum, CValidatio } if (reserveMap != expectedReserves || reserveInMap != expectedReserves || - (((notarization.currencyState.IsPrelaunch() && ConnectedChains.CheckZeroViaOnlyPostLaunch(height)) || + (((notarization.currencyState.IsPrelaunch() && ConnectedChains.CheckZeroViaOnlyPostLaunch(height)) || (!notarization.currencyState.IsPrelaunch() && (importCurrency.GetID() != VERUS_CHAINID || importCurrency.launchSystemID != VERUS_CHAINID || @@ -663,7 +663,7 @@ bool PrecheckCrossChainImport(const CTransaction &tx, int32_t outNum, CValidatio { return state.Error("Invalid values in notarization currency state of definition tx: " + tx.GetHash().GetHex()); } - if (((notarization.currencyState.IsPrelaunch() && ConnectedChains.CheckZeroViaOnlyPostLaunch(height)) || + if (((notarization.currencyState.IsPrelaunch() && ConnectedChains.CheckZeroViaOnlyPostLaunch(height)) || (!notarization.currencyState.IsPrelaunch() && importCurrency.GetID() != VERUS_CHAINID && (importCurrency.launchSystemID != VERUS_CHAINID || @@ -1159,7 +1159,7 @@ bool PrecheckCrossChainImport(const CTransaction &tx, int32_t outNum, CValidatio if (notarization.IsLaunchCleared() && !notarization.currencyState.IsLaunchClear()) - { + { if (pbn.IsPreLaunch()) { pbn.currencyState.SetLaunchClear(false); @@ -3174,8 +3174,8 @@ bool ValidateReserveDeposit(struct CCcontract_info *cp, Eval* eval, const CTrans CCoinbaseCurrencyState pricingState; CCurrencyValueMap dummyCurrency, dummyCurrencyUsed, dummyCurrencyOut; - if (rtxd.AddReserveTransferImportOutputs(sourceSysDef, - destSysDef, + if (rtxd.AddReserveTransferImportOutputs(checkState.IsRefunding() ? destSysDef : sourceSysDef, + checkState.IsRefunding() ? sourceSysDef : destSysDef, destCurDef, checkState, reserveTransfers, @@ -3221,7 +3221,7 @@ bool ValidateReserveDeposit(struct CCcontract_info *cp, Eval* eval, const CTrans checkState.RevertReservesAndSupply(ASSETCHAINS_CHAINID, (destCurDef.IsGatewayConverter() && destCurDef.gatewayID == ASSETCHAINS_CHAINID) || (!IsVerusActive() && destCurDef.GetID() == ASSETCHAINS_CHAINID), - isUpdatedConversion ? + isUpdatedConversion ? (ConnectedChains.CheckClearConvert(nHeight) ? CCoinbaseCurrencyState::PBAAS_1_0_10 : CCoinbaseCurrencyState::PBAAS_1_0_8) : @@ -3235,8 +3235,8 @@ bool ValidateReserveDeposit(struct CCcontract_info *cp, Eval* eval, const CTrans CCurrencyValueMap importedCurrency, gatewayCurrencyUsed, spentCurrencyOut; - if (!rtxd.AddReserveTransferImportOutputs(sourceSysDef, - destSysDef, + if (!rtxd.AddReserveTransferImportOutputs(checkState.IsRefunding() ? destSysDef : sourceSysDef, + checkState.IsRefunding() ? sourceSysDef : destSysDef, destCurDef, checkState, reserveTransfers, @@ -3316,14 +3316,17 @@ bool ValidateReserveDeposit(struct CCcontract_info *cp, Eval* eval, const CTrans // if we are not coming directly into the source system, there must be a separate source export as well, // so add gateway currency - if (ccxSource.sourceSystemID != ccxSource.destSystemID && ccxSource.sourceSystemID != ccxSource.destCurrencyID) + if (ccxSource.sourceSystemID != ccxSource.destSystemID) { if (!(checkState.IsRefunding() && destCurDef.launchSystemID == ASSETCHAINS_CHAINID) && authorizingImport.importCurrencyID != ccxSource.sourceSystemID) { return eval->Error(std::string(__func__) + ": invalid currency system import thread for import to: " + EncodeDestination(CIdentityID(destCurDef.GetID()))); } - currenciesIn += gatewayCurrencyUsed; + if (!(checkState.IsRefunding() && sourceRD.controllingCurrencyID == destSysDef.GetID())) + { + currenciesIn += gatewayCurrencyUsed; + } } if (newCurState.primaryCurrencyOut) @@ -6835,23 +6838,17 @@ bool CConnectedChains::GetUnspentByIndex(const uint160 &indexID, std::vector spentInMempool; auto memPoolOuts = mempool.FilterUnspent(unconfirmedUTXOs, spentInMempool); - static LRUCache> txesBeingSpent(50, 0.3); - for (auto &oneConfirmed : confirmedUTXOs) { BlockMap::iterator blockIt; std::pair txAndBlkHash; - bool fromCache = false; - bool fromChain = false; if (spentInMempool.count(COutPoint(oneConfirmed.first.txhash, oneConfirmed.first.index)) || - (!(fromCache = txesBeingSpent.Get(oneConfirmed.first.txhash, txAndBlkHash)) && - !(fromChain = myGetTransaction(oneConfirmed.first.txhash, txAndBlkHash.first, txAndBlkHash.second))) || + !myGetTransaction(oneConfirmed.first.txhash, txAndBlkHash.first, txAndBlkHash.second) || (blockIt = mapBlockIndex.find(txAndBlkHash.second)) == mapBlockIndex.end() || !chainActive.Contains(blockIt->second)) { continue; } - txesBeingSpent.Put(oneConfirmed.first.txhash, txAndBlkHash); oneConfirmed.second.blockHeight = blockIt->second->GetHeight(); COptCCParams p; @@ -7468,7 +7465,7 @@ bool CConnectedChains::CreateLatestImports(const CCurrencyDefinition &sourceSyst clearConvertTransition) { CCurrencyValueMap localExtra; - + for (auto &oneDeposit : localDeposits) { localExtra += oneDeposit.scriptPubKey.ReserveOutValue(); diff --git a/src/pbaas/pbaas.h b/src/pbaas/pbaas.h index f87b75a5847..2ee0559f5c1 100644 --- a/src/pbaas/pbaas.h +++ b/src/pbaas/pbaas.h @@ -653,9 +653,13 @@ class CPBaaSNotarization CPBaaSNotarization ¬arization); bool FindEarnedNotarization(CObjectFinalization &finalization, CAddressIndexDbEntry *pEarnedNotarizationIndex=nullptr) const; + bool FindEarnedNotarizations(std::vector &finalization, std::vector *pEarnedNotarizationIndex=nullptr) const; static bool FindFinalizedIndexByVDXFKey(const uint160 ¬arizationIdxKey, CObjectFinalization &confirmedFinalization, CAddressIndexDbEntry &earnedNotarizationIndex); + static bool FindFinalizedIndexesByVDXFKey(const uint160 ¬arizationIdxKey, + std::vector &confirmedFinalizations, + std::vector &earnedNotarizationIndex); bool CheckCrossNotarizationProgression(const CCurrencyDefinition &curDef, CPBaaSNotarization &priorNotarization, @@ -701,6 +705,12 @@ class CPBaaSNotarization return proofRootIt->second; } + static bool CheckEntropyHashMatch(const uint256 &entropyHash, + const CHashCommitments &commitments, + const uint160 ¤cyID, + uint32_t startingHeight, + uint32_t endHeight); + static std::vector> GetBlockCommitmentRanges(uint32_t lastNotarizationHeight, uint32_t currentNotarizationHeight, uint256 entropy); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 7f0bfbad860..39f7a4c5a7a 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -159,7 +159,7 @@ UniValue getgenerate(const UniValue& params, bool fHelp) throw runtime_error( "getgenerate\n" "\nReturn if the server is set to mine and/or mint coins or not. The default is false.\n" - "It is set with the command line argument -gen (or komodo.conf setting gen) and -mint\n" + "It is set with the command line argument -gen and -mint (or conf file settings gen and mint)\n" "It can also be set with the setgenerate call.\n" "\nResult\n" "{\n" diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 59acb8a88ce..5a78893ba95 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -463,10 +463,10 @@ UniValue validateaddress(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( - "validateaddress \"komodoaddress\"\n" - "\nReturn information about the given Komodo address.\n" + "validateaddress \"address\"\n" + "\nReturn information about the given transparent address.\n" "\nArguments:\n" - "1. \"komodoaddress\" (string, required) The Komodo address to validate\n" + "1. \"address\" (string, required) The transparent address to validate\n" "\nResult:\n" "{\n" " \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n" diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index b3a8c7daffd..6d78022d63e 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -304,7 +304,7 @@ UniValue getaddednodeinfo(const UniValue& params, bool fHelp) " \"connected\" : true|false, (boolean) If connected\n" " \"addresses\" : [\n" " {\n" - " \"address\" : \"192.168.0.201:8233\", (string) The Komodo server host and port\n" + " \"address\" : \"192.168.0.201:8233\", (string) The server host and port\n" " \"connected\" : \"outbound\" (string) connection, inbound or outbound\n" " }\n" " ,...\n" diff --git a/src/rpc/pbaasrpc.cpp b/src/rpc/pbaasrpc.cpp index 1c9c4c5a01f..11c93dae74e 100644 --- a/src/rpc/pbaasrpc.cpp +++ b/src/rpc/pbaasrpc.cpp @@ -11838,7 +11838,9 @@ UniValue registernamecommitment(const UniValue& params, bool fHelp) "registernamecommitment \"name\" \"controladdress\" (\"referralidentity\") (\"parentnameorid\") (\"sourceoffunds\")\n" "\nRegisters a name commitment, which is required as a source for the name to be used when registering an identity. The name commitment hides the name itself\n" "while ensuring that the miner who mines in the registration cannot front-run the name unless they have also registered a name commitment for the same name or\n" - "are willing to forfeit the offer of payment for the chance that a commitment made now will allow them to register the name in the future.\n" + "are willing to forfeit the offer of payment for the chance that a commitment made now will allow them to register the name in the future.\n\n" + + "Names must not have leading, trailing, or multiple consecutive spaces and must not include any of the following characters between parentheses (\\/:*?\"<>|@)\n" "\nArguments\n" "\"name\" (string, required) the unique name to commit to. creating a name commitment is not a registration, and if one is\n" diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 967ac1942ca..a23a37c09a1 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -472,7 +472,7 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp) " \"reqSigs\" : n, (numeric) The required sigs\n" " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" " \"addresses\" : [ (json array of string)\n" - " \"komodoaddress\" (string) Komodo address\n" + " \"address\" (string) transparent address\n" " ,...\n" " ]\n" " }\n" @@ -937,7 +937,7 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp) " \"reqSigs\" : n, (numeric) The required sigs\n" " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" " \"addresses\" : [ (json array of string)\n" - " \"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\" (string) komodo address\n" + " \"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\" (string) transparent address\n" " ,...\n" " ]\n" " }\n" @@ -1008,7 +1008,7 @@ UniValue decodescript(const UniValue& params, bool fHelp) " \"type\":\"type\", (string) The output type\n" " \"reqSigs\": n, (numeric) The required signatures\n" " \"addresses\": [ (json array of string)\n" - " \"address\" (string) Komodo address\n" + " \"address\" (string) transparent address\n" " ,...\n" " ],\n" " \"p2sh\",\"address\" (string) script address\n" diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index ca44d61a671..5b447db74c1 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -233,7 +233,7 @@ UniValue stop(const UniValue& params, bool fHelp) if (fHelp || params.size() > 1) throw runtime_error( "stop\n" - "\nStop Komodo server."); + "\nStop the server."); #ifdef ENABLE_WALLET GenerateBitcoins(false, NULL, 0); diff --git a/src/version.h b/src/version.h index 273b655ad2c..aca63f161ef 100644 --- a/src/version.h +++ b/src/version.h @@ -35,6 +35,6 @@ static const int MEMPOOL_GD_VERSION = 60002; static const int NO_BLOOM_VERSION = 170004; #define KOMODO_VERSION "0.2.1" -#define VERUS_VERSION "1.0.10-1" +#define VERUS_VERSION "1.0.11" #endif // BITCOIN_VERSION_H