Browse Source

Merge pull request #456 from VerusCoin/dev

Dev
master v0.9.4-4
Asher Dawes 2 years ago
committed by GitHub
parent
commit
538c91abbc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .gitlab-ci.yml
  2. 2
      README.md
  3. 2
      doc/man/verus-cli/linux/README.txt
  4. 2
      doc/man/verus-cli/mac/README.txt
  5. 2
      doc/man/verus-cli/windows/README.txt
  6. 2
      src/deprecation.h
  7. 21
      src/miner.cpp
  8. 34
      src/pbaas/notarization.cpp
  9. 3
      src/pbaas/pbaas.cpp
  10. 3
      src/pbaas/reserves.h
  11. 2
      src/rpc/misc.cpp
  12. 9
      src/rpc/pbaasrpc.cpp
  13. 2
      src/version.h

2
.gitlab-ci.yml

@ -7,7 +7,7 @@ stages:
########################################################################################################################
variables:
VERSION: 0.9.4-3
VERSION: 0.9.4-4
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

2
README.md

@ -1,5 +1,5 @@
## VerusCoin version 0.9.4-3
## VerusCoin version 0.9.4-4
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.

2
doc/man/verus-cli/linux/README.txt

@ -1,5 +1,5 @@
VerusCoin Command Line Tools v0.9.4-3
VerusCoin Command Line Tools v0.9.4-4
Contents:
verusd - VerusCoin daemon

2
doc/man/verus-cli/mac/README.txt

@ -1,5 +1,5 @@
VerusCoin Command Line Tools v0.9.4-3
VerusCoin Command Line Tools v0.9.4-4
Contents:
verusd - VerusCoin daemon.

2
doc/man/verus-cli/windows/README.txt

@ -1,5 +1,5 @@
VerusCoin Command Line Tools v0.9.4-3
VerusCoin Command Line Tools v0.9.4-4
Contents:
verusd.exe - VerusCoin daemon

2
src/deprecation.h

@ -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 = 2197000;
static const int APPROX_RELEASE_HEIGHT = 2203000;
static const int WEEKS_UNTIL_DEPRECATION = 20;
static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 60 * 24);

21
src/miner.cpp

@ -3745,14 +3745,6 @@ void static BitcoinMiner_noeq()
}
break;
}
else if ((i + 1) < count)
{
// if we'll not drop through, update hashcount
{
miningTimer += totalDone;
totalDone = 0;
}
}
}
else
{
@ -3804,13 +3796,18 @@ void static BitcoinMiner_noeq()
SetThreadPriority(THREAD_PRIORITY_LOWEST);
break;
}
}
{
miningTimer += totalDone;
if ((i + 1) < count)
{
// if we haven't broken out and will not drop through, update hashcount
{
miningTimer += totalDone;
}
}
}
miningTimer += totalDone;
}
// Check for stop or if block needs to be rebuilt
boost::this_thread::interruption_point();

34
src/pbaas/notarization.cpp

@ -2834,6 +2834,28 @@ bool CPBaaSNotarization::CreateEarnedNotarization(const CRPCChainData &externalS
(ConnectedChains.ThisChain().notarizationProtocol == CCurrencyDefinition::NOTARIZATION_AUTO &&
((isStake && mapBlockIt->second->IsVerusPOSBlock()) || (!isStake && !mapBlockIt->second->IsVerusPOSBlock())))))
{
if (LogAcceptCategory("notarization"))
{
LogPrintf("%s: block period #%d, prior block period #%d, height: %u, notarization protocol: %d, isPoS: %s, is last notarization PoS: %s\n",
__func__,
blockPeriodNumber,
priorBlockPeriod,
height,
ConnectedChains.ThisChain().notarizationProtocol,
isStake ? "true" : "false",
mapBlockIt->second->IsVerusPOSBlock() ? "true" : "false");
if (LogAcceptCategory("verbose"))
{
printf("%s: block period #%d, prior block period #%d, height: %u, notarization protocol: %d, isPoS: %s, is last notarization PoS: %s\n",
__func__,
blockPeriodNumber,
priorBlockPeriod,
height,
ConnectedChains.ThisChain().notarizationProtocol,
isStake ? "true" : "false",
mapBlockIt->second->IsVerusPOSBlock() ? "true" : "false");
}
}
return state.Error("ineligible");
}
@ -2925,8 +2947,8 @@ bool CPBaaSNotarization::CreateEarnedNotarization(const CRPCChainData &externalS
if (LogAcceptCategory("notarization") && LogAcceptCategory("verbose"))
{
std::vector<unsigned char> checkHex = ::AsVector(lastPBN);
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());
LogPrintf("%s: hex of notarization: %s\nnotarization: %s\n", __func__, HexBytes(&(checkHex[0]), checkHex.size()).c_str(), lastPBN.ToUniValue().write(1,2).c_str());
printf("%s: notarization: %s\n", __func__, lastPBN.ToUniValue().write(1,2).c_str());
}
CNativeHashWriter hw;
@ -4031,7 +4053,7 @@ bool CPBaaSNotarization::ConfirmOrRejectNotarizations(CWallet *pWallet,
// then is spent into the main transaction
std::vector<int> evidenceInputs;
auto newTxBuilder = TransactionBuilder(Params().GetConsensus(), nHeight, pWallet);
TransactionBuilder &oneConfirmedBuilder = makeInputTx ? newTxBuilder : txBuilder;
TransactionBuilder &oneConfirmedBuilder = (oneConfirmedIdx != cnd.lastConfirmed && makeInputTx) ? newTxBuilder : txBuilder;
bool isConfirmed = false;
for (auto &oneInput : spendsToClose[oneConfirmedIdx])
@ -4047,13 +4069,14 @@ bool CPBaaSNotarization::ConfirmOrRejectNotarizations(CWallet *pWallet,
if (tP.evalCode == EVAL_FINALIZE_NOTARIZATION &&
tP.vData.size() &&
(tPOF = CObjectFinalization(tP.vData[0])).IsValid() &&
tPOF.IsConfirmed() &&
((tPOF.output.hash.IsNull() &&
oneInput.txIn.prevout.hash == cnd.vtx[oneConfirmedIdx].first.hash &&
tPOF.output.n == cnd.vtx[oneConfirmedIdx].first.n) ||
tPOF.output == cnd.vtx[oneConfirmedIdx].first) &&
tPOF.IsConfirmed())
tPOF.output == cnd.vtx[oneConfirmedIdx].first))
{
isConfirmed = true;
makeInputTx = false;
}
}
@ -4080,7 +4103,6 @@ bool CPBaaSNotarization::ConfirmOrRejectNotarizations(CWallet *pWallet,
cnd.vtx[oneConfirmedIdx].first.hash,
cnd.vtx[oneConfirmedIdx].first.n,
height);
//oneConfirmedFinalization.evidenceInputs = evidenceInputs;
cp = CCinit(&CC, EVAL_FINALIZE_NOTARIZATION);
dests = std::vector<CTxDestination>({CPubKey(ParseHex(CC.CChexstr))});

3
src/pbaas/pbaas.cpp

@ -634,7 +634,8 @@ bool PrecheckCrossChainExport(const CTransaction &tx, int32_t outNum, CValidatio
return state.Error("Multi-currency operation before PBaaS activation");
}
// TODO: HARDENING - ensure that we have confirmed all totals and fees are correct, then convert all warnings to errors
// TODO: HARDENING - ensure that we have confirmed all totals and fees are correct, especially cross-chain fees
// then convert all warnings to errors
// ensure that this transaction has the appropriate finalization outputs, as required
// check that all reserve transfers are matched to this export, and no others are mined in to the block that should be included

3
src/pbaas/reserves.h

@ -948,7 +948,8 @@ public:
CCurrencyValueMap totalFees; // total fees in all currencies to split between this export and import
CCurrencyValueMap totalBurned; // if this is a cross chain export, some currencies will be burned, the rest held in deposits
// TODO: HARDENING - on next testnet reset, move this variable to before the CCurrencyValueMaps for easier parsing in the contracts
// TODO: HARDENING - on next testnet reset, put exporter right above the currency maps with totalFees as the first map after that
// also ensure that only valid destination system fee currencies can be used for destination - do this in prechecks
CTransferDestination exporter; // typically the exporting miner or staker's address, to accept deferred payment for the export
int32_t firstInput; // if export is from inputs, on chain of reserveTransfers, this is first input, -1 for cross-chain

2
src/rpc/misc.cpp

@ -1628,7 +1628,7 @@ void CurrencyValuesAndNames(UniValue &output, bool spending, const CTransaction
if (spending) {
CTransaction priorOutTx;
uint256 blockHash;
if (myGetTransaction(tx.vin[index].prevout.hash, priorOutTx, blockHash))
if (tx.vin.size() > index && index >= 0 && myGetTransaction(tx.vin[index].prevout.hash, priorOutTx, blockHash))
{
script = priorOutTx.vout[tx.vin[index].prevout.n].scriptPubKey;
}

9
src/rpc/pbaasrpc.cpp

@ -3179,7 +3179,14 @@ UniValue getbestproofroot(const UniValue& params, bool fHelp)
{
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("invalid currency state request for %s", EncodeDestination(CIdentityID(ASSETCHAINS_CHAINID))));
}
currencyStatesUni.push_back(ConnectedChains.GetCurrencyState(targetCur, nHeight).ToUniValue());
if (lastConfirmedRoot.IsValid())
{
confirmedCurrencyStatesUni.push_back(ConnectedChains.GetCurrencyState(targetCur, lastConfirmedRoot.rootHeight).ToUniValue());
}
else
{
currencyStatesUni.push_back(ConnectedChains.GetCurrencyState(targetCur, nHeight).ToUniValue());
}
for (int i = 0; i < currenciesUni.size(); i++)
{

2
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 "0.9.4-3"
#define VERUS_VERSION "0.9.4-4"
#endif // BITCOIN_VERSION_H

Loading…
Cancel
Save