You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
00618e8 assumeutxo: Drop block height from metadata (Fabian Jahr)
Pull request description:
Fixesbitcoin/bitcoin#30514 which has more context and shows how the issue can be reproduced. Since the value in question is removed, there is no test to add to reproduce anything.
This is an alternative approach to #30516 with much of the [code being suggested there](bitcoin/bitcoin#30516 (comment)).
ACKs for top commit:
maflcko:
re-ACK 00618e8 🎌
achow101:
ACK 00618e8
theStack:
Code-review ACK 00618e8
ismaelsadeeq:
Re-ACK 00618e8
mzumsande:
ACK 00618e8
Tree-SHA512: db9575247bae838ad7742a27a216faaf55bb11e022f9afdd05752bb09bbf9614717d0ad64304ff5722a16bf41d8dea888af544e4ae26dcaa528c1add0269a4a8
return util::Error{strprintf(Untranslated("assumeutxo block hash in snapshot metadata not recognized (hash: %s, height: %s). The following snapshot heights are available: %s"),
5694
+
return util::Error{strprintf(Untranslated("assumeutxo block hash in snapshot metadata not recognized (hash: %s). The following snapshot heights are available: %s"),
return util::Error{strprintf(Untranslated("The base block header (%s) must appear in the headers chain. Make sure all headers are syncing, and call loadtxoutset again"),
return util::Error{strprintf(Untranslated("The base block header (%s) is part of an invalid chain"), base_blockhash.ToString())};
5708
5708
}
5709
5709
5710
-
if (!m_best_header || m_best_header->GetAncestor(base_blockheight) != snapshot_start_block) {
5710
+
if (!m_best_header || m_best_header->GetAncestor(snapshot_start_block->nHeight) != snapshot_start_block) {
5711
5711
return util::Error{Untranslated("A forked headers-chain with more work than the chain with the snapshot base block header exists. Please proceed to sync without AssumeUtxo.")};
Copy file name to clipboardExpand all lines: test/functional/feature_assumeutxo.py
+9-10Lines changed: 9 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ def expected_error(msg):
71
71
assert_raises_rpc_error(parsing_error_code, "Unable to parse metadata: Invalid UTXO set snapshot magic bytes. Please check if this is indeed a snapshot file or if you are using an outdated snapshot format.", node.loadtxoutset, bad_snapshot_path)
72
72
73
73
self.log.info(" - snapshot file with unsupported version")
assert_raises_rpc_error(parsing_error_code, f"Unable to parse metadata: Version of snapshot {version} does not match any of the supported versions.", node.loadtxoutset, bad_snapshot_path)
@@ -98,21 +98,20 @@ def expected_error(msg):
98
98
bogus_block_hash="0"*64# Represents any unknown block hash
99
99
# The height is not used for anything critical currently, so we just
msg=f"Unable to load UTXO snapshot: assumeutxo block hash in snapshot metadata not recognized (hash: {bad_block_hash}, height: {bogus_height}). The following snapshot heights are available: 110, 200, 299."
105
+
msg=f"Unable to load UTXO snapshot: assumeutxo block hash in snapshot metadata not recognized (hash: {bad_block_hash}). The following snapshot heights are available: 110, 200, 299."
expected_error(msg="Bad snapshot - coins left over after deserializing 298 coins."ifoff==-1else"Bad snapshot format or truncated snapshot after deserializing 299 coins.")
117
116
118
117
self.log.info(" - snapshot file with alternated but parsable UTXO data results in different hash")
0 commit comments