Skip to content

Commit

Permalink
Merge branch 'dev' into zhtlc-zombie
Browse files Browse the repository at this point in the history
  • Loading branch information
smk762 committed Mar 7, 2024
2 parents af88709 + 261233c commit 612c879
Show file tree
Hide file tree
Showing 15 changed files with 297 additions and 128 deletions.
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 8)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 2)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 0)
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_YEAR, 2024)
AC_INIT([Komodo],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_SUFFIX(_ZC_BUILD_VAL)],[https://github.com/KomodoPlatform/komodo/issues],[komodo])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
Expand Down
104 changes: 19 additions & 85 deletions src/assetchains.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
[
{
"ac_name": "BET",
"ac_supply": "999999"
},
{
"ac_name": "BOTS",
"ac_supply": "999999"
},
{
"ac_name": "CCL",
"ac_supply": "200000000",
"ac_end": "1",
"ac_cc": "2",
"addressindex": "1",
"spentindex": "1",
"addnode": ["142.93.136.89", "195.201.22.89"]
"addnode": ["209.222.101.247", "103.195.100.32", "142.93.136.89", "195.201.22.89", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "CLC",
Expand All @@ -27,116 +19,58 @@
"ac_snapshot":"1440",
"ac_pubkey":"02df9bda7bfe2bcaa938b29a399fb0ba58cfb6cc3ddc0001062a600f60a8237ad9",
"ac_adaptivepow":"6",
"addnode": ["node.cryptocollider.com"]
"addnode": ["209.222.101.247", "103.195.100.32", "node.cryptocollider.com", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "CRYPTO",
"ac_supply": "999999"
},
{
"ac_name": "DEX",
"ac_supply": "999999"
"ac_name": "DOC",
"ac_supply": "90000000000",
"ac_reward": "100000000",
"ac_cc": "3",
"ac_staked": "10",
"addnode": ["209.222.101.247", "103.195.100.32", "65.21.77.109", "65.21.51.47", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "GLEEC",
"ac_supply": "210000000",
"ac_public": "1",
"ac_staked": "100",
"addnode":["95.217.161.126"]
},
{
"ac_name": "HODL",
"ac_supply": "9999999"
"addnode": ["209.222.101.247", "103.195.100.32", "95.217.161.126", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "ILN",
"ac_supply": "10000000000",
"ac_cc": "2",
"addnode": ["51.75.122.83"]
},
{
"ac_name": "JUMBLR",
"ac_supply": "999999"
"addnode": ["209.222.101.247", "103.195.100.32", "51.75.122.83", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "KOIN",
"ac_supply": "125000000",
"addnode": ["3.0.32.10"]
},
{
"ac_name": "MESH",
"ac_supply": "1000007",
"ac_ccactivate": "320000"
},
{
"ac_name": "MGW",
"ac_supply": "999999"
"addnode": ["209.222.101.247", "103.195.100.32", "3.0.32.10", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "MORTY",
"ac_name": "MARTY",
"ac_supply": "90000000000",
"ac_reward": "100000000",
"ac_cc": "3",
"ac_staked": "10",
"addnode": ["138.201.136.145", "95.217.44.58"]
},
{
"ac_name": "MSHARK",
"ac_supply": "1400000"
"addnode": ["209.222.101.247", "103.195.100.32", "65.21.77.109", "65.21.51.47", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "NINJA",
"ac_supply": "100000000"
},
{
"ac_name": "PANGEA",
"ac_supply": "999999"
"ac_supply": "100000000",
"addnode": ["209.222.101.247", "103.195.100.32", "209.222.101.247", "103.195.100.32", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "PIRATE",
"ac_supply": "0",
"ac_reward": "25600000000",
"ac_halving": "77777",
"ac_private": "1",
"addnode": ["88.99.212.81"]
},
{
"ac_name": "REVS",
"ac_supply": "1300000"
},
{
"ac_name": "RICK",
"ac_supply": "90000000000",
"ac_reward": "100000000",
"ac_cc": "3",
"ac_staked": "10",
"addnode": ["138.201.136.145", "95.217.44.58"]
"addnode": ["209.222.101.247", "103.195.100.32", "88.99.212.81", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
},
{
"ac_name": "SUPERNET",
"ac_supply": "816061"
},
{
"ac_name": "THC",
"ac_supply": "251253103",
"ac_reward": "360000000,300000000,240000000,180000000,150000000,90000000,0",
"ac_staked": "100",
"ac_eras": "7",
"ac_end": "500001,1000001,1500001,2000001,2500001,4500001,0",
"ac_perc": "233333333",
"ac_cc": "2",
"ac_ccenable": "229,236,240",
"ac_script": "2ea22c8020987fad30df055db6fd922c3a57e55d76601229ed3da3b31340112e773df3d0d28103120c008203000401ccb8",
"ac_founders": "150",
"ac_cbmaturity": "1",
"ac_sapling": "1",
"earlytxid": "7e4a76259e99c9379551389e9f757fc5f46c33ae922a8644dc2b187af2a6adc1",
"addnode": ["157.230.45.184", "165.22.52.123"]
},
{
"ac_name": "ZILLA",
"ac_supply": "11000000",
"ac_sapling": "5000000",
"addnode": ["51.68.215.104"]
"ac_supply": "816061",
"addnode": ["209.222.101.247", "103.195.100.32", "209.222.101.247", "103.195.100.32", "15.235.204.174", "148.113.1.52", "65.21.77.109", "89.19.26.211", "89.19.26.212"]
}
]
]
1 change: 0 additions & 1 deletion src/assetchains.old
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ komodod -pubkey=$pubkey -ac_name=MARTY -ac_supply=90000000000 -ac_reward=1000000
komodod -pubkey=$pubkey -ac_name=NINJA -ac_supply=100000000 -addnode=95.213.238.98 -addnode=209.222.101.247 -addnode=103.195.100.32 $1 &
komodod -pubkey=$pubkey -ac_name=PIRATE -ac_supply=0 -ac_reward=25600000000 -ac_halving=77777 -ac_private=1 -addnode=88.99.212.81 -addnode=209.222.101.247 -addnode=103.195.100.32 $1 &
komodod -pubkey=$pubkey -ac_name=SUPERNET -ac_supply=816061 -addnode=95.213.238.98 -addnode=209.222.101.247 -addnode=103.195.100.32 $1 &
komodod -pubkey=$pubkey -ac_name=THC -ac_supply=251253103 -ac_reward=360000000,300000000,240000000,180000000,150000000,90000000,0 -ac_staked=100 -ac_eras=7 -ac_end=500001,1000001,1500001,2000001,2500001,4500001,0 -ac_perc=233333333 -ac_cc=2 -ac_ccenable=229,236,240 -ac_script=2ea22c8020987fad30df055db6fd922c3a57e55d76601229ed3da3b31340112e773df3d0d28103120c008203000401ccb8 -ac_founders=150 -ac_cbmaturity=1 -ac_sapling=1 -addnode=157.230.45.184 -addnode=165.22.52.123 -earlytxid=7e4a76259e99c9379551389e9f757fc5f46c33ae922a8644dc2b187af2a6adc1 -addnode=209.222.101.247 -addnode=103.195.100.32 $1 &
60 changes: 60 additions & 0 deletions src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ extern CCriticalSection cs_main;

static const int SPROUT_VALUE_VERSION = 80102;
static const int SAPLING_VALUE_VERSION = 80102;
static const int TRANSPARENT_VALUE_VERSION = 80103;
static const int BURNED_VALUE_VERSION = 80104;

// These 5 are declared here to avoid circular dependencies
// code used this moved into .cpp
Expand Down Expand Up @@ -193,6 +195,44 @@ class CBlockIndex
//! (memory only) The anchor for the tree state up to the end of this block
uint256 hashFinalSproutRoot;

//! The change to the chain supply caused by this block. This is defined as
//! the value of the coinbase outputs in this block, minus fees not claimed
//! by the miner.
//!
//! Will be boost::none under the following conditions:
//! - if the block has never been connected to a chain tip
//! - for older blocks until a reindex has taken place
boost::optional<CAmount> nChainSupplyDelta;

//! (memory only) Total chain supply up to and including this block.
//!
//! Will be boost::none until a reindex has taken place, if nChainTx is
//! zero, or if the block has never been connected to a chain tip.
boost::optional<CAmount> nChainTotalSupply;

//! Change in value in the transparent pool produced by the action of the
//! transparent inputs to and outputs from transactions in this block.
//!
//! Will be boost::none for older blocks until a reindex has taken place.
boost::optional<CAmount> nTransparentValue;

//! (memory only) Total value of the transparent value pool up to and
//! including this block.
//!
//! Will be boost::none until a reindex has taken place.
//! Will be boost::none if nChainTx is zero.
boost::optional<CAmount> nChainTransparentValue;

// This refers to the number of coins burned in this block,
// essentially making them unspendable (due to the OP_RETURN scripts value).
//!
//! For older blocks, this will be boost::none until a reindexing has occurred.
boost::optional<CAmount> nBurnedAmountDelta;

//! (memory only) Total value of the burned coins up to and
//! including this block.
boost::optional<CAmount> nChainTotalBurned;

//! Change in value held by the Sprout circuit over this block.
//! Will be boost::none for older blocks on old nodes until a reindex has taken place.
boost::optional<CAmount> nSproutValue;
Expand Down Expand Up @@ -249,6 +289,13 @@ class CBlockIndex
hashSproutAnchor = uint256();
hashFinalSproutRoot = uint256();
nSequenceId = 0;

nChainSupplyDelta = boost::none;
nChainTotalSupply = boost::none;
nTransparentValue = boost::none;
nChainTransparentValue = boost::none;
nBurnedAmountDelta = boost::none;
nChainTotalBurned = boost::none;
nSproutValue = boost::none;
nChainSproutValue = boost::none;
nSaplingValue = 0;
Expand Down Expand Up @@ -443,6 +490,19 @@ class CDiskBlockIndex : public CBlockIndex
READWRITE(nNonce);
READWRITE(nSolution);

// Only read/write nTransparentValue if the client version used to create
// this index was storing them.
if ((s.GetType() & SER_DISK) && (nVersion >= TRANSPARENT_VALUE_VERSION)) {
READWRITE(nChainSupplyDelta);
READWRITE(nTransparentValue);
}

// Only read/write nBurnedAmountDelta if the client version used to create
// this index was storing them.
if ((s.GetType() & SER_DISK) && (nVersion >= BURNED_VALUE_VERSION)) {
READWRITE(nBurnedAmountDelta);
}

// Only read/write nSproutValue if the client version used to create
// this index was storing them.
if ((s.GetType() & SER_DISK) && (nVersion >= SPROUT_VALUE_VERSION)) {
Expand Down
6 changes: 3 additions & 3 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 2
#define CLIENT_VERSION_REVISION 2
#define CLIENT_VERSION_BUILD 0

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand All @@ -42,7 +42,7 @@
* Copyright year (2009-this)
* Todo: update this when changing our copyright comments in the source
*/
#define COPYRIGHT_YEAR 2023
#define COPYRIGHT_YEAR 2024

#endif //HAVE_CONFIG_H

Expand Down
7 changes: 6 additions & 1 deletion src/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ const CScript &CCoinsViewCache::GetSpendFor(const CTxIn& input) const
* @returns Sum of value of all inputs (scriptSigs), (positive valueBalance or zero) and JoinSplit vpub_new
*/
CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t &interestp,const CTransaction& tx) const
{
return GetTransparentValueIn(nHeight, interestp, tx) + tx.GetShieldedValueIn();
}

// TODO: remove this if it ends up unused
CAmount CCoinsViewCache::GetTransparentValueIn(int32_t nHeight,int64_t &interestp,const CTransaction& tx) const
{
CAmount value,nResult = 0;
interestp = 0;
Expand Down Expand Up @@ -617,7 +623,6 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t &interestp,const CTr
}
#endif
}
nResult += tx.GetShieldedValueIn();

return nResult;
}
Expand Down
15 changes: 13 additions & 2 deletions src/coins.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,22 @@ class CCoinsViewCache : public CCoinsViewBacked
* so may not be able to calculate this.
* @param[in] nHeight the chain height
* @param[out] interestp the interest found
* @param[in] tx transaction for which we are checking input total
* @returns Sum of value of all inputs (scriptSigs), (positive valueBalance or zero) and JoinSplit vpub_new
* @param[in] tx transaction for which we are checking input total
* @return Sum of value of all inputs (scriptSigs), JoinSplit vpub_new, and
* positive values of valueBalanceSapling, and valueBalanceOrchard.
*/
CAmount GetValueIn(int32_t nHeight,int64_t &interestp,const CTransaction& tx) const;

/**
* Amount of coins coming in to a transaction in the transparent inputs.
*
* @param[in] nHeight the chain height
* @param[out] interestp the interest found
* @param[in] tx transaction for which we are checking input total
* @return Sum of value of all inputs (scriptSigs)
*/
CAmount GetTransparentValueIn(int32_t nHeight,int64_t &interestp,const CTransaction& tx) const;

//! Check whether all prevouts of the transaction are present in the UTXO set represented by this view
bool HaveInputs(const CTransaction& tx) const;

Expand Down
2 changes: 1 addition & 1 deletion src/cryptoconditions/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ libcryptoconditions_core_a_SOURCES = \
src/asn/per_decoder.c \
src/asn/per_encoder.c \
src/asn/per_opentype.c
libcryptoconditions_core_a_CPPFLAGS=-I. -I./src/include -I./src/asn
libcryptoconditions_core_a_CPPFLAGS=-I. -I./src/include -I./src/asn -fPIC

test:
bash -c '[ -d .env ] || virtualenv .env -p python3'
Expand Down
Loading

0 comments on commit 612c879

Please sign in to comment.