Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13711444
D11147.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D11147.diff
View Options
diff --git a/test/functional/feature_blockfilterindex_prune.py b/test/functional/feature_blockfilterindex_prune.py
--- a/test/functional/feature_blockfilterindex_prune.py
+++ b/test/functional/feature_blockfilterindex_prune.py
@@ -34,12 +34,7 @@
assert_greater_than(
len(node.getblockfilter(node.getbestblockhash())['filter']),
0)
- # Mine two batches of blocks to avoid hitting
- # NODE_NETWORK_LIMITED_MIN_BLOCKS disconnection
- node.generate(250)
- self.sync_all()
- node.generate(250)
- self.sync_all()
+ node.generate(500)
self.sync_index(height=700)
self.log.info("prune some blocks")
@@ -57,12 +52,17 @@
len(node.getblockfilter(node.getbestblockhash())['filter']),
0)
- self.log.info(
- "check if we can access the blockfilter of a pruned block")
+ self.log.info("check if we can access the blockfilter of a pruned "
+ "block")
assert_greater_than(
len(node.getblockfilter(node.getblockhash(2))['filter']),
0)
+ # mine and sync index up to a height that will later be the pruneheight
+ node.generate(338)
+ # Backport note: 3 blk?????.dat file with 346 blocks each makes 1038.
+ self.sync_index(height=1038)
+
self.log.info("start node without blockfilterindex")
self.restart_node(0, extra_args=["-fastprune", "-prune=1"])
@@ -70,15 +70,26 @@
assert_raises_rpc_error(
-1, "Index is not enabled for filtertype basic",
node.getblockfilter, node.getblockhash(2))
- node.generate(1000)
+ node.generate(462)
+
+ self.log.info("prune exactly up to the blockfilterindexes best block "
+ "while blockfilters are disabled")
+ pruneheight_2 = self.nodes[0].pruneblockchain(1040)
+ assert_equal(pruneheight_2, 1038)
+ self.restart_node(
+ 0, extra_args=["-fastprune", "-prune=1", "-blockfilterindex=1"])
+ self.log.info("make sure that we can continue with the partially synced"
+ " index after having pruned up to the index height")
+ self.sync_index(height=1500)
self.log.info("prune below the blockfilterindexes best block while "
"blockfilters are disabled")
- # Backport note: we need to prune 1038 blocks to effectively prune the
- # blockfilterindexes best block (height 700), because the pruning step
- # is 346 blocks per blk?????.dat file.
- pruneheight_new = node.pruneblockchain(1038)
- assert_greater_than(pruneheight_new, pruneheight)
+ self.restart_node(
+ 0,
+ extra_args=["-fastprune", "-prune=1"])
+ node.generate(1000)
+ pruneheight_3 = self.nodes[0].pruneblockchain(2000)
+ assert_greater_than(pruneheight_3, pruneheight_2)
self.stop_node(0)
self.log.info("make sure we get an init error when starting the node "
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 12:05 (2 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5573502
Default Alt Text
D11147.diff (3 KB)
Attached To
D11147: test: Add edge case of pruning up to index height
Event Timeline
Log In to Comment