From f107021869266f1f4481be05c42c2c45c0b612b1 Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Mon, 9 Sep 2024 12:03:33 +0200 Subject: [PATCH 1/2] fix: discountct package mining --- src/node/miner.h | 1 + test/functional/feature_discount_ct.py | 57 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/src/node/miner.h b/src/node/miner.h index 45a9494e06..b0b48e375a 100644 --- a/src/node/miner.h +++ b/src/node/miner.h @@ -129,6 +129,7 @@ struct update_for_parent_inclusion { e.nModFeesWithAncestors -= iter->GetFee(); e.nSizeWithAncestors -= iter->GetTxSize(); + e.discountSizeWithAncestors -= iter->GetDiscountTxSize(); e.nSigOpCostWithAncestors -= iter->GetSigOpCost(); } diff --git a/test/functional/feature_discount_ct.py b/test/functional/feature_discount_ct.py index b9e727db59..b0b43361e6 100755 --- a/test/functional/feature_discount_ct.py +++ b/test/functional/feature_discount_ct.py @@ -19,6 +19,7 @@ def set_test_params(self): "-con_connect_genesis_outputs=1", "-initialfreecoins=2100000000000000", "-txindex=1", + "-blindedaddresses=1", "-minrelaytxfee=0.00000100", "-blockmintxfee=0.00000100", "-fallbackfee=0.00000100", @@ -184,6 +185,62 @@ def run_test(self): tx = node0.getrawtransaction(txid, True) assert_equal(tx['vsize'], 2575) + # check transaction package + self.log.info("Create discounted package") + addr = node1.getnewaddress() + addr2 = node1.getnewaddress() + utxo = node1.listunspent()[0] + fee = Decimal('0.00000035') + inputs = [{"txid": utxo["txid"], "vout": utxo["vout"]}] + change = Decimal('0.00001000') + amount = utxo["amount"] - change - fee + outputs = [ + {addr: amount}, + {addr2: change}, + {"fee": fee} + ] + raw = node1.createrawtransaction(inputs, outputs) + blind = node1.blindrawtransaction(raw, False) + signed = node1.signrawtransactionwithwallet(blind) + assert_equal(signed["complete"], True) + test = node1.testmempoolaccept([signed['hex']]) + assert_equal(test[0]["allowed"], True) + txid = node1.sendrawtransaction(signed['hex']) + tx = node1.gettransaction(txid, True, True) + assert_equal(tx['decoded']['discountvsize'], 341) + + for i in range(24): + self.log.info(f"Add package descendant {i+1}") + addr = node1.getnewaddress() + addr2 = node1.getnewaddress() + fee = Decimal('0.00000035') + change = Decimal('0.00001000') + inputs = [{"txid": txid, "vout": 0}] + amount -= change + fee + outputs = [ + {addr: amount}, + {addr2: change}, + {"fee": fee} + ] + raw = node1.createrawtransaction(inputs, outputs) + blind = node1.blindrawtransaction(raw, False) + signed = node1.signrawtransactionwithwallet(blind) + assert_equal(signed["complete"], True) + hex = signed["hex"] + test = node1.testmempoolaccept([hex]) + assert_equal(test[0]["allowed"], True) + txid = node1.sendrawtransaction(hex) + tx = node1.gettransaction(txid, True, True) + assert_equal(tx['decoded']['discountvsize'], 341) + assert_equal(len(node1.getrawmempool()), i + 2) + + assert_equal(len(node1.getrawmempool()), 25) + self.log.info("Mine the package") + self.generate(node1, 1, sync_fun=self.sync_blocks) + assert_equal(len(node1.getrawmempool()), 0) + tx = node1.gettransaction(txid, True, True) + assert_equal(tx["confirmations"], 1) + self.log.info("Success") if __name__ == '__main__': CTTest().main() From 4b22137159d9b6590e9037a65858ff68dc39cb18 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Mon, 9 Sep 2024 09:44:53 -0700 Subject: [PATCH 2/2] Bump version to 23.2.3rc2 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 67345e8095..b158dcfbbe 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.69]) define(_CLIENT_VERSION_MAJOR, 23) define(_CLIENT_VERSION_MINOR, 2) define(_CLIENT_VERSION_BUILD, 3) -define(_CLIENT_VERSION_RC, 1) +define(_CLIENT_VERSION_RC, 2) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2024) define(_COPYRIGHT_HOLDERS,[The %s developers])