From f45379735b3541fbe6dd6f3229e0749357953584 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Thu, 11 Apr 2019 08:46:50 -0700 Subject: [PATCH 01/17] Mods to fix small FR rounding issue --- src/komodo_bitcoind.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index d23dac77a..95ad865bb 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1208,13 +1208,44 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) if ( is_STAKED(ASSETCHAINS_SYMBOL) == 2 ) return(0); - int32_t i,j,n=0,txn_count; int64_t nSubsidy; uint64_t commission,total = 0; + int32_t i,j,n=0,txn_count,halvings; int64_t nSubsidy; uint64_t commission,total = 0; txn_count = pblock->vtx.size(); + //int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000; + int32_t starting_commission = 125000000, HALVING1 = 340, INTERVAL = 840; if ( ASSETCHAINS_FOUNDERS != 0 ) { nSubsidy = GetBlockSubsidy(height,Params().GetConsensus()); //fprintf(stderr,"ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN); + if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT3") != 0)) { + // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it ourselves. + // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 + // but to tell the AC params, I need to say "11% of 11.25" is 1.25 + // 11% ie. 1/9th cannot be exactly represented and so the FR has tiny amounts of error unless done manually + if (height < HALVING1) { + commission = starting_commission; + } else if (height < HALVING1+1*INTERVAL) { + commission = starting_commission / 2; + } else if (height < HALVING1+2*INTERVAL) { + commission = starting_commission / 4; + } else if (height < HALVING1+3*INTERVAL) { + commission = starting_commission / 8; + } else if (height < HALVING1+4*INTERVAL) { + commission = starting_commission / 16; + } else if (height < HALVING1+5*INTERVAL) { + commission = starting_commission / 32; + } else if (height < HALVING1+6*INTERVAL) { + commission = starting_commission / 64; + } else if (height < HALVING1+7*INTERVAL) { + commission = starting_commission / 128; + } else if (height < HALVING1+8*INTERVAL) { + commission = starting_commission / 256; + } else if (height < HALVING1+9*INTERVAL) { + // HUSH should never hit the 9th halving, but yolo + commission = starting_commission / 512; + } + } + if ( ASSETCHAINS_FOUNDERS > 1 ) { if ( (height % ASSETCHAINS_FOUNDERS) == 0 ) From 87fc2de6878f1950662539ef9e5a1ff5daa396cc Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Thu, 11 Apr 2019 08:53:24 -0700 Subject: [PATCH 02/17] Add HUSH testnet script to test frfix branch --- src/hushd-testnet | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 src/hushd-testnet diff --git a/src/hushd-testnet b/src/hushd-testnet new file mode 100755 index 000000000..f76c3c9ab --- /dev/null +++ b/src/hushd-testnet @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright (c) 2019 Hush developers + +# set working directory to the location of this script +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR + +# TESTING VALUES, DO NOT USE EXCEPT FOR DEVELOPMENT +NAME=HUSHT3 +# this corresponds to FR address RHushEyeDm7XwtaTWtyCbjGQumYyV8vMjn +SCRIPT=76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac + +# Chain parameters +ERAS=3 +BLOCKTIME=150 +SUPPLY=6250000 +FOUNDERS=1 +REWARD=0,1125000000,562500000 +PERC=11111111 +HALVING=129,340,840 +END=128,340,5422111 +CLIENTNAME=GoldenSandtrout + +# CryptoConditions/Custom Consensus params +FAUCET=228 +HEIR=234 +CHANNEL=235 +ORACLE=236 +GATEWAY=241 +CCENABLE=$FAUCET,$HEIR,$CHANNEL,$ORACLE,$GATEWAY + +KMD=${KOMODOD:-./komodod} +$KMD -ac_name=$NAME -ac_sapling=1 \ + -ac_reward=$REWARD \ + -ac_halving=$HALVING \ + -ac_end=$END \ + -ac_eras=$ERAS \ + -ac_blocktime=$BLOCKTIME \ + -ac_cc=2 -ac_ccenable=$CCENABLE \ + -ac_founders=$FOUNDERS -ac_supply=$SUPPLY \ + -ac_perc=$PERC \ + -clientname=$CLIENTNAME \ + -ac_script=$SCRIPT "$@" From c1934ec813695f714c31d04e0854d098c4f4c224 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 04:00:14 -0700 Subject: [PATCH 03/17] int64_t is probably important for commission, enable some debug prints --- src/komodo_bitcoind.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 95ad865bb..f0e270a2f 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1210,13 +1210,14 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) int32_t i,j,n=0,txn_count,halvings; int64_t nSubsidy; uint64_t commission,total = 0; txn_count = pblock->vtx.size(); + // HUSH prod values //int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000; - int32_t starting_commission = 125000000, HALVING1 = 340, INTERVAL = 840; + int64_t starting_commission = 125000000, HALVING1 = 340, INTERVAL = 840; if ( ASSETCHAINS_FOUNDERS != 0 ) { nSubsidy = GetBlockSubsidy(height,Params().GetConsensus()); - //fprintf(stderr,"ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN); + fprintf(stderr,"ORIG ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT3") != 0)) { // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it ourselves. // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 @@ -1245,6 +1246,7 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) commission = starting_commission / 512; } } + fprintf(stderr,"AFTER ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); if ( ASSETCHAINS_FOUNDERS > 1 ) { @@ -1282,7 +1284,7 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) } if ( commission < 10000 ) commission = 0; - //fprintf(stderr,"-> %.8f\n",(double)commission/COIN); + fprintf(stderr,"-> %.8f\n",(double)commission/COIN); return(commission); } From f4c4104cf055ce924f14934f00335bfd8b28a10e Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 05:12:26 -0700 Subject: [PATCH 04/17] more debug prints --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index f0e270a2f..48b321d80 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -2057,7 +2057,7 @@ int64_t komodo_checkcommission(CBlock *pblock,int32_t height) checktoshis = komodo_commission(pblock,height); if ( checktoshis >= 10000 && pblock->vtx[0].vout.size() < 2 ) { - //fprintf(stderr,"komodo_checkcommission vsize.%d height.%d commission %.8f\n",(int32_t)pblock->vtx[0].vout.size(),height,(double)checktoshis/COIN); + fprintf(stderr,"komodo_checkcommission vsize.%d height.%d commission %.8f\n",(int32_t)pblock->vtx[0].vout.size(),height,(double)checktoshis/COIN); return(-1); } else if ( checktoshis != 0 ) From 85dd6ce61cc019bd939f579c95bc8f2701620986 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 14:32:09 +0200 Subject: [PATCH 05/17] T3 --- src/hush-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hush-cli b/src/hush-cli index 57b879bcb..4ca911e7c 100755 --- a/src/hush-cli +++ b/src/hush-cli @@ -5,6 +5,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR -NAME=HUSHT +NAME=HUSHT3 ./komodo-cli -ac_name=$NAME "$@" From 97eeeaa779e3856f683db1b4d7690f0c1ff6f8b0 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 05:53:04 -0700 Subject: [PATCH 06/17] No FR in 0 BR transition period --- src/komodo_bitcoind.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 48b321d80..1dc5b187e 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1212,7 +1212,7 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) txn_count = pblock->vtx.size(); // HUSH prod values //int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000; - int64_t starting_commission = 125000000, HALVING1 = 340, INTERVAL = 840; + int64_t starting_commission = 125000000, HALVING1 = 340, INTERVAL = 840, TRANSITION = 129; if ( ASSETCHAINS_FOUNDERS != 0 ) { nSubsidy = GetBlockSubsidy(height,Params().GetConsensus()); @@ -1223,7 +1223,11 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 // but to tell the AC params, I need to say "11% of 11.25" is 1.25 // 11% ie. 1/9th cannot be exactly represented and so the FR has tiny amounts of error unless done manually - if (height < HALVING1) { + + // Transition period of 128 blocks has no FR + if (height < 129) { + commission = 0; + else if (height < HALVING1) { commission = starting_commission; } else if (height < HALVING1+1*INTERVAL) { commission = starting_commission / 2; From 18e93c1c9bfaab7db16566c8235ed0327e757d4b Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Fri, 12 Apr 2019 05:55:12 -0700 Subject: [PATCH 07/17] fix compile error --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 1dc5b187e..117458813 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1227,7 +1227,7 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) // Transition period of 128 blocks has no FR if (height < 129) { commission = 0; - else if (height < HALVING1) { + } else if (height < HALVING1) { commission = starting_commission; } else if (height < HALVING1+1*INTERVAL) { commission = starting_commission / 2; From ce41b2de32db7faff7458a81307ae70ea4157dc7 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 09:00:32 -0700 Subject: [PATCH 08/17] Update almost-finalized prod chain params --- src/hushd | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/hushd b/src/hushd index a23e70edc..9a474275e 100755 --- a/src/hushd +++ b/src/hushd @@ -5,18 +5,24 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR -# TESTING VALUES, DO NOT USE EXCEPT FOR DEVELOPMENT -NAME=HUSHT -PUBKEY=0392cd7cbdc188de147fa13b38d97ea2e4d612300100fcea14d200907b05f707e8 +# NOT FINALIZED, but very close to our production chainparams +NAME=HUSH +# this corresponds to FR address RHushEyeDm7XwtaTWtyCbjGQumYyV8vMjn +SCRIPT=76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac -# chain params +# Chain parameters +ERAS=3 +BLOCKTIME=150 SUPPLY=6250000 -FOUNDERS=500 +FOUNDERS=1 +REWARD=0,1125000000,562500000 +PERC=11111111 HALVING=129,340000,840000 +# TODO: Re-verify our end block END=128,340000,5422111 -CLIENTNAME=TransientMangrove +CLIENTNAME=GoldenSandtrout -# CryptoConditions/Custom Consensus settings +# CryptoConditions/Custom Consensus params FAUCET=228 HEIR=234 CHANNEL=235 @@ -24,16 +30,15 @@ ORACLE=236 GATEWAY=241 CCENABLE=$FAUCET,$HEIR,$CHANNEL,$ORACLE,$GATEWAY -# TODO: support KOMODOD env var to use custom binary -./komodod -ac_name=$NAME -ac_sapling=1 \ - -ac_reward=0,1250000000,675000000 \ - -ac_halving=$HALVING \ - -ac_end=$END \ - -ac_eras=3 -ac_blocktime=150 \ - -ac_cc=2 -ac_ccenable=$CCENABLE \ - -ac_founders=$FOUNDERS -ac_supply=$SUPPLY \ - -ac_perc=10000000 \ - -clientname=$CLIENTNAME \ - -ac_pubkey=$PUBKEY "$@" -# -addnode=195.201.20.230 -addnode=195.201.137.5 - +KMD=${KOMODOD:-./komodod} +$KMD -ac_name=$NAME -ac_sapling=1 \ + -ac_reward=$REWARD \ + -ac_halving=$HALVING \ + -ac_end=$END \ + -ac_eras=$ERAS \ + -ac_blocktime=$BLOCKTIME \ + -ac_cc=2 -ac_ccenable=$CCENABLE \ + -ac_founders=$FOUNDERS -ac_supply=$SUPPLY \ + -ac_perc=$PERC \ + -clientname=$CLIENTNAME \ + -ac_script=$SCRIPT "$@" From ed3090d2e830a1fd8980d411510624d049a76029 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 11:12:04 -0700 Subject: [PATCH 09/17] Enforce founders reward = 0 when block reward goes to zero --- src/komodo_bitcoind.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 117458813..e0eb448d4 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1210,21 +1210,23 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) int32_t i,j,n=0,txn_count,halvings; int64_t nSubsidy; uint64_t commission,total = 0; txn_count = pblock->vtx.size(); - // HUSH prod values - //int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000; - int64_t starting_commission = 125000000, HALVING1 = 340, INTERVAL = 840, TRANSITION = 129; if ( ASSETCHAINS_FOUNDERS != 0 ) { + // prod values + //int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000, TRANSITION = 129, BR_END = 5422111; + // testnet values + int64_t starting_commission = 125000000, HALVING1 = 34, INTERVAL = 84, TRANSITION = 129, BR_END = 500; nSubsidy = GetBlockSubsidy(height,Params().GetConsensus()); commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN); fprintf(stderr,"ORIG ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); - if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT3") != 0)) { + + if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT4") != 0)) { // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it ourselves. // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 // but to tell the AC params, I need to say "11% of 11.25" is 1.25 // 11% ie. 1/9th cannot be exactly represented and so the FR has tiny amounts of error unless done manually - // Transition period of 128 blocks has no FR + // Transition period of 128 blocks has BR=FR=0 if (height < 129) { commission = 0; } else if (height < HALVING1) { @@ -1249,6 +1251,11 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) // HUSH should never hit the 9th halving, but yolo commission = starting_commission / 512; } + + // enforce the end of FR when BR ends + if (height > BR_END) { + commission = 0; + } } fprintf(stderr,"AFTER ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); From a4149b6a18dbbf97fbf8f7c9e319f67c5645ad65 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 11:19:25 -0700 Subject: [PATCH 10/17] Smaller values for testnet blocks so we can verify faster --- src/hushd-testnet | 4 ++-- src/komodo_bitcoind.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hushd-testnet b/src/hushd-testnet index f76c3c9ab..c1be85f57 100755 --- a/src/hushd-testnet +++ b/src/hushd-testnet @@ -17,8 +17,8 @@ SUPPLY=6250000 FOUNDERS=1 REWARD=0,1125000000,562500000 PERC=11111111 -HALVING=129,340,840 -END=128,340,5422111 +HALVING=29,34,84 +END=28,34,500 CLIENTNAME=GoldenSandtrout # CryptoConditions/Custom Consensus params diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index e0eb448d4..29caa6a85 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1215,7 +1215,7 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) // prod values //int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000, TRANSITION = 129, BR_END = 5422111; // testnet values - int64_t starting_commission = 125000000, HALVING1 = 34, INTERVAL = 84, TRANSITION = 129, BR_END = 500; + int64_t starting_commission = 125000000, HALVING1 = 142, INTERVAL = 84, TRANSITION = 29, BR_END = 500; nSubsidy = GetBlockSubsidy(height,Params().GetConsensus()); commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN); fprintf(stderr,"ORIG ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); @@ -1227,7 +1227,7 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) // 11% ie. 1/9th cannot be exactly represented and so the FR has tiny amounts of error unless done manually // Transition period of 128 blocks has BR=FR=0 - if (height < 129) { + if (height < TRANSITION) { commission = 0; } else if (height < HALVING1) { commission = starting_commission; From 7ce2189cfeda393ed13fcc9cd22adaef48f03ac9 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 11:55:10 -0700 Subject: [PATCH 11/17] HUSHT4 --- src/hush-cli | 2 +- src/hushd-testnet | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hush-cli b/src/hush-cli index 4ca911e7c..a7e9c4f69 100755 --- a/src/hush-cli +++ b/src/hush-cli @@ -5,6 +5,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR -NAME=HUSHT3 +NAME=HUSHT4 ./komodo-cli -ac_name=$NAME "$@" diff --git a/src/hushd-testnet b/src/hushd-testnet index c1be85f57..a68c4b04b 100755 --- a/src/hushd-testnet +++ b/src/hushd-testnet @@ -6,7 +6,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR # TESTING VALUES, DO NOT USE EXCEPT FOR DEVELOPMENT -NAME=HUSHT3 +NAME=HUSHT4 # this corresponds to FR address RHushEyeDm7XwtaTWtyCbjGQumYyV8vMjn SCRIPT=76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac From 30643f4994d8d74db576b46072d903d6a08bc379 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 12 Apr 2019 20:23:04 -0700 Subject: [PATCH 12/17] Stop using eras and hardcode HUSH subsidy/FR --- src/hushd-testnet | 15 ++---- src/komodo_bitcoind.h | 19 +++---- src/komodo_utils.h | 117 +++++++++++------------------------------- 3 files changed, 41 insertions(+), 110 deletions(-) diff --git a/src/hushd-testnet b/src/hushd-testnet index a68c4b04b..954001363 100755 --- a/src/hushd-testnet +++ b/src/hushd-testnet @@ -6,19 +6,14 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR # TESTING VALUES, DO NOT USE EXCEPT FOR DEVELOPMENT -NAME=HUSHT4 +NAME=HUSHT5 # this corresponds to FR address RHushEyeDm7XwtaTWtyCbjGQumYyV8vMjn SCRIPT=76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac # Chain parameters -ERAS=3 -BLOCKTIME=150 +BLOCKTIME=10 SUPPLY=6250000 FOUNDERS=1 -REWARD=0,1125000000,562500000 -PERC=11111111 -HALVING=29,34,84 -END=28,34,500 CLIENTNAME=GoldenSandtrout # CryptoConditions/Custom Consensus params @@ -27,17 +22,13 @@ HEIR=234 CHANNEL=235 ORACLE=236 GATEWAY=241 +DILITHIUM= CCENABLE=$FAUCET,$HEIR,$CHANNEL,$ORACLE,$GATEWAY KMD=${KOMODOD:-./komodod} $KMD -ac_name=$NAME -ac_sapling=1 \ - -ac_reward=$REWARD \ - -ac_halving=$HALVING \ - -ac_end=$END \ - -ac_eras=$ERAS \ -ac_blocktime=$BLOCKTIME \ -ac_cc=2 -ac_ccenable=$CCENABLE \ -ac_founders=$FOUNDERS -ac_supply=$SUPPLY \ - -ac_perc=$PERC \ -clientname=$CLIENTNAME \ -ac_script=$SCRIPT "$@" diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 29caa6a85..5bde4a773 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1215,15 +1215,14 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) // prod values //int32_t starting_commission = 125000000, HALVING1 = 340000, INTERVAL = 840000, TRANSITION = 129, BR_END = 5422111; // testnet values - int64_t starting_commission = 125000000, HALVING1 = 142, INTERVAL = 84, TRANSITION = 29, BR_END = 500; + int64_t starting_commission = 125000000, HALVING1 = 34, INTERVAL = 84, TRANSITION = 29, BR_END = 500; nSubsidy = GetBlockSubsidy(height,Params().GetConsensus()); commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN); fprintf(stderr,"ORIG ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); - if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT4") != 0)) { - // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it ourselves. - // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 - // but to tell the AC params, I need to say "11% of 11.25" is 1.25 + if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT5") != 0)) { + // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it manually + // 10% of 12.5 is 1.25 but to tell the AC params, I need to say "11% of 11.25" is 1.25 // 11% ie. 1/9th cannot be exactly represented and so the FR has tiny amounts of error unless done manually // Transition period of 128 blocks has BR=FR=0 @@ -1241,15 +1240,13 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) commission = starting_commission / 16; } else if (height < HALVING1+5*INTERVAL) { commission = starting_commission / 32; - } else if (height < HALVING1+6*INTERVAL) { + } else if (height < HALVING1+6*INTERVAL) { // Block 5380000 + // Block reward will go to zero between 7th+8th halvings commission = starting_commission / 64; - } else if (height < HALVING1+7*INTERVAL) { + } else if (height < HALVING1+7*INTERVAL) { // Block 6220000 commission = starting_commission / 128; - } else if (height < HALVING1+8*INTERVAL) { + } else if (height < HALVING1+8*INTERVAL) { // Block 7060000 commission = starting_commission / 256; - } else if (height < HALVING1+9*INTERVAL) { - // HUSH should never hit the 9th halving, but yolo - commission = starting_commission / 512; } // enforce the end of FR when BR ends diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 079ce1eea..b014afa32 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1570,96 +1570,39 @@ uint64_t komodo_max_money() uint64_t komodo_ac_block_subsidy(int nHeight) { - // we have to find our era, start from beginning reward, and determine current subsidy - int64_t numerator, denominator, subsidy = 0; - int64_t subsidyDifference; - int32_t numhalvings, curEra = 0, sign = 1; - static uint64_t cached_subsidy; static int32_t cached_numhalvings; static int cached_era; - - // check for backwards compat, older chains with no explicit rewards had 0.0001 block reward - if ( ASSETCHAINS_ENDSUBSIDY[0] == 0 && ASSETCHAINS_REWARD[0] == 0 ) - subsidy = 10000; - else if ( (ASSETCHAINS_ENDSUBSIDY[0] == 0 && ASSETCHAINS_REWARD[0] != 0) || ASSETCHAINS_ENDSUBSIDY[0] != 0 ) - { - // if we have an end block in the first era, find our current era - if ( ASSETCHAINS_ENDSUBSIDY[0] != 0 ) - { - for ( curEra = 0; curEra <= ASSETCHAINS_LASTERA; curEra++ ) - { - if ( ASSETCHAINS_ENDSUBSIDY[curEra] > nHeight || ASSETCHAINS_ENDSUBSIDY[curEra] == 0 ) - break; - } - } - if ( curEra <= ASSETCHAINS_LASTERA ) - { - int64_t nStart = curEra ? ASSETCHAINS_ENDSUBSIDY[curEra - 1] : 0; - subsidy = (int64_t)ASSETCHAINS_REWARD[curEra]; - if ( subsidy || (curEra != ASSETCHAINS_LASTERA && ASSETCHAINS_REWARD[curEra + 1] != 0) ) - { - if ( ASSETCHAINS_HALVING[curEra] != 0 ) - { - if ( (numhalvings = ((nHeight - nStart) / ASSETCHAINS_HALVING[curEra])) > 0 ) - { - if ( ASSETCHAINS_DECAY[curEra] == 0 ) - subsidy >>= numhalvings; - else if ( ASSETCHAINS_DECAY[curEra] == 100000000 && ASSETCHAINS_ENDSUBSIDY[curEra] != 0 ) - { - if ( curEra == ASSETCHAINS_LASTERA ) - { - subsidyDifference = subsidy; - } - 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 = subsidy - ASSETCHAINS_REWARD[curEra + 1]; - if (subsidyDifference < 0) - { - sign = -1; - subsidyDifference *= sign; - } - } - denominator = ASSETCHAINS_ENDSUBSIDY[curEra] - nStart; - numerator = denominator - ((ASSETCHAINS_ENDSUBSIDY[curEra] - nHeight) + ((nHeight - nStart) % ASSETCHAINS_HALVING[curEra])); - subsidy = subsidy - sign * ((subsidyDifference * numerator) / denominator); - } - else - { - if ( cached_subsidy > 0 && cached_era == curEra && cached_numhalvings == numhalvings ) - subsidy = cached_subsidy; - else - { - for (int i=0; i < numhalvings && subsidy != 0; i++) - subsidy = (subsidy * ASSETCHAINS_DECAY[curEra]) / 100000000; - cached_subsidy = subsidy; - cached_numhalvings = numhalvings; - cached_era = curEra; - } - } - } - } - } - } - } uint32_t magicExtra = ASSETCHAINS_STAKED ? ASSETCHAINS_MAGIC : (ASSETCHAINS_MAGIC & 0xffffff); - if ( ASSETCHAINS_SUPPLY > 10000000000 ) // over 10 billion? - { - if ( nHeight <= ASSETCHAINS_SUPPLY/1000000000 ) - { - subsidy += (uint64_t)1000000000 * COIN; - if ( nHeight == 1 ) - subsidy += (ASSETCHAINS_SUPPLY % 1000000000)*COIN + magicExtra; - } + //TODO: unify with values in komodo_bitcoind.h + int64_t subsidy = 0, starting_subsidy = 1125000000, HALVING1 = 34, INTERVAL = 84, TRANSITION = 29, BR_END = 500; + + if ( nHeight == 1 ) { + subsidy = ASSETCHAINS_SUPPLY * SATOSHIDEN + magicExtra; + } else if (nHeight < TRANSITION) { + subsidy = 0; + } else if (nHeight < HALVING1) { + subsidy = starting_subsidy; + } else if (nHeight < HALVING1+1*INTERVAL) { + subsidy = starting_subsidy / 2; + } else if (nHeight < HALVING1+2*INTERVAL) { + subsidy = starting_subsidy / 4; + } else if (nHeight < HALVING1+3*INTERVAL) { + subsidy = starting_subsidy / 8; + } else if (nHeight < HALVING1+4*INTERVAL) { + subsidy = starting_subsidy / 16; + } else if (nHeight < HALVING1+5*INTERVAL) { + subsidy = starting_subsidy / 32; + } else if (nHeight < HALVING1+6*INTERVAL) { + subsidy = starting_subsidy / 64; + } else if (nHeight < HALVING1+7*INTERVAL) { + subsidy = starting_subsidy / 128; + } else if (nHeight < HALVING1+8*INTERVAL) { + subsidy = starting_subsidy / 256; } - else if ( nHeight == 1 ) - { - if ( ASSETCHAINS_LASTERA == 0 ) - subsidy = ASSETCHAINS_SUPPLY * SATOSHIDEN + magicExtra; - else - subsidy += ASSETCHAINS_SUPPLY * SATOSHIDEN + magicExtra; + + // enforce the end of subsidy + if (nHeight > BR_END) { + subsidy = 0; } - else if ( is_STAKED(ASSETCHAINS_SYMBOL) == 2 ) - return(0); - // LABS fungible chains, cannot have any block reward! + return(subsidy); } From 7846f5fb35db753ece89b4851a2206c6488c1dfb Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Fri, 12 Apr 2019 20:23:11 -0700 Subject: [PATCH 13/17] T5 --- src/hush-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hush-cli b/src/hush-cli index a7e9c4f69..60e6d1976 100755 --- a/src/hush-cli +++ b/src/hush-cli @@ -5,6 +5,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR -NAME=HUSHT4 +NAME=HUSHT5 ./komodo-cli -ac_name=$NAME "$@" From 8d52fd6a587484a353b6dfaef21f24f1e4de508d Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sat, 13 Apr 2019 05:47:45 +0200 Subject: [PATCH 14/17] add back perc --- src/hushd-testnet | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hushd-testnet b/src/hushd-testnet index 954001363..4ac7bfdc6 100755 --- a/src/hushd-testnet +++ b/src/hushd-testnet @@ -15,6 +15,7 @@ BLOCKTIME=10 SUPPLY=6250000 FOUNDERS=1 CLIENTNAME=GoldenSandtrout +PERC=11111111 # CryptoConditions/Custom Consensus params FAUCET=228 @@ -28,6 +29,7 @@ CCENABLE=$FAUCET,$HEIR,$CHANNEL,$ORACLE,$GATEWAY KMD=${KOMODOD:-./komodod} $KMD -ac_name=$NAME -ac_sapling=1 \ -ac_blocktime=$BLOCKTIME \ + -ac_perc=$PERC \ -ac_cc=2 -ac_ccenable=$CCENABLE \ -ac_founders=$FOUNDERS -ac_supply=$SUPPLY \ -clientname=$CLIENTNAME \ From 7e8d7d55398178cd88239b7fea349c74f781d2f4 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sat, 13 Apr 2019 02:55:07 -0700 Subject: [PATCH 15/17] Going back to simpler things that work --- src/hushd-testnet | 10 ++++++++++ src/komodo_bitcoind.h | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hushd-testnet b/src/hushd-testnet index 954001363..2214dea99 100755 --- a/src/hushd-testnet +++ b/src/hushd-testnet @@ -11,9 +11,14 @@ NAME=HUSHT5 SCRIPT=76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac # Chain parameters +ERAS=3 BLOCKTIME=10 SUPPLY=6250000 FOUNDERS=1 +REWARD=0,1125000000,562500000 +HALVING=29,34,84 +END=28,34,500 +PERC=11111111 CLIENTNAME=GoldenSandtrout # CryptoConditions/Custom Consensus params @@ -27,6 +32,11 @@ CCENABLE=$FAUCET,$HEIR,$CHANNEL,$ORACLE,$GATEWAY KMD=${KOMODOD:-./komodod} $KMD -ac_name=$NAME -ac_sapling=1 \ + -ac_halving=$HALVING \ + -ac_eras=$ERAS \ + -ac_perc=$PERC \ + -ac_end=$END \ + -ac_reward=$REWARD \ -ac_blocktime=$BLOCKTIME \ -ac_cc=2 -ac_ccenable=$CCENABLE \ -ac_founders=$FOUNDERS -ac_supply=$SUPPLY \ diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 5bde4a773..ef0450f16 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1224,7 +1224,6 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it manually // 10% of 12.5 is 1.25 but to tell the AC params, I need to say "11% of 11.25" is 1.25 // 11% ie. 1/9th cannot be exactly represented and so the FR has tiny amounts of error unless done manually - // Transition period of 128 blocks has BR=FR=0 if (height < TRANSITION) { commission = 0; From 7bba0ef046d61a56673b4be1805c722671f76e1e Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sat, 13 Apr 2019 03:02:22 -0700 Subject: [PATCH 16/17] Let us go back to simpler times when things worked --- src/hushd-testnet | 9 ++-- src/komodo_bitcoind.h | 11 ++-- src/komodo_utils.h | 117 +++++++++++++++++++++++++++++++----------- 3 files changed, 96 insertions(+), 41 deletions(-) diff --git a/src/hushd-testnet b/src/hushd-testnet index 2214dea99..e9fec162a 100755 --- a/src/hushd-testnet +++ b/src/hushd-testnet @@ -27,18 +27,17 @@ HEIR=234 CHANNEL=235 ORACLE=236 GATEWAY=241 -DILITHIUM= CCENABLE=$FAUCET,$HEIR,$CHANNEL,$ORACLE,$GATEWAY KMD=${KOMODOD:-./komodod} $KMD -ac_name=$NAME -ac_sapling=1 \ - -ac_halving=$HALVING \ - -ac_eras=$ERAS \ - -ac_perc=$PERC \ - -ac_end=$END \ -ac_reward=$REWARD \ + -ac_halving=$HALVING \ + -ac_end=$END \ + -ac_eras=$ERAS \ -ac_blocktime=$BLOCKTIME \ -ac_cc=2 -ac_ccenable=$CCENABLE \ -ac_founders=$FOUNDERS -ac_supply=$SUPPLY \ + -ac_perc=$PERC \ -clientname=$CLIENTNAME \ -ac_script=$SCRIPT "$@" diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index ef0450f16..bf74e0b88 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1221,8 +1221,9 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) fprintf(stderr,"ORIG ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT5") != 0)) { - // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it manually - // 10% of 12.5 is 1.25 but to tell the AC params, I need to say "11% of 11.25" is 1.25 + // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it ourselves. + // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 + // but to tell the AC params, I need to say "11% of 11.25" is 1.25 // 11% ie. 1/9th cannot be exactly represented and so the FR has tiny amounts of error unless done manually // Transition period of 128 blocks has BR=FR=0 if (height < TRANSITION) { @@ -1242,10 +1243,8 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) } else if (height < HALVING1+6*INTERVAL) { // Block 5380000 // Block reward will go to zero between 7th+8th halvings commission = starting_commission / 64; - } else if (height < HALVING1+7*INTERVAL) { // Block 6220000 - commission = starting_commission / 128; - } else if (height < HALVING1+8*INTERVAL) { // Block 7060000 - commission = starting_commission / 256; + } else if (height < HALVING1+7*INTERVAL) { + commission = starting_commission / 128; // Block 6220000 } // enforce the end of FR when BR ends diff --git a/src/komodo_utils.h b/src/komodo_utils.h index b014afa32..079ce1eea 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1570,39 +1570,96 @@ uint64_t komodo_max_money() uint64_t komodo_ac_block_subsidy(int nHeight) { + // we have to find our era, start from beginning reward, and determine current subsidy + int64_t numerator, denominator, subsidy = 0; + int64_t subsidyDifference; + int32_t numhalvings, curEra = 0, sign = 1; + static uint64_t cached_subsidy; static int32_t cached_numhalvings; static int cached_era; + + // check for backwards compat, older chains with no explicit rewards had 0.0001 block reward + if ( ASSETCHAINS_ENDSUBSIDY[0] == 0 && ASSETCHAINS_REWARD[0] == 0 ) + subsidy = 10000; + else if ( (ASSETCHAINS_ENDSUBSIDY[0] == 0 && ASSETCHAINS_REWARD[0] != 0) || ASSETCHAINS_ENDSUBSIDY[0] != 0 ) + { + // if we have an end block in the first era, find our current era + if ( ASSETCHAINS_ENDSUBSIDY[0] != 0 ) + { + for ( curEra = 0; curEra <= ASSETCHAINS_LASTERA; curEra++ ) + { + if ( ASSETCHAINS_ENDSUBSIDY[curEra] > nHeight || ASSETCHAINS_ENDSUBSIDY[curEra] == 0 ) + break; + } + } + if ( curEra <= ASSETCHAINS_LASTERA ) + { + int64_t nStart = curEra ? ASSETCHAINS_ENDSUBSIDY[curEra - 1] : 0; + subsidy = (int64_t)ASSETCHAINS_REWARD[curEra]; + if ( subsidy || (curEra != ASSETCHAINS_LASTERA && ASSETCHAINS_REWARD[curEra + 1] != 0) ) + { + if ( ASSETCHAINS_HALVING[curEra] != 0 ) + { + if ( (numhalvings = ((nHeight - nStart) / ASSETCHAINS_HALVING[curEra])) > 0 ) + { + if ( ASSETCHAINS_DECAY[curEra] == 0 ) + subsidy >>= numhalvings; + else if ( ASSETCHAINS_DECAY[curEra] == 100000000 && ASSETCHAINS_ENDSUBSIDY[curEra] != 0 ) + { + if ( curEra == ASSETCHAINS_LASTERA ) + { + subsidyDifference = subsidy; + } + 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 = subsidy - ASSETCHAINS_REWARD[curEra + 1]; + if (subsidyDifference < 0) + { + sign = -1; + subsidyDifference *= sign; + } + } + denominator = ASSETCHAINS_ENDSUBSIDY[curEra] - nStart; + numerator = denominator - ((ASSETCHAINS_ENDSUBSIDY[curEra] - nHeight) + ((nHeight - nStart) % ASSETCHAINS_HALVING[curEra])); + subsidy = subsidy - sign * ((subsidyDifference * numerator) / denominator); + } + else + { + if ( cached_subsidy > 0 && cached_era == curEra && cached_numhalvings == numhalvings ) + subsidy = cached_subsidy; + else + { + for (int i=0; i < numhalvings && subsidy != 0; i++) + subsidy = (subsidy * ASSETCHAINS_DECAY[curEra]) / 100000000; + cached_subsidy = subsidy; + cached_numhalvings = numhalvings; + cached_era = curEra; + } + } + } + } + } + } + } uint32_t magicExtra = ASSETCHAINS_STAKED ? ASSETCHAINS_MAGIC : (ASSETCHAINS_MAGIC & 0xffffff); - //TODO: unify with values in komodo_bitcoind.h - int64_t subsidy = 0, starting_subsidy = 1125000000, HALVING1 = 34, INTERVAL = 84, TRANSITION = 29, BR_END = 500; - - if ( nHeight == 1 ) { - subsidy = ASSETCHAINS_SUPPLY * SATOSHIDEN + magicExtra; - } else if (nHeight < TRANSITION) { - subsidy = 0; - } else if (nHeight < HALVING1) { - subsidy = starting_subsidy; - } else if (nHeight < HALVING1+1*INTERVAL) { - subsidy = starting_subsidy / 2; - } else if (nHeight < HALVING1+2*INTERVAL) { - subsidy = starting_subsidy / 4; - } else if (nHeight < HALVING1+3*INTERVAL) { - subsidy = starting_subsidy / 8; - } else if (nHeight < HALVING1+4*INTERVAL) { - subsidy = starting_subsidy / 16; - } else if (nHeight < HALVING1+5*INTERVAL) { - subsidy = starting_subsidy / 32; - } else if (nHeight < HALVING1+6*INTERVAL) { - subsidy = starting_subsidy / 64; - } else if (nHeight < HALVING1+7*INTERVAL) { - subsidy = starting_subsidy / 128; - } else if (nHeight < HALVING1+8*INTERVAL) { - subsidy = starting_subsidy / 256; + if ( ASSETCHAINS_SUPPLY > 10000000000 ) // over 10 billion? + { + if ( nHeight <= ASSETCHAINS_SUPPLY/1000000000 ) + { + subsidy += (uint64_t)1000000000 * COIN; + if ( nHeight == 1 ) + subsidy += (ASSETCHAINS_SUPPLY % 1000000000)*COIN + magicExtra; + } } - - // enforce the end of subsidy - if (nHeight > BR_END) { - subsidy = 0; + else if ( nHeight == 1 ) + { + if ( ASSETCHAINS_LASTERA == 0 ) + subsidy = ASSETCHAINS_SUPPLY * SATOSHIDEN + magicExtra; + else + subsidy += ASSETCHAINS_SUPPLY * SATOSHIDEN + magicExtra; } - + else if ( is_STAKED(ASSETCHAINS_SYMBOL) == 2 ) + return(0); + // LABS fungible chains, cannot have any block reward! return(subsidy); } From 6c438dff914d17a7a457da7d1fbb2f07510c3da0 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sat, 13 Apr 2019 03:03:56 -0700 Subject: [PATCH 17/17] HUSHT6 --- src/hush-cli | 2 +- src/hushd-testnet | 2 +- src/komodo_bitcoind.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hush-cli b/src/hush-cli index 60e6d1976..7310ac1fd 100755 --- a/src/hush-cli +++ b/src/hush-cli @@ -5,6 +5,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR -NAME=HUSHT5 +NAME=HUSHT6 ./komodo-cli -ac_name=$NAME "$@" diff --git a/src/hushd-testnet b/src/hushd-testnet index aa123cb90..b3d9bdf17 100755 --- a/src/hushd-testnet +++ b/src/hushd-testnet @@ -6,7 +6,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR # TESTING VALUES, DO NOT USE EXCEPT FOR DEVELOPMENT -NAME=HUSHT5 +NAME=HUSHT6 # this corresponds to FR address RHushEyeDm7XwtaTWtyCbjGQumYyV8vMjn SCRIPT=76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index bf74e0b88..2c850ac3c 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1220,7 +1220,7 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN); fprintf(stderr,"ORIG ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION)); - if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT5") != 0)) { + if ((strcmp(ASSETCHAINS_SYMBOL, "HUSH") != 0) || (strcmp(ASSETCHAINS_SYMBOL, "HUSHT6") != 0)) { // HUSH supply curve cannot be exactly represented via KMD AC CLI args, so we do it ourselves. // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 // but to tell the AC params, I need to say "11% of 11.25" is 1.25