Skip to content

Commit

Permalink
Merge pull request KomodoPlatform#480 from VerusCoin/dev
Browse files Browse the repository at this point in the history
v0.9.9
  • Loading branch information
Asherda authored Mar 10, 2023
2 parents 59368e2 + 0b64682 commit 6c70964
Show file tree
Hide file tree
Showing 42 changed files with 4,354 additions and 780 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: 0.9.6-2
VERSION: 0.9.9

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 0.9.6-2
## VerusCoin version 0.9.9

Arguably the world's most advanced technology, zero knowledge privacy-centric blockchain, Verus Coin brings Sapling performance and zero knowledge features to an intelligent system with interchain smart contracts and a completely original, combined proof of stake/proof of work consensus algorithm that 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 blockchains 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 v0.9.6-2
VerusCoin Command Line Tools v0.9.9

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 v0.9.6-2
VerusCoin Command Line Tools v0.9.9

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 v0.9.6-2
VerusCoin Command Line Tools v0.9.9

Contents:
verusd.exe - VerusCoin daemon
Expand Down
2 changes: 1 addition & 1 deletion src/cc/CCinclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ extern CWallet* pwalletMain;
bool GetAddressUnspent(const uint160& addressHash, int type, std::vector<CAddressUnspentDbEntry>& unspentOutputs);

static const uint256 zeroid;
bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock);
bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool checkMempool=true);
int32_t is_hexstr(char *str,int32_t n);
bool myAddtomempool(CTransaction &tx, CValidationState *pstate = NULL, int32_t simHeight = 0, bool limitFree=true, bool *missinginputs = NULL);
//uint64_t myGettxout(uint256 hash,int32_t n);
Expand Down
8 changes: 4 additions & 4 deletions src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,14 +1144,14 @@ CUTXORef::CUTXORef(const UniValue &uni)
UniValue CObjectFinalization::ToUniValue() const
{
UniValue ret(UniValue::VOBJ);
ret.push_back(Pair("finalizationtype", (FinalizationType() == FINALIZE_NOTARIZATION) ?
"finalizenotarization" : FinalizationType() == FINALIZE_EXPORT ?
"finalizeexport" : "invalid"));
ret.push_back(Pair("finalizationtype", finalizationType));
ret.push_back(Pair("status", IsConfirmed() ?
"confirmed" :
IsRejected() ?
"rejected" :
"pending"));
IsChallenge() ?
"challenge" :
"pending"));
if (evidenceInputs.size())
{
UniValue inputsUni(UniValue::VARR);
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 20 weeks' worth of blocks after the estimated release block height.
// * A warning is shown during the 2 weeks' worth of blocks prior to shut down.

static const int APPROX_RELEASE_HEIGHT = 2424000;
static const int APPROX_RELEASE_HEIGHT = 2447000;

static const int WEEKS_UNTIL_DEPRECATION = 20;
static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 60 * 24);
Expand Down
8 changes: 8 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,13 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-regtest", "Enter regression test mode, which uses a special chain in which blocks can be solved instantly. "
"This is intended for regression testing tools and app development.");
}

// strUsage += HelpMessageOpt("-shrinkdebugfile", _("Shrink debug.log file on client startup (default: 1 when no -debug)"));
strUsage += HelpMessageOpt("-mineraddress=<address>", _("Mining rewards will go to this address"));
strUsage += HelpMessageOpt("-pubkey=<hexpubkey>", _("If set, mining and staking rewards will go to this address by default"));
strUsage += HelpMessageOpt("-defaultid=<i-address>", _("VerusID used for default change out and staking reward recipient"));
strUsage += HelpMessageOpt("-notaryid=<i-address>", _("VerusID used for PBaaS and Ethereum cross-chain notarization"));
strUsage += HelpMessageOpt("-notificationoracle=<i-address>", strprintf(_("VerusID monitored for network alerts, triggers, and signals. Current default is \"%s\" for Verus and the chain ID for PBaaS chains"), PBAAS_DEFAULT_NOTIFICATION_ORACLE.c_str()));
strUsage += HelpMessageOpt("-defaultzaddr=<sapling-address>", _("sapling address to receive fraud proof rewards and if used with \"-privatechange=1\", z-change address for the sendcurrency command"));
strUsage += HelpMessageOpt("-cheatcatcher=<sapling-address>", _("same as \"-defaultzaddr\""));
strUsage += HelpMessageOpt("-privatechange", _("directs all change from sendcurency or z_sendmany APIs to the defaultzaddr set, if it is a valid sapling address"));
Expand All @@ -523,6 +526,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-blocktime=<n>", strprintf(_("Set target block time (in seconds) for difficulty adjustment (default: %d)"), CCurrencyDefinition::DEFAULT_BLOCKTIME_TARGET));
strUsage += HelpMessageOpt("-powaveragingwindow=<n>", strprintf(_("Set averaging window for PoW difficulty adjustment, in blocks (default: %d)"), CCurrencyDefinition::DEFAULT_AVERAGING_WINDOW));
strUsage += HelpMessageOpt("-notarizationperiod=<n>", strprintf(_("Set minimum spacing consensus between cross-chain notarization, in blocks (default: %d, min 10 min)"), CCurrencyDefinition::BLOCK_NOTARIZATION_MODULO));
strUsage += HelpMessageOpt("-alwayssubmitnotarizations=<bool>", strprintf(_("Always submit cross-chain notarizations when allowed, even when not necessary (default: false)")));
strUsage += HelpMessageOpt("-testnet", _("loads PBaaS network in testmode"));

strUsage += HelpMessageGroup(_("Node relay options:"));
Expand Down Expand Up @@ -1276,6 +1280,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
MAX_UTXOS_ID_RESCAN = GetArg("-maxutxosidrescan", std::min(MAX_UTXOS_ID_RESCAN, MAX_OUR_UTXOS_ID_RESCAN));

// get default IDs and addresses
auto chainUpgradeOracle = DecodeDestination(GetArg("-notificationoracle", IsVerusActive() ? PBAAS_DEFAULT_NOTIFICATION_ORACLE : EncodeDestination(CIdentityID(ASSETCHAINS_CHAINID))));
PBAAS_NOTIFICATION_ORACLE = chainUpgradeOracle.which() == COptCCParams::ADDRTYPE_ID ? CIdentityID(GetDestinationID(chainUpgradeOracle)) : CIdentityID();
auto notaryIDDest = DecodeDestination(GetArg("-notaryid", ""));
VERUS_NOTARYID = notaryIDDest.which() == COptCCParams::ADDRTYPE_ID ? CIdentityID(GetDestinationID(notaryIDDest)) : CIdentityID();
auto defaultIDDest = DecodeDestination(GetArg("-defaultid", VERUS_NOTARYID.IsNull() ? "" : EncodeDestination(notaryIDDest)));
Expand Down Expand Up @@ -1858,6 +1864,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
ConnectedChains.ConfigureEthBridge(true);
}

ConnectedChains.CheckOracleUpgrades();

CChainNotarizationData cnd;
if (ConnectedChains.FirstNotaryChain().IsValid())
{
Expand Down
14 changes: 12 additions & 2 deletions src/key_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ extern std::string VERUS_CHAINNAME;

CIdentityID VERUS_DEFAULTID;
CIdentityID VERUS_NOTARYID;
CIdentityID PBAAS_NOTIFICATION_ORACLE; // an identity that can be used to coordinate on-chain actions or upgrades
std::string PBAAS_DEFAULT_NOTIFICATION_ORACLE = "Verus Coin Foundation@";

int32_t MAX_OUR_UTXOS_ID_RESCAN = 1000; // this can be set with "-maxourutxosidrescan=n"
int32_t MAX_UTXOS_ID_RESCAN = 100; // this can be set with "-maxutxosidrescan=n"
uint160 VERUS_NODEID;
Expand Down Expand Up @@ -114,7 +117,7 @@ UniValue getvdxfid_internal(const UniValue& params)

if (idDest.which() == COptCCParams::ADDRTYPE_ID)
{
cleanName = CleanName(vdxfName, parentID, true, true);
cleanName = CleanName(vdxfName, parentID);
vdxfID = GetDestinationID(idDest);
}
else
Expand Down Expand Up @@ -365,7 +368,7 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
else if (std::count(str.begin(), str.end(), '@') == 1)
{
uint160 parent;
std::string cleanName = CleanName(str, parent);
std::string cleanName = CleanName(str, parent, true, true);
if (cleanName != "")
{
parent.SetNull();
Expand Down Expand Up @@ -981,6 +984,8 @@ std::vector<unsigned char> VectorEncodeVDXFUni(const UniValue &obj)
auto oneValKeys = obj.getKeys();
auto oneValValues = obj.getValues();

// TODO: change if / else to a map lookup

for (int k = 0; k < oneValKeys.size(); k++)
{
uint160 objTypeKey = ParseVDXFKey(oneValKeys[k]);
Expand Down Expand Up @@ -1586,6 +1591,10 @@ std::vector<std::string> ParseSubNames(const std::string &Name, std::string &Cha
// hash its parent names into a parent ID and return the parent hash and cleaned, single name
std::string CleanName(const std::string &Name, uint160 &Parent, bool displayfilter, bool addVerus)
{
// The line below should make sense, but this path should be tested in test mode until we are sure there are
// no edge cases
addVerus = addVerus && (!PBAAS_TESTMODE || Parent.IsNull());

std::string chainName;
std::vector<std::string> subNames = ParseSubNames(Name, chainName, displayfilter, addVerus);

Expand All @@ -1595,6 +1604,7 @@ std::string CleanName(const std::string &Name, uint160 &Parent, bool displayfilt
}

if (!Parent.IsNull() &&
subNames.size() > 1 &&
boost::to_lower_copy(subNames.back()) == boost::to_lower_copy(VERUS_CHAINNAME))
{
subNames.pop_back();
Expand Down
2 changes: 2 additions & 0 deletions src/key_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

extern CIdentityID VERUS_DEFAULTID;
extern CIdentityID VERUS_NOTARYID;
extern CIdentityID PBAAS_NOTIFICATION_ORACLE;
extern std::string PBAAS_DEFAULT_NOTIFICATION_ORACLE;
extern uint160 VERUS_NODEID;
extern int32_t MAX_UTXOS_ID_RESCAN;
extern int32_t MAX_OUR_UTXOS_ID_RESCAN;
Expand Down
9 changes: 6 additions & 3 deletions src/komodo_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ std::string ASSETCHAINS_RPCHOST, ASSETCHAINS_RPCCREDENTIALS;
uint160 ASSETCHAINS_CHAINID;
uint160 VERUS_CHAINID;
std::string VERUS_CHAINNAME = "VRSC";

uint32_t PBAAS_TESTFORK_TIME = 1678243200;

bool PARAMS_LOADED = false;
uint16_t ASSETCHAINS_P2PPORT, ASSETCHAINS_RPCPORT;
uint32_t ASSETCHAIN_INIT,ASSETCHAINS_CC,KOMODO_STOPAT;
Expand Down Expand Up @@ -157,7 +160,7 @@ int64_t komodo_current_supply(uint32_t nHeight)
for ( int j = 0; j <= ASSETCHAINS_LASTERA; j++ )
{
// if any condition means we have no more rewards, break
if (j != 0 && (nHeight <= ASSETCHAINS_ENDSUBSIDY[j - 1] || (ASSETCHAINS_ENDSUBSIDY[j - 1] == 0 &&
if (j != 0 && (nHeight <= ASSETCHAINS_ENDSUBSIDY[j - 1] || (ASSETCHAINS_ENDSUBSIDY[j - 1] == 0 &&
(ASSETCHAINS_REWARD[j] == 0 && (j == ASSETCHAINS_LASTERA || ASSETCHAINS_DECAY[j] != SATOSHIDEN)))))
break;

Expand Down Expand Up @@ -190,7 +193,7 @@ int64_t komodo_current_supply(uint32_t nHeight)
lowestSubsidy = 0;
}
else
{
{
// Ex: -ac_eras=3 -ac_reward=0,384,24 -ac_end=1440,260640,0 -ac_halving=1,1440,2103840 -ac_decay 100000000,97750000,0
subsidyDifference = reward - ASSETCHAINS_REWARD[j + 1];
if (subsidyDifference < 0)
Expand Down Expand Up @@ -243,7 +246,7 @@ int64_t komodo_current_supply(uint32_t nHeight)
// if negative slope, the minor triangle is the full number of steps, as the highest
// level step is full. lowest subsidy is just the lowest so far
lowestSubsidy = reward - (stepDifference * nSteps);

// add the step triangles, one per step
cur_money += stepTriangle * nSteps;

Expand Down
10 changes: 2 additions & 8 deletions src/komodo_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ void komodo_configfile(char *symbol, uint16_t rpcport)
int powAveragingWindow = GetArg("-powaveragingwindow", CCurrencyDefinition::DEFAULT_AVERAGING_WINDOW);
int notarizationPeriod = GetArg("-notarizationperiod",
std::max((int)(CCurrencyDefinition::DEFAULT_BLOCK_NOTARIZATION_TIME / paramBlockTime),
(int)CCurrencyDefinition::MIN_BLOCK_NOTARIZATION_BLOCKS));
(int)CCurrencyDefinition::MIN_BLOCK_NOTARIZATION_PERIOD));
if (paramBlockTime != CCurrencyDefinition::DEFAULT_BLOCKTIME_TARGET ||
powAveragingWindow != CCurrencyDefinition::DEFAULT_AVERAGING_WINDOW ||
notarizationPeriod != CCurrencyDefinition::BLOCK_NOTARIZATION_MODULO)
Expand Down Expand Up @@ -1822,12 +1822,6 @@ void komodo_args(char *argv0)
name = "VRSC";
}

if (name != "VRSC")
{
printf("ERROR: Only mainnet is supported in this version of Verus");
exit(1);
}

mapArgs["-ac_name"] = name;
memset(ASSETCHAINS_SYMBOL, 0, sizeof(ASSETCHAINS_SYMBOL));
strcpy(ASSETCHAINS_SYMBOL, name.c_str());
Expand Down Expand Up @@ -2257,7 +2251,7 @@ void komodo_args(char *argv0)
obj.pushKV("blocktime", paramBlockTime);
obj.pushKV("powaveragingwindow", GetArg("-powaveragingwindow", (int64_t)CCurrencyDefinition::DEFAULT_AVERAGING_WINDOW));
obj.pushKV("notarizationperiod", GetArg("-notarizationperiod",
std::max((int64_t)(CCurrencyDefinition::DEFAULT_BLOCK_NOTARIZATION_TIME / paramBlockTime), (int64_t)CCurrencyDefinition::MIN_BLOCK_NOTARIZATION_BLOCKS)));
std::max((int64_t)(CCurrencyDefinition::DEFAULT_BLOCK_NOTARIZATION_TIME / paramBlockTime), (int64_t)CCurrencyDefinition::MIN_BLOCK_NOTARIZATION_PERIOD)));

UniValue eras(UniValue::VARR);
for (int i = 0; i <= ASSETCHAINS_LASTERA; i++)
Expand Down
Loading

0 comments on commit 6c70964

Please sign in to comment.