Browse Source

Merge pull request #369 from VerusCoin/dev

Dev
pull/433/head v0.9.0-1
Asher Dawes 3 years ago
committed by GitHub
parent
commit
d0aecf8fcf
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/cryptoconditions/include/cryptoconditions.h
  7. 2
      src/deprecation.h
  8. 44
      src/main.cpp
  9. 4
      src/miner.cpp
  10. 8
      src/pbaas/crosschainrpc.h
  11. 3
      src/pbaas/notarization.cpp
  12. 4
      src/pbaas/pbaas.cpp
  13. 2
      src/script/script.cpp
  14. 3
      src/transaction_builder.cpp
  15. 2
      src/version.h

2
.gitlab-ci.yml

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

2
README.md

@ -1,5 +1,5 @@
## VerusCoin version 0.9.0
## VerusCoin version 0.9.0-1
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.0
VerusCoin Command Line Tools v0.9.0-1
Contents:
verusd - VerusCoin daemon

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

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

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

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

2
src/cryptoconditions/include/cryptoconditions.h

@ -14,7 +14,7 @@ extern "C" {
struct CC;
struct CCType;
#define MAX_BINARY_CC_SIZE 5120
#define MAX_BINARY_CC_SIZE 6000
enum CCTypeId {
CC_Anon = -1,

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

44
src/main.cpp

@ -1757,7 +1757,8 @@ bool AcceptToMemoryPoolInt(CTxMemPool& pool, CValidationState &state, const CTra
if (pfMissingInputs)
*pfMissingInputs = false;
int flag=0, nextBlockHeight = simHeight ? simHeight : chainActive.Height() + 1;
CBlockIndex *pLastIndex = chainActive.LastTip();
int flag=0, nextBlockHeight = simHeight ? simHeight : (pLastIndex ? pLastIndex->GetHeight() + 1 : 1);
auto consensusBranchId = CurrentEpochBranchId(nextBlockHeight, Params().GetConsensus());
auto chainParams = Params();
@ -3221,6 +3222,14 @@ enum DisconnectResult
DISCONNECT_FAILED // Something else went wrong.
};
void SetMaxScriptElementSize(uint32_t height)
{
if (CConstVerusSolutionVector::GetVersionByHeight(height) >= CActivationHeight::ACTIVATE_PBAAS)
{
CScript::MAX_SCRIPT_ELEMENT_SIZE = MAX_SCRIPT_ELEMENT_SIZE_PBAAS;
}
}
/** Undo the effects of this block (with given index) on the UTXO set represented by coins.
* When UNCLEAN or FAILED is returned, view is left in an indeterminate state.
* The addressIndex and spentIndex will be updated if requested.
@ -3596,39 +3605,26 @@ static int64_t nTimeIndex = 0;
static int64_t nTimeCallbacks = 0;
static int64_t nTimeTotal = 0;
void SetMaxScriptElementSize(uint32_t height)
{
if (CConstVerusSolutionVector::GetVersionByHeight(height) >= CActivationHeight::ACTIVATE_PBAAS)
{
CScript::MAX_SCRIPT_ELEMENT_SIZE = MAX_SCRIPT_ELEMENT_SIZE_PBAAS;
}
else if (CConstVerusSolutionVector::GetVersionByHeight(height) >= CActivationHeight::ACTIVATE_IDENTITY)
{
CScript::MAX_SCRIPT_ELEMENT_SIZE = MAX_SCRIPT_ELEMENT_SIZE_IDENTITY;
}
else
{
CScript::MAX_SCRIPT_ELEMENT_SIZE = MAX_SCRIPT_ELEMENT_SIZE_V2;
}
}
bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& view, const CChainParams& chainparams, bool fJustCheck, bool fCheckPOW)
{
if ( KOMODO_STOPAT != 0 && pindex->GetHeight() > KOMODO_STOPAT )
uint32_t nHeight = pindex->GetHeight();
if ( KOMODO_STOPAT != 0 && nHeight > KOMODO_STOPAT )
return(false);
//fprintf(stderr,"connectblock ht.%d\n",(int32_t)pindex->GetHeight());
AssertLockHeld(cs_main);
// either set at activate best chain or when we connect block 1
if (pindex->GetHeight() == 1)
if (nHeight == 1)
{
InitializePremineSupply();
}
SetMaxScriptElementSize(nHeight);
bool fExpensiveChecks = true;
if (fCheckpointsEnabled) {
CBlockIndex *pindexLastCheckpoint = Checkpoints::GetLastCheckpoint(chainparams.Checkpoints());
if (pindexLastCheckpoint && pindexLastCheckpoint->GetAncestor(pindex->GetHeight()) == pindex) {
if (pindexLastCheckpoint && pindexLastCheckpoint->GetAncestor(nHeight) == pindex) {
// This block is an ancestor of a checkpoint: disable script checks
fExpensiveChecks = false;
}
@ -3649,7 +3645,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
REJECT_INVALID, "invalid-block");
}
if (block.IsVerusPOSBlock() && !verusCheckPOSBlock(true, &block, pindex->GetHeight()))
if (block.IsVerusPOSBlock() && !verusCheckPOSBlock(true, &block, nHeight))
{
return state.DoS(100, error("%s: invalid PoS block in connectblock futureblock.%d\n", __func__, futureblock),
REJECT_INVALID, "invalid-pos-block");
@ -3796,7 +3792,6 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
assert(view.GetSaplingAnchorAt(view.GetBestAnchor(SAPLING), sapling_tree));
// Grab the consensus branch ID for the block's height
uint32_t nHeight = pindex->GetHeight();
auto consensus = Params().GetConsensus();
auto consensusBranchId = CurrentEpochBranchId(nHeight, consensus);
bool isVerusActive = IsVerusActive();
@ -4583,7 +4578,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
}
// END insightexplorer
SetMaxScriptElementSize(pindex->GetHeight() + 1);
SetMaxScriptElementSize(nHeight + 1);
// add this block to the view's block chain
view.SetBestBlock(pindex->GetBlockHash());
@ -5780,6 +5775,8 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
// we need this lock to prevent accepting transactions we shouldn't
LOCK2(cs_main, mempool.cs);
SetMaxScriptElementSize(height);
//printf("checking block %d\n", height);
while ( 1 )
{
@ -6079,6 +6076,7 @@ static bool AcceptBlockHeader(int32_t *futureblockp,const CBlockHeader& block, C
*ppindex = pindex;
if ( pindex != 0 && pindex->nStatus & BLOCK_FAILED_MASK )
{
//printf("block height: %u, hash: %s\n", pindex->GetHeight(), pindex->GetBlockHash().GetHex().c_str());
LogPrint("net", "block height: %u\n", pindex->GetHeight());
return state.DoS(100, error("%s: block is marked invalid", __func__), REJECT_INVALID, "banned-for-invalid-block");
}

4
src/miner.cpp

@ -392,13 +392,13 @@ void ProcessNewImports(const uint160 &sourceChainID, CPBaaSNotarization &lastCon
UniValue getexports(const UniValue& params, bool fHelp);
result = getexports(params, false);
}
else
else if (ConnectedChains.IsNotaryAvailable())
{
result = find_value(RPCCallRoot("getexports", params), "result");
}
} catch (exception e)
{
printf("Could not get latest export from external chain %s for %s\n", EncodeDestination(CIdentityID(sourceChainID)).c_str(), uni_get_str(params[0]).c_str());
LogPrint("notarization", "Could not get latest export from external chain %s for %s\n", EncodeDestination(CIdentityID(sourceChainID)).c_str(), uni_get_str(params[0]).c_str());
return;
}

8
src/pbaas/crosschainrpc.h

@ -616,7 +616,7 @@ public:
READWRITE(VARINT(currencyImportFee));
READWRITE(VARINT(transactionImportFee));
READWRITE(VARINT(transactionExportFee));
READWRITE(LIMITED_STRING(gatewayConverterName, MAX_NAME_LEN)); // TODO: HARDENING - this needs to be moved to gateway or pbaas
READWRITE(LIMITED_STRING(gatewayConverterName, MAX_NAME_LEN));
}
else
{
@ -666,12 +666,6 @@ public:
uint160 thisParentID = GetID();
retVal = GetID(gatewayConverterName, thisParentID);
}
// TODO: HARDENING - remove this exception on next testnet reset
else if (name == "vETH")
{
uint160 thisParentID = GetID();
retVal = GetID("bridge", thisParentID);
}
return retVal;
}

3
src/pbaas/notarization.cpp

@ -563,6 +563,9 @@ bool CPBaaSNotarization::NextNotarizationInfo(const CCurrencyDefinition &sourceS
bool thisIsLaunchSys = destCurrency.launchSystemID == ASSETCHAINS_CHAINID;
// if this is the clear launch notarization after start, make the notarization and determine if we should launch or refund
// TODO: HARDENING ensure that the latest proof root of this chain is in on gateway
if (destCurrency.launchSystemID == sourceSystemID &&
((thisIsLaunchSys && notaHeight <= (destCurrency.startBlock ? (destCurrency.startBlock - 1) : 0)) ||
(!thisIsLaunchSys &&

4
src/pbaas/pbaas.cpp

@ -5130,13 +5130,13 @@ GetPendingExports(const CCurrencyDefinition &sourceChain,
UniValue getexports(const UniValue& params, bool fHelp);
result = getexports(params, false);
}
else
else if (ConnectedChains.IsNotaryAvailable())
{
result = find_value(RPCCallRoot("getexports", params), "result");
}
} catch (exception e)
{
printf("Could not get latest export from external chain %s\n", uni_get_str(params[0]).c_str());
LogPrint("notarization", "Could not get latest export from external chain %s\n", uni_get_str(params[0]).c_str());
return exports;
}

2
src/script/script.cpp

@ -325,7 +325,7 @@ std::vector<unsigned char> CStakeInfo::AsVector() const
return ::AsVector(*this);
}
unsigned int CScript::MAX_SCRIPT_ELEMENT_SIZE = MAX_SCRIPT_ELEMENT_SIZE_V2;
unsigned int CScript::MAX_SCRIPT_ELEMENT_SIZE = MAX_SCRIPT_ELEMENT_SIZE_IDENTITY;
unsigned int CScript::GetSigOpCount(bool fAccurate) const
{

3
src/transaction_builder.cpp

@ -330,6 +330,9 @@ TransactionBuilderResult TransactionBuilder::Build(bool throwTxWithPartialSig)
if ((rtxd.NativeFees() - this->fee) != change)
{
//UniValue jsonTx(UniValue::VOBJ);
//TxToUniv(mtx, uint256(), jsonTx);
//printf("%s: mtx: %s\n", __func__, jsonTx.write(1,2).c_str());
printf("%s: native fees do not match builder: %s, blockchain: %s\n", __func__, ValueFromAmount(change).write(1,2).c_str(), ValueFromAmount(rtxd.NativeFees()).write(1,2).c_str());
LogPrintf("%s: native fees do not match builder: %s, blockchain: %s\n", __func__, ValueFromAmount(change).write(1,2).c_str(), ValueFromAmount(rtxd.NativeFees()).write(1,2).c_str());
return TransactionBuilderResult("Native fees do not match builder");

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.0"
#define VERUS_VERSION "0.9.0-1"
#endif // BITCOIN_VERSION_H

Loading…
Cancel
Save