Skip to content

Commit

Permalink
Merge pull request KomodoPlatform#575 from Asherda/release-v1.2.2-5
Browse files Browse the repository at this point in the history
Release v1.2.2-5
  • Loading branch information
Asherda authored May 9, 2024
2 parents c66b223 + 07ff18a commit 0f8d066
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 15 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.2.2-4
VERSION: 1.2.2-5

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.2.2-4
## VerusCoin version 1.2.2-5

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.2.2-4
VerusCoin Command Line Tools v1.2.2-5

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.2.2-4
VerusCoin Command Line Tools v1.2.2-5

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.2.2-4
VerusCoin Command Line Tools v1.2.2-5

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 = 3022000;
static const int APPROX_RELEASE_HEIGHT = 3039000;

static const int WEEKS_UNTIL_DEPRECATION = 52;
static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 60 * 24);
Expand Down
54 changes: 49 additions & 5 deletions src/pbaas/pbaas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ bool ImportHasAdequateFees(const CTransaction &tx,
{
return state.Error("Fees for currency launch preconversions must include launch currency: " + oneTransfer.ToUniValue().write(1,2));
}
if (!importingToDef.GetCurrenciesMap().count(oneTransfer.FirstCurrency()))
if (ConnectedChains.DoImportPreconvertReserveTransferPrecheck(height) && !importingToDef.GetCurrenciesMap().count(oneTransfer.FirstCurrency()))
{
return state.Error("Invalid source currency for preconversion: " + oneTransfer.ToUniValue().write(1,2));
}
Expand Down Expand Up @@ -1340,7 +1340,7 @@ bool PrecheckCrossChainImport(const CTransaction &tx, int32_t outNum, CValidatio
{
return state.Error("Fees for currency launch preconversions must include launch currency: " + oneTransfer.ToUniValue().write(1,2));
}
if (!importingToDef.GetCurrenciesMap().count(oneTransfer.FirstCurrency()))
if (ConnectedChains.DoImportPreconvertReserveTransferPrecheck(height) && !importingToDef.GetCurrenciesMap().count(oneTransfer.FirstCurrency()))
{
return state.Error("Invalid source currency for preconversion: " + oneTransfer.ToUniValue().write(1,2));
}
Expand Down Expand Up @@ -1964,6 +1964,7 @@ bool PrecheckCrossChainExport(const CTransaction &tx, int32_t outNum, CValidatio
CCurrencyValueMap reserveDepositOutput;
CCurrencyValueMap expectedReserveDeposits;
CCurrencyValueMap expectedBurn;
CCrossChainImport cci;
for (int i = 0; i < tx.vout.size(); i++)
{
COptCCParams p;
Expand All @@ -1973,10 +1974,18 @@ bool PrecheckCrossChainExport(const CTransaction &tx, int32_t outNum, CValidatio
p.evalCode == EVAL_RESERVE_DEPOSIT &&
p.vData.size() &&
(rd = CReserveDeposit(p.vData[0])).IsValid() &&
rd.controllingCurrencyID == reserveDepositHolder)
{
rd.controllingCurrencyID == reserveDepositHolder) {
reserveDepositOutput += rd.reserveValues;
}
else if (p.IsValid() &&
p.evalCode == EVAL_CROSSCHAIN_IMPORT &&
!ccx.IsChainDefinition() &&
p.vData.size() &&
(cci = CCrossChainImport(p.vData[0])).IsValid() &&
cci.importCurrencyID == ccx.destCurrencyID)
{
return state.Error("Invalid export combined with import without currency definition");
}
}
// if cross system, we may remove some due to burning
if (isCrossSystem)
Expand Down Expand Up @@ -2008,6 +2017,10 @@ bool PrecheckCrossChainExport(const CTransaction &tx, int32_t outNum, CValidatio
}
}
}
else if (!(ccx.IsChainDefinition() && ASSETCHAINS_CHAINID == ccx.destCurrencyID && IsVerusActive()) && (totalCurrencyExported + extraLaunchFee) != reserveDepositOutput)
{
return state.Error("Invalid export transaction");
}
}

return true;
Expand Down Expand Up @@ -6582,6 +6595,37 @@ bool CConnectedChains::IdentityLockOverride(const CIdentity &identity, uint32_t
return false;
}

bool CConnectedChains::DoPreconvertReserveTransferPrecheck(uint32_t height) const
{
uint32_t triggerHeight = IsVerusMainnetActive() ? 3050060 : (vARRRChainID() != ASSETCHAINS_CHAINID ? 67000 : 0);
if (IsVerusMainnetActive() || vARRRChainID() == ASSETCHAINS_CHAINID)
{
auto iiuIt = ConnectedChains.activeUpgradesByKey.find(ConnectedChains.PreconvertReserveTransferPrecheckKey());
if (iiuIt != ConnectedChains.activeUpgradesByKey.end())
{
triggerHeight = iiuIt->second.upgradeBlockHeight;
}
return height >= triggerHeight;
}
return true;
}

bool CConnectedChains::DoImportPreconvertReserveTransferPrecheck(uint32_t height) const
{
uint32_t triggerHeight = IsVerusMainnetActive() ? 3050000 : (vARRRChainID() != ASSETCHAINS_CHAINID ? 67000 : 0);

if (IsVerusMainnetActive() || vARRRChainID() == ASSETCHAINS_CHAINID)
{
auto iiuIt = ConnectedChains.activeUpgradesByKey.find(ConnectedChains.ImportPreconvertReserveTransferPrecheckKey());
if (iiuIt != ConnectedChains.activeUpgradesByKey.end())
{
triggerHeight = iiuIt->second.upgradeBlockHeight;
}
return height < triggerHeight;
}
return false;
}

bool CConnectedChains::ConfigureEthBridge(bool callToCheck)
{
// first time through, we initialize the VETH gateway config file
Expand Down Expand Up @@ -8632,7 +8676,7 @@ bool CConnectedChains::CreateLatestImports(const CCurrencyDefinition &sourceSyst
}
else
{
//printf("%s: success adding %s to mempool\n", __func__, newImportTx.GetHash().GetHex().c_str());
printf("%s: success adding %s to mempool\n", __func__, newImportTx.GetHash().GetHex().c_str());
if (!arbitrageTransfersIn.size())
{
RelayTransaction(newImportTx);
Expand Down
26 changes: 26 additions & 0 deletions src/pbaas/pbaas.h
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,8 @@ class CConnectedChains
bool ForceIdentityUpgrade(uint32_t height) const;
bool ForceIdentityUnlock(uint32_t height) const;
bool IdentityLockOverride(const CIdentity &identity, uint32_t height) const;
bool DoPreconvertReserveTransferPrecheck(uint32_t height) const;
bool DoImportPreconvertReserveTransferPrecheck(uint32_t height) const;

std::vector<CCurrencyDefinition> GetMergeMinedChains()
{
Expand Down Expand Up @@ -1333,6 +1335,30 @@ class CConnectedChains
return key;
}

static std::string PreconvertReserveTransferPrecheckKeyName()
{
return "vrsc::system.upgradedata.preconvertreservetransferprecheck";
}

static uint160 PreconvertReserveTransferPrecheckKey()
{
static uint160 nameSpace;
static uint160 key = CVDXF_Data::GetDataKey(PreconvertReserveTransferPrecheckKeyName(), nameSpace);
return key;
}

static std::string ImportPreconvertReserveTransferPrecheckKeyName()
{
return "vrsc::system.upgradedata.importpreconvertreservetransferprecheck";
}

static uint160 ImportPreconvertReserveTransferPrecheckKey()
{
static uint160 nameSpace;
static uint160 key = CVDXF_Data::GetDataKey(ImportPreconvertReserveTransferPrecheckKeyName(), nameSpace);
return key;
}

static std::string DisablePBaaSCrossChainKeyName()
{
return "vrsc::system.upgradedata.disablepbaascrosschain";
Expand Down
6 changes: 6 additions & 0 deletions src/pbaas/reserves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4713,6 +4713,12 @@ bool CReserveTransactionDescriptor::AddReserveTransferImportOutputs(const CCurre
auto reserveIdx = currencyIndexMap.find(curTransfer.FirstCurrency());
if (reserveIdx == currencyIndexMap.end())
{
if (ConnectedChains.DoPreconvertReserveTransferPrecheck(height))
{
printf("%s: invalid currency for preconversion to %s\n", __func__, importCurrencyDef.name.c_str());
LogPrint("reservetransfers", "%s: invalid currency for preconversion to %s\n", __func__, importCurrencyDef.name.c_str());
return false;
}
curTransfer = curTransfer.GetRefundTransfer();
}
else if (maxPreconvert.valueMap.size())
Expand Down
2 changes: 1 addition & 1 deletion src/pbaas/vdxf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ CSignatureData::CSignatureData(const UniValue &uni) :
}
signatureHash = std::vector<unsigned char>(dataHash.begin(), dataHash.end());

std::string sigString = DecodeBase64(uni_get_str(find_value(uni, "identityid")));
std::string sigString = DecodeBase64(uni_get_str(find_value(uni, "signature")));
signatureAsVch = std::vector<unsigned char>(sigString.begin(), sigString.end());

auto vdxfKeysUni = find_value(uni, "vdxfkeys");
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/pbaasrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10149,10 +10149,10 @@ UniValue sendcurrency(const UniValue& params, bool fHelp)
converterCurrency.GetCurrenciesMap().count(exportToCurrencyDef.systemID) &&
converterCurrency.GetCurrenciesMap().count(feeCurrencyID) &&
converterCurrency.GetCurrenciesMap().count(toFractional ? sourceCurrencyID : convertToCurrencyID))) ||
(convertToCurrencyID == exportToCurrencyID &&
(convertToCurrencyID == exportToCurrencyDef.GetID() &&
exportToCurrencyDef.systemID == destSystemID)))
{
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid export syntax. Fractional converter must be from current chain before \"exportto\" a system currency or if on the alternate system, then it must be the same destination as \"exportto\".");
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid export syntax. Fractional converter must be from current chain before \"exportto\" a system currency or if on the alternate system, then that system must be the same destination as \"exportto\".");
}

// if fee currency is the export system destination
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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.2.2-4"
#define VERUS_VERSION "1.2.2-5"

#endif // BITCOIN_VERSION_H

0 comments on commit 0f8d066

Please sign in to comment.