signet-generate
Closed this issue · 1 comments
Saibato commented
tACK the signet-genrate tree btw the commit b59ad98 had to be reversed patched
With this patch it worked,
the commitment had to stay a double hash to pass merkle tree verification in the client.
diff --git a/contrib/signet/miner b/contrib/signet/miner
index e8c412572..c141f2d97 100755
--- a/contrib/signet/miner
+++ b/contrib/signet/miner
@@ -23,7 +23,7 @@ PATH_BASE_TEST_FUNCTIONAL = os.path.join(PATH_BASE_CONTRIB_SIGNET, "..", "..", "
sys.path.insert(0, PATH_BASE_TEST_FUNCTIONAL)
from test_framework.blocktools import WITNESS_COMMITMENT_HEADER, script_BIP34_coinbase_height # noqa: E402
-from test_framework.messages import CBlock, CBlockHeader, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, FromHex, ToHex, deser_string, sha256, ser_compact_size, ser_string, ser_uint256, uint256_from_str # noqa: E402
+from test_framework.messages import CBlock, CBlockHeader, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, FromHex, ToHex, deser_string, hash256, sha256, ser_compact_size, ser_string, ser_uint256, uint256_from_str # noqa: E402
from test_framework.script import CScriptOp # noqa: E402
logging.basicConfig(
@@ -125,7 +125,7 @@ def create_coinbase(height, value, spk):
return cb
def get_witness_script(witness_root, witness_nonce):
- commitment = uint256_from_str(sha256(ser_uint256(witness_root) + ser_uint256(witness_nonce)))
+ commitment = uint256_from_str(hash256(ser_uint256(witness_root) + ser_uint256(witness_nonce)))
return b"\x6a" + CScriptOp.encode_op_pushdata(WITNESS_COMMITMENT_HEADER + ser_uint256(commitment))
def signet_txs(block, challenge):
@@ -491,6 +491,7 @@ def do_generate(args):
logging.debug("Mining block delta=%s start=%s mine=%s", seconds_to_hms(mine_time-bestheader["time"]), mine_time, is_mine)
mined_blocks += 1
psbt = generate_psbt(tmpl, reward_spk, blocktime=mine_time)