Skip to content

Commit

Permalink
Merge pull request KomodoPlatform#531 from Asherda/release-v1.0.12-1
Browse files Browse the repository at this point in the history
Release v1.0.12-1
  • Loading branch information
Asherda authored Jul 1, 2023
2 parents c73aa08 + 66e16e7 commit 01dd90b
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ stages:
########################################################################################################################
variables:

VERSION: 1.0.12
VERSION: 1.0.12-1

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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## VerusCoin version 1.0.12
## VerusCoin version 1.0.12-1

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.

Expand Down
2 changes: 1 addition & 1 deletion doc/man/verus-cli/linux/README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

VerusCoin Command Line Tools v1.0.12
VerusCoin Command Line Tools v1.0.12-1

Contents:
verusd - VerusCoin daemon
Expand Down
2 changes: 1 addition & 1 deletion doc/man/verus-cli/mac/README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

VerusCoin Command Line Tools v1.0.12
VerusCoin Command Line Tools v1.0.12-1

Contents:
verusd - VerusCoin daemon.
Expand Down
2 changes: 1 addition & 1 deletion doc/man/verus-cli/windows/README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

VerusCoin Command Line Tools v1.0.12
VerusCoin Command Line Tools v1.0.12-1

Contents:
verusd.exe - VerusCoin daemon
Expand Down
2 changes: 1 addition & 1 deletion src/deprecation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 2598000;
static const int APPROX_RELEASE_HEIGHT = 2603000;

static const int WEEKS_UNTIL_DEPRECATION = 52;
static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 60 * 24);
Expand Down
2 changes: 1 addition & 1 deletion src/keystore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ bool CBasicKeyStore::GetIdentities(std::vector<std::pair<CIdentityMapKey, CIdent
{
if (GetIdentity(primaryIdentity.second.revocationAuthority, revocationAuthority))
{
idKey.flags |= (CIdentityMapKey(revocationAuthority.first).flags & (idKey.CAN_SPEND | idKey.CAN_SIGN));
idKey.flags |= (CIdentityMapKey(revocationAuthority.first).flags & idKey.CAN_SIGN);
}
}

Expand Down
44 changes: 36 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8466,15 +8466,34 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
pfrom->fDisconnect = true;
return false;
}
int misbehavingLevel = (SanitizeString(strReason) == "tx-overwinter-not-active") ? 0 : 1;
std::string sanitizedReason = SanitizeString(strReason);
int misbehavingLevel = (sanitizedReason == "txoverwinternotactive") ? 0 : 1;
if (isRejectNewTx &&
SanitizeString(strReason) == "bad-txns-inputs-spent")
sanitizedReason == "badtxnsinputsspent")
{
CTransaction mTx;
LOCK(mempool.cs);
if (mempool.lookup(hash, mTx))
{
misbehavingLevel = 0;
CObjectFinalization of;
// if it is an import or export, don't report to reduce network traffic. that will happen.
for (auto &oneOut : mTx.vout)
{
COptCCParams chkP;
if (CCrossChainExport(oneOut.scriptPubKey).IsValid() ||
CCrossChainImport(oneOut.scriptPubKey).IsValid() ||
CPBaaSNotarization(oneOut.scriptPubKey).IsValid() ||
(oneOut.scriptPubKey.IsPayToCryptoCondition(chkP) &&
chkP.IsValid() &&
chkP.vData.size() &&
chkP.evalCode == EVAL_FINALIZE_NOTARIZATION &&
(of = CObjectFinalization(chkP.vData[0])).IsValid() &&
of.IsConfirmed()))
{
misbehavingLevel = 0;
break;
}
}
}
}
Misbehaving(pfrom->GetId(), misbehavingLevel);
Expand Down Expand Up @@ -8945,6 +8964,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
pfrom->id, pfrom->cleanSubVer,
state.GetRejectReason());

bool sendReject = true;
if (state.GetRejectReason() == "bad-txns-inputs-spent" && nDoS <= 1)
{
CObjectFinalization of;
Expand All @@ -8957,20 +8977,28 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
CPBaaSNotarization(oneOut.scriptPubKey).IsValid() ||
(oneOut.scriptPubKey.IsPayToCryptoCondition(chkP) &&
chkP.IsValid() &&
chkP.evalCode == EVAL_FINALIZE_NOTARIZATION &&
chkP.vData.size() &&
chkP.evalCode == EVAL_FINALIZE_NOTARIZATION &&
(of = CObjectFinalization(chkP.vData[0])).IsValid() &&
of.IsConfirmed()))
{
sendReject = false;
nDoS = 0;
break;
}
}
}
pfrom->PushMessage("reject", strCommand, state.GetRejectCode(),
state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), inv.hash);
if (nDoS > 0)
Misbehaving(pfrom->GetId(), nDoS);
else if (state.GetRejectReason() == "tx-overwinter-not-active")
{
sendReject = false;
nDoS = 0;
}
if (sendReject)
{
pfrom->PushMessage("reject", strCommand, state.GetRejectCode(),
state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), inv.hash);
}
Misbehaving(pfrom->GetId(), nDoS);
}
}

Expand Down
49 changes: 34 additions & 15 deletions src/pbaas/notarization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,11 +1156,6 @@ bool CPBaaSNotarization::NextNotarizationInfo(const CCurrencyDefinition &sourceS
proofRoots.find(VERUS_CHAINID)->second.rootHeight >= ConnectedChains.GetZeroViaHeight(PBAAS_TESTMODE)) ||
(ConnectedChains.CheckZeroViaOnlyPostLaunch(currentHeight));

bool includePostLaunchFeeTransition = destCurrency.IsFractional() &&
!destCurrency.IsGatewayConverter() &&
ConnectedChains.StartIncludePostLaunchFees(currentHeight) &&
ConnectedChains.IncludePostLaunchFeeTransition(chainActive.Height());

bool includePostLaunchFees = ConnectedChains.IncludePostLaunchFees(currentHeight) &&
!destCurrency.IsGatewayConverter() &&
destCurrency.IsFractional();
Expand Down Expand Up @@ -1452,14 +1447,6 @@ bool CPBaaSNotarization::NextNotarizationInfo(const CCurrencyDefinition &sourceS
newNotarization.currencyState.conversionPrice = tempState.PricesInReserve();
}

if (PBAAS_TESTMODE && includePostLaunchFeeTransition)
{
for (int roIdx = 0; roIdx < newNotarization.currencyState.reserveOut.size(); roIdx++)
{
newNotarization.currencyState.primaryCurrencyIn[roIdx] += newNotarization.currencyState.reserveOut[roIdx];
}
}

std::vector<CTxOut> tempOutputs;
bool retVal = rtxd.AddReserveTransferImportOutputs(newNotarization.IsRefunding() ? destSystem : sourceSystem,
newNotarization.IsRefunding() ? sourceSystem : destSystem,
Expand Down Expand Up @@ -2555,7 +2542,19 @@ std::tuple<uint32_t, CTransaction, CUTXORef, CPBaaSNotarization> GetPriorReferen
}
else
{
lastNotarizationAddressEntry = lastNotarizationIndexes.back();
int i;
for (i = 0; i < lastOfs.size(); i++)
{
if (lastOfs[i].IsValid())
{
lastNotarizationAddressEntry = lastNotarizationIndexes[i];
break;
}
}
if (i >= lastOfs.size())
{
lastNotarizationAddressEntry = lastNotarizationIndexes.back();
}
}
}
else
Expand Down Expand Up @@ -3327,7 +3326,19 @@ CPBaaSNotarization IsValidPrimaryChainEvidence(const CCurrencyDefinition &extern
}
else
{
lastNotarizationAddressEntry = lastNotarizationIndexes.back();
int i;
for (i = 0; i < lastOfs.size(); i++)
{
if (lastOfs[i].IsValid())
{
lastNotarizationAddressEntry = lastNotarizationIndexes[i];
break;
}
}
if (i >= lastOfs.size())
{
lastNotarizationAddressEntry = lastNotarizationIndexes.back();
}
}
}
else
Expand Down Expand Up @@ -8573,6 +8584,7 @@ bool CPBaaSNotarization::FindFinalizedIndexesByVDXFKey(const uint160 &notarizati
uint256 blkHash;
COptCCParams fP;

std::vector<CObjectFinalization> validOfs;
for (auto &oneIndexEntry : addressIndex)
{
if (oneIndexEntry.first.spending)
Expand All @@ -8591,7 +8603,14 @@ bool CPBaaSNotarization::FindFinalizedIndexesByVDXFKey(const uint160 &notarizati
(confirmedFinalization[i] = CObjectFinalization(fP.vData[0])).IsValid()))
{
LogPrint("notarization", "Invalid finalization transaction for index key\n");
continue;
}
validOfs.push_back(confirmedFinalization[i]);
break;
}
if (validOfs.size())
{
confirmedFinalization[i] = validOfs[0];
}
}
return true;
Expand Down
29 changes: 8 additions & 21 deletions src/pbaas/pbaas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3235,22 +3235,6 @@ bool ValidateReserveDeposit(struct CCcontract_info *cp, Eval* eval, const CTrans

CCurrencyValueMap importedCurrency, gatewayCurrencyUsed, spentCurrencyOut;

if (PBAAS_TESTMODE && destCurDef.name == "ctc" && destCurDef.parent == VERUS_CHAINID && !checkState.IsLaunchCompleteMarker())
{
CCurrencyDefinition checkCurDef;
int32_t defHeight;
CUTXORef checkUTXORef;
uint256 txHash = uint256S("58cbbabe931447bd063fc0b147459af3642b0c515aa4ba46892e76935be9a4e9");
if (GetCurrencyDefinition(destCurDef.GetID(), checkCurDef, &defHeight, false, false, &checkUTXORef) &&
checkUTXORef.hash == txHash &&
!checkState.IsLaunchCompleteMarker() &&
checkState.primaryCurrencyIn.size() == 1 &&
checkState.primaryCurrencyIn[0] == int64_t(123015378844))
{
checkState.primaryCurrencyIn[0] -= 15378844;
}
}

if (!rtxd.AddReserveTransferImportOutputs(checkState.IsRefunding() ? destSysDef : sourceSysDef,
checkState.IsRefunding() ? sourceSysDef : destSysDef,
destCurDef,
Expand Down Expand Up @@ -6128,11 +6112,6 @@ bool CConnectedChains::IncludePostLaunchFees(uint32_t height) const
}
}

bool CConnectedChains::IncludePostLaunchFeeTransition(uint32_t height) const
{
return (PBAAS_TESTMODE && IsVerusActive()) ? (ConnectedChains.IncludePostLaunchFees(height + 20) && !ConnectedChains.IncludePostLaunchFees(height)) : false;
}

bool CConnectedChains::StartIncludePostLaunchFees(uint32_t height) const
{
return PBAAS_TESTMODE && height >= 87121 && !IncludePostLaunchFees(height);
Expand Down Expand Up @@ -7055,6 +7034,14 @@ bool CConnectedChains::CreateLatestImports(const CCurrencyDefinition &sourceSyst
continue;
}

if (PBAAS_TESTMODE &&
ccx.destCurrencyID == GetDestinationID(DecodeDestination("iCjfiYoGhakHSkkqiAWHJDkQoeXVeEvfhj")) &&
ConnectedChains.IncludePostLaunchFees(nHeight))
{
failedCurrencyDest = ccx.destCurrencyID;
continue;
}

CChainNotarizationData cnd;
CPBaaSNotarization priorChainNotarization;
CCurrencyDefinition refundingPBaaSChain;
Expand Down
1 change: 0 additions & 1 deletion src/pbaas/pbaas.h
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,6 @@ class CConnectedChains
bool CheckZeroViaOnlyPostLaunch(uint32_t height) const;
uint32_t IncludePostLaunchFeeHeight(bool getVerusHeight) const;
bool IncludePostLaunchFees(uint32_t height) const;
bool IncludePostLaunchFeeTransition(uint32_t height) const;
bool StartIncludePostLaunchFees(uint32_t height) const;
bool CheckClearConvert(uint32_t height) const;

Expand Down
21 changes: 0 additions & 21 deletions src/pbaas/reserves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3009,27 +3009,6 @@ CReserveTransactionDescriptor::CReserveTransactionDescriptor(const CTransaction
rtxd.nativeConversionFees = 0;
rtxd.nativeOut = 0;

if (ConnectedChains.IncludePostLaunchFeeTransition(nHeight))
{
// clear testnet ctc
// TODO: TESTNET RESET - remove exception
if (PBAAS_TESTMODE && importCurrencyDef.name == "ctc" && importCurrencyDef.parent == VERUS_CHAINID)
{
CCurrencyDefinition checkCurDef;
int32_t defHeight;
CUTXORef checkUTXORef;
uint256 txHash = uint256S("58cbbabe931447bd063fc0b147459af3642b0c515aa4ba46892e76935be9a4e9");
if (GetCurrencyDefinition(importCurrencyDef.GetID(), checkCurDef, &defHeight, false, false, &checkUTXORef) &&
checkUTXORef.hash == txHash)
{
for (int roIdx = 0; roIdx < checkState.reserveOut.size(); roIdx++)
{
checkState.primaryCurrencyIn[roIdx] -= 15378844;
}
}
}
}

if (!rtxd.AddReserveTransferImportOutputs(sourceSystemDef,
ConnectedChains.thisChain,
importCurrencyDef,
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.12"
#define VERUS_VERSION "1.0.12-1"

#endif // BITCOIN_VERSION_H

0 comments on commit 01dd90b

Please sign in to comment.