Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/bench/block_assemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static void AssembleBlock(benchmark::Bench& bench)
witness.stack.push_back(WITNESS_STACK_ELEM_OP_TRUE);
BlockAssembler::Options options;
options.coinbase_output_script = P2WSH_OP_TRUE;
options.include_dummy_extranonce = true;

// Collect some loose transactions that spend the coinbases of our mined blocks
constexpr size_t NUM_BLOCKS{200};
Expand Down
8 changes: 4 additions & 4 deletions src/kernel/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,9 @@ class CRegTestParams : public CChainParams
m_assumeutxo_data = {
{ // For use by unit tests
.height = 110,
.hash_serialized = AssumeutxoHash{uint256{"b952555c8ab81fec46f3d4253b7af256d766ceb39fb7752b9d18cdf4a0141327"}},
.hash_serialized = AssumeutxoHash{uint256{"86e9a1205b418b16dde3a18a78c730e30137e28466bda5dbf6b33ab8fc05447c"}},
.m_chain_tx_count = 111,
.blockhash = uint256{"6affe030b7965ab538f820a56ef56c8149b7dc1d1c144af57113be080db7c397"},
.blockhash = uint256{"135eec25a6fb277884e5824e7aa7d052c4868161c99a5122170b5266f86c273d"},
},
{
// For use by fuzz target src/test/fuzz/utxo_snapshot.cpp
Expand All @@ -660,9 +660,9 @@ class CRegTestParams : public CChainParams
{
// For use by test/functional/feature_assumeutxo.py and test/functional/tool_bitcoin_chainstate.py
.height = 299,
.hash_serialized = AssumeutxoHash{uint256{"d2b051ff5e8eef46520350776f4100dd710a63447a8e01d917e92e79751a63e2"}},
.hash_serialized = AssumeutxoHash{uint256{"106b2c56233e378a824cf0d5ff2be42ed32c72f1605c9be288d00942908a40ac"}},
.m_chain_tx_count = 334,
.blockhash = uint256{"7cc695046fec709f8c9394b6f928f81e81fd3ac20977bb68760fa1faa7916ea2"},
.blockhash = uint256{"0c552ced4721c249a389eb9b08cb8da261cd46f0e7b5f9d064d48f3113406853"},
},
};

Expand Down
13 changes: 8 additions & 5 deletions src/node/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,18 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock()
// increasing its length would reduce the space they can use and may break
// existing clients.
coinbaseTx.vin[0].scriptSig = CScript() << nHeight;
if (m_options.include_dummy_extranonce) {
// Set script_sig_prefix here, so IPC mining clients are not affected by
// the optional scriptSig padding below. They provide their own extraNonce,
// and in a typical setup a pool name or realistic extraNonce already makes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "mining: always set dummy_extranonce at low heights" (d6f9ab4):

The comment says "in a typical setup a pool name or realistic extraNonce already makes the scriptSig long enough" but this puts the responsibility entirely on the client at heights ≤ 16. I tested this by removing the extra nonce in run_low_height_test() and it causes submitSolution() to silently return False with no explanation. Should we at minimum document in the code or the IPC interface that at heights ≤ 16 the client must provide at least 1 byte of extra nonce?

// the scriptSig long enough.
coinbase_tx.script_sig_prefix = coinbaseTx.vin[0].scriptSig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "mining: always set dummy_extranonce at low heights" (d6f9ab4):

At heights ≤ 16, getBlock() and getCoinbaseTx() return different scriptSig data since script_sig_prefix is snapshotted here before the OP_0 padding is added. I verified this in the test. getBlock() returns 5100 ([OP_1, OP_0]) while scriptSigPrefix returns 51 ([OP_1] only). Would an IPC client comparing both would be confused? Should this discrepancy be documented in the IPC interface or the code?

if (nHeight <= 16) {
// For blocks at heights <= 16, the BIP34-encoded height alone is only
// one byte. Consensus requires coinbase scriptSigs to be at least two
// bytes long (bad-cb-length), so tests and regtest include a dummy
// extraNonce (OP_0)
// bytes long (bad-cb-length), so an OP_0 is always appended at those
// heights.
coinbaseTx.vin[0].scriptSig << OP_0;
}
coinbase_tx.script_sig_prefix = coinbaseTx.vin[0].scriptSig;
Assert(nHeight > 0);
coinbaseTx.nLockTime = static_cast<uint32_t>(nHeight - 1);
coinbase_tx.lock_time = coinbaseTx.nLockTime;
Expand Down Expand Up @@ -221,7 +225,6 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock()
pblock->nNonce = 0;

if (m_options.test_block_validity) {
// if nHeight <= 16, and include_dummy_extranonce=false this will fail due to bad-cb-length.
if (BlockValidationState state{TestBlockValidity(m_chainstate, *pblock, /*check_pow=*/false, /*check_merkle_root=*/false)}; !state.IsValid()) {
throw std::runtime_error(strprintf("TestBlockValidity failed: %s", state.ToString()));
}
Expand Down
4 changes: 0 additions & 4 deletions src/node/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ struct BlockCreateOptions {
* coinbase_max_additional_weight and coinbase_output_max_additional_sigops.
*/
CScript coinbase_output_script{CScript() << OP_TRUE};
/**
* Whether to include an OP_0 as a dummy extraNonce in the template's coinbase
*/
bool include_dummy_extranonce{false};
};

struct BlockWaitOptions {
Expand Down
6 changes: 3 additions & 3 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static UniValue generateBlocks(ChainstateManager& chainman, Mining& miner, const
{
UniValue blockHashes(UniValue::VARR);
while (nGenerate > 0 && !chainman.m_interrupt) {
std::unique_ptr<BlockTemplate> block_template(miner.createNewBlock({ .coinbase_output_script = coinbase_output_script, .include_dummy_extranonce = true }, /*cooldown=*/false));
std::unique_ptr<BlockTemplate> block_template(miner.createNewBlock({ .coinbase_output_script = coinbase_output_script }, /*cooldown=*/false));
CHECK_NONFATAL(block_template);

std::shared_ptr<const CBlock> block_out;
Expand Down Expand Up @@ -376,7 +376,7 @@ static RPCHelpMan generateblock()
{
LOCK(chainman.GetMutex());
{
std::unique_ptr<BlockTemplate> block_template{miner.createNewBlock({.use_mempool = false, .coinbase_output_script = coinbase_output_script, .include_dummy_extranonce = true}, /*cooldown=*/false)};
std::unique_ptr<BlockTemplate> block_template{miner.createNewBlock({.use_mempool = false, .coinbase_output_script = coinbase_output_script}, /*cooldown=*/false)};
CHECK_NONFATAL(block_template);

block = block_template->getBlock();
Expand Down Expand Up @@ -874,7 +874,7 @@ static RPCHelpMan getblocktemplate()
// a delay to each getblocktemplate call. This differs from typical
// long-lived IPC usage, where the overhead is paid only when creating
// the initial template.
block_template = miner.createNewBlock({.include_dummy_extranonce = true}, /*cooldown=*/false);
block_template = miner.createNewBlock({}, /*cooldown=*/false);
CHECK_NONFATAL(block_template);


Expand Down
1 change: 0 additions & 1 deletion src/test/blockfilter_index_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ CBlock BuildChainTestingSetup::CreateBlock(const CBlockIndex* prev,
{
BlockAssembler::Options options;
options.coinbase_output_script = scriptPubKey;
options.include_dummy_extranonce = true;
std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler{m_node.chainman->ActiveChainstate(), m_node.mempool.get(), options}.CreateNewBlock();
CBlock& block = pblocktemplate->block;
block.hashPrevBlock = prev->GetBlockHash();
Expand Down
1 change: 0 additions & 1 deletion src/test/fuzz/package_eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ void initialize_tx_pool()

BlockAssembler::Options options;
options.coinbase_output_script = P2WSH_EMPTY;
options.include_dummy_extranonce = true;

for (int i = 0; i < 2 * COINBASE_MATURITY; ++i) {
COutPoint prevout{MineBlock(g_setup->m_node, options)};
Expand Down
1 change: 0 additions & 1 deletion src/test/fuzz/process_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void ResetChainman(TestingSetup& setup)
setup.LoadVerifyActivateChainstate();
for (int i = 0; i < 2 * COINBASE_MATURITY; i++) {
node::BlockAssembler::Options options;
options.include_dummy_extranonce = true;
MineBlock(setup.m_node, options);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/test/fuzz/process_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ void ResetChainman(TestingSetup& setup)
setup.m_make_chainman();
setup.LoadVerifyActivateChainstate();
node::BlockAssembler::Options options;
options.include_dummy_extranonce = true;
for (int i = 0; i < 2 * COINBASE_MATURITY; i++) {
MineBlock(setup.m_node, options);
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/fuzz/tx_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ void initialize_tx_pool()

BlockAssembler::Options options;
options.coinbase_output_script = P2WSH_OP_TRUE;
options.include_dummy_extranonce = true;

for (int i = 0; i < 2 * COINBASE_MATURITY; ++i) {
COutPoint prevout{MineBlock(g_setup->m_node, options)};
Expand Down Expand Up @@ -98,7 +97,6 @@ void Finish(FuzzedDataProvider& fuzzed_data_provider, MockedTxPool& tx_pool, Cha
BlockAssembler::Options options;
options.nBlockMaxWeight = fuzzed_data_provider.ConsumeIntegralInRange(0U, MAX_BLOCK_WEIGHT);
options.blockMinFeeRate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
options.include_dummy_extranonce = true;
auto assembler = BlockAssembler{chainstate, &tx_pool, options};
auto block_template = assembler.CreateNewBlock();
Assert(block_template->block.vtx.size() >= 1);
Expand Down
10 changes: 7 additions & 3 deletions src/test/fuzz/utxo_total_supply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ FUZZ_TARGET(utxo_total_supply)
};
BlockAssembler::Options options;
options.coinbase_output_script = CScript() << OP_FALSE;
options.include_dummy_extranonce = true;
const auto PrepareNextBlock = [&]() {
// Use OP_FALSE to avoid BIP30 check from hitting early
auto block = PrepareBlock(node, options);
Expand Down Expand Up @@ -107,8 +106,13 @@ FUZZ_TARGET(utxo_total_supply)
// Assuming that the fuzzer will mine relatively short chains (less than 200 blocks), we want the duplicate coinbase to be not too high.
// Up to 300 seems reasonable.
int64_t duplicate_coinbase_height = fuzzed_data_provider.ConsumeIntegralInRange(0, 300);
// Always pad with OP_0 at the end to avoid bad-cb-length error
const CScript duplicate_coinbase_script = CScript() << duplicate_coinbase_height << OP_0;
// Build the scriptSig exactly as CreateNewBlock does for the given height:
// BIP34-encoded height, plus OP_0 padding at heights <= 16 to satisfy
// the minimum 2-byte coinbase scriptSig length (bad-cb-length).
CScript duplicate_coinbase_script = CScript() << duplicate_coinbase_height;
if (duplicate_coinbase_height <= 16) {
duplicate_coinbase_script << OP_0;
}
// Mine the first block with this duplicate
current_block = PrepareNextBlock();
StoreLastTxo();
Expand Down
4 changes: 0 additions & 4 deletions src/test/miner_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ void MinerTestingSetup::TestPackageSelection(const CScript& scriptPubKey, const
auto mining{MakeMining()};
BlockAssembler::Options options;
options.coinbase_output_script = scriptPubKey;
options.include_dummy_extranonce = true;

LOCK(tx_mempool.cs);
BOOST_CHECK(tx_mempool.size() == 0);
Expand Down Expand Up @@ -336,7 +335,6 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::

BlockAssembler::Options options;
options.coinbase_output_script = scriptPubKey;
options.include_dummy_extranonce = true;

{
CTxMemPool& tx_mempool{MakeMempool()};
Expand Down Expand Up @@ -663,7 +661,6 @@ void MinerTestingSetup::TestPrioritisedMining(const CScript& scriptPubKey, const

BlockAssembler::Options options;
options.coinbase_output_script = scriptPubKey;
options.include_dummy_extranonce = true;

CTxMemPool& tx_mempool{MakeMempool()};
LOCK(tx_mempool.cs);
Expand Down Expand Up @@ -753,7 +750,6 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
CScript scriptPubKey = CScript() << "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f"_hex << OP_CHECKSIG;
BlockAssembler::Options options;
options.coinbase_output_script = scriptPubKey;
options.include_dummy_extranonce = true;

// Create and check a simple template
std::unique_ptr<BlockTemplate> block_template = mining->createNewBlock(options, /*cooldown=*/false);
Expand Down
1 change: 0 additions & 1 deletion src/test/peerman_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ static void mineBlock(const node::NodeContext& node, std::chrono::seconds block_
{
auto curr_time = GetTime<std::chrono::seconds>();
node::BlockAssembler::Options options;
options.include_dummy_extranonce = true;
SetMockTime(block_time); // update time so the block is created with it
CBlock block = node::BlockAssembler{node.chainman->ActiveChainstate(), nullptr, options}.CreateNewBlock()->block;
while (!CheckProofOfWork(block.GetHash(), block.nBits, node.chainman->GetConsensus())) ++block.nNonce;
Expand Down
1 change: 0 additions & 1 deletion src/test/testnet4_miner_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ BOOST_AUTO_TEST_CASE(MiningInterface)
BOOST_REQUIRE(mining);

BlockAssembler::Options options;
options.include_dummy_extranonce = true;
std::unique_ptr<BlockTemplate> block_template;

// Set node time a few minutes past the testnet4 genesis block
Expand Down
2 changes: 0 additions & 2 deletions src/test/util/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ COutPoint generatetoaddress(const NodeContext& node, const std::string& address)
assert(IsValidDestination(dest));
BlockAssembler::Options assembler_options;
assembler_options.coinbase_output_script = GetScriptForDestination(dest);
assembler_options.include_dummy_extranonce = true;

return MineBlock(node, assembler_options);
}
Expand Down Expand Up @@ -140,7 +139,6 @@ std::shared_ptr<CBlock> PrepareBlock(const NodeContext& node, const CScript& coi
{
BlockAssembler::Options assembler_options;
assembler_options.coinbase_output_script = coinbase_scriptPubKey;
assembler_options.include_dummy_extranonce = true;
ApplyArgsManOptions(*node.args, assembler_options);
return PrepareBlock(node, assembler_options);
}
3 changes: 1 addition & 2 deletions src/test/util/setup_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ TestChain100Setup::TestChain100Setup(
LOCK(::cs_main);
assert(
m_node.chainman->ActiveChain().Tip()->GetBlockHash().ToString() ==
"0c8c5f79505775a0f6aed6aca2350718ceb9c6f2c878667864d5c7a6d8ffa2a6");
"0ee6e270d6594249e548110619f7bd690695beb219b915da4a2e84e2b61ed60f");
}
}

Expand All @@ -413,7 +413,6 @@ CBlock TestChain100Setup::CreateBlock(
{
BlockAssembler::Options options;
options.coinbase_output_script = scriptPubKey;
options.include_dummy_extranonce = true;
CBlock block = BlockAssembler{chainstate, nullptr, options}.CreateNewBlock()->block;

Assert(block.vtx.size() == 1);
Expand Down
2 changes: 0 additions & 2 deletions src/test/validation_block_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ std::shared_ptr<CBlock> MinerTestingSetup::Block(const uint256& prev_hash)

BlockAssembler::Options options;
options.coinbase_output_script = CScript{} << i++ << OP_TRUE;
options.include_dummy_extranonce = true;
auto ptemplate = BlockAssembler{m_node.chainman->ActiveChainstate(), m_node.mempool.get(), options}.CreateNewBlock();
auto pblock = std::make_shared<CBlock>(ptemplate->block);
pblock->hashPrevBlock = prev_hash;
Expand Down Expand Up @@ -338,7 +337,6 @@ BOOST_AUTO_TEST_CASE(witness_commitment_index)
pubKey << 1 << OP_TRUE;
BlockAssembler::Options options;
options.coinbase_output_script = pubKey;
options.include_dummy_extranonce = true;
auto ptemplate = BlockAssembler{m_node.chainman->ActiveChainstate(), m_node.mempool.get(), options}.CreateNewBlock();
CBlock pblock = ptemplate->block;

Expand Down
6 changes: 3 additions & 3 deletions src/test/validation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ BOOST_AUTO_TEST_CASE(test_assumeutxo)
}

const auto out110 = *params->AssumeutxoForHeight(110);
BOOST_CHECK_EQUAL(out110.hash_serialized.ToString(), "b952555c8ab81fec46f3d4253b7af256d766ceb39fb7752b9d18cdf4a0141327");
BOOST_CHECK_EQUAL(out110.hash_serialized.ToString(), "86e9a1205b418b16dde3a18a78c730e30137e28466bda5dbf6b33ab8fc05447c");
BOOST_CHECK_EQUAL(out110.m_chain_tx_count, 111U);

const auto out110_2 = *params->AssumeutxoForBlockhash(uint256{"6affe030b7965ab538f820a56ef56c8149b7dc1d1c144af57113be080db7c397"});
BOOST_CHECK_EQUAL(out110_2.hash_serialized.ToString(), "b952555c8ab81fec46f3d4253b7af256d766ceb39fb7752b9d18cdf4a0141327");
const auto out110_2 = *params->AssumeutxoForBlockhash(uint256{"135eec25a6fb277884e5824e7aa7d052c4868161c99a5122170b5266f86c273d"});
BOOST_CHECK_EQUAL(out110_2.hash_serialized.ToString(), "86e9a1205b418b16dde3a18a78c730e30137e28466bda5dbf6b33ab8fc05447c");
BOOST_CHECK_EQUAL(out110_2.m_chain_tx_count, 111U);
}

Expand Down
20 changes: 10 additions & 10 deletions test/functional/feature_assumeutxo.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ def expected_error(msg):
self.log.info(" - snapshot file with alternated but parsable UTXO data results in different hash")
cases = [
# (content, offset, wrong_hash, custom_message)
[b"\xff" * 32, 0, "77874d48d932a5cb7a7f770696f5224ff05746fdcf732a58270b45da0f665934", None], # wrong outpoint hash
[(2).to_bytes(1, "little"), 32, None, "Bad snapshot format or truncated snapshot after deserializing 1 coins."], # wrong txid coins count
[b"\xff" * 32, 0, "43bb0fcc50f3789d50ce41891810bbc571d549a32e2bbaabfc036f73ae2a23f9", None], # wrong outpoint hash
[(2).to_bytes(1, "little"), 32, None, "Bad snapshot data after deserializing 2 coins."], # wrong txid coins count
[b"\xfd\xff\xff", 32, None, "Mismatch in coins count in snapshot metadata and actual snapshot data"], # txid coins count exceeds coins left
[b"\x01", 33, "9f562925721e4f97e6fde5b590dbfede51e2204a68639525062ad064545dd0ea", None], # wrong outpoint index
[b"\x82", 34, "161393f07f8ad71760b3910a914f677f2cb166e5bcf5354e50d46b78c0422d15", None], # wrong coin code VARINT
[b"\x80", 34, "e6fae191ef851554467b68acff01ca09ad0a2e48c9b3dfea46cf7d35a7fd0ad0", None], # another wrong coin code
[b"\x01", 33, "0b0e96fd9a556157a68d9e6fe6e2c7562169c730347565ce0725032f824bea34", None], # wrong outpoint index
[b"\x83", 34, "52084c732f760fbcfb804d854815a9145111e93d7c7f3f7bfcb0ade1ea4f6b99", None], # wrong coin code VARINT
[b"\x80", 34, "c1a1308fcf04cbb14fc777467eb5e98e77a921b66eac4ad47877d0b6ed7b15b1", None], # another wrong coin code
[b"\x84\x58", 34, None, "Bad snapshot data after deserializing 0 coins"], # wrong coin case with height 364 and coinbase 0
[
# compressed txout value + scriptpubkey
Expand All @@ -165,12 +165,12 @@ def expected_error(msg):
f.write(content)
f.write(valid_snapshot_contents[(5 + 2 + 4 + 32 + 8 + offset + len(content)):])

msg = custom_message if custom_message is not None else f"Bad snapshot content hash: expected d2b051ff5e8eef46520350776f4100dd710a63447a8e01d917e92e79751a63e2, got {wrong_hash}."
msg = custom_message if custom_message is not None else f"Bad snapshot content hash: expected 106b2c56233e378a824cf0d5ff2be42ed32c72f1605c9be288d00942908a40ac, got {wrong_hash}."
expected_error(msg)

def test_headers_not_synced(self, valid_snapshot_path):
for node in self.nodes[1:]:
msg = "Unable to load UTXO snapshot: The base block header (7cc695046fec709f8c9394b6f928f81e81fd3ac20977bb68760fa1faa7916ea2) must appear in the headers chain. Make sure all headers are syncing, and call loadtxoutset again."
msg = "Unable to load UTXO snapshot: The base block header (0c552ced4721c249a389eb9b08cb8da261cd46f0e7b5f9d064d48f3113406853) must appear in the headers chain. Make sure all headers are syncing, and call loadtxoutset again."
assert_raises_rpc_error(-32603, msg, node.loadtxoutset, valid_snapshot_path)

def test_invalid_chainstate_scenarios(self):
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_snapshot_block_invalidated(self, dump_output_path):
block_hash = node.getblockhash(height)
node.invalidateblock(block_hash)
assert_equal(node.getblockcount(), height - 1)
msg = "Unable to load UTXO snapshot: The base block header (7cc695046fec709f8c9394b6f928f81e81fd3ac20977bb68760fa1faa7916ea2) is part of an invalid chain."
msg = "Unable to load UTXO snapshot: The base block header (0c552ced4721c249a389eb9b08cb8da261cd46f0e7b5f9d064d48f3113406853) is part of an invalid chain."
assert_raises_rpc_error(-32603, msg, node.loadtxoutset, dump_output_path)
node.reconsiderblock(block_hash)

Expand Down Expand Up @@ -470,7 +470,7 @@ def run_test(self):
def check_dump_output(output):
assert_equal(
output['txoutset_hash'],
"d2b051ff5e8eef46520350776f4100dd710a63447a8e01d917e92e79751a63e2")
"106b2c56233e378a824cf0d5ff2be42ed32c72f1605c9be288d00942908a40ac")
assert_equal(output["nchaintx"], blocks[SNAPSHOT_BASE_HEIGHT].chain_tx)

check_dump_output(dump_output)
Expand Down Expand Up @@ -500,7 +500,7 @@ def check_dump_output(output):
dump_output4 = n0.dumptxoutset(path='utxos4.dat', rollback=prev_snap_height)
assert_equal(
dump_output4['txoutset_hash'],
"45ac2777b6ca96588210e2a4f14b602b41ec37b8b9370673048cc0af434a1ec8")
"147d1789e3e29a62e3e15b80078b50603afb5e1e70ea07001c94666afbde38df")
assert_not_equal(sha256sum_file(dump_output['path']), sha256sum_file(dump_output4['path']))

# Use a hash instead of a height
Expand Down
Loading
Loading