Skip to content

Commit 469948b

Browse files
committed
Regression test for pegin validation issues
Add a regression test for the preceding commits, checking that we can sync successfully when making a bunch of new blocks just as we have transient loss of parent daemon connectivity. This reliably fails without the fix, and reliably succeeds with it. (It stands in for the situation, more common in production, where we sync faster than the parent daemon can keep up after a long outage.)
1 parent 5d79fb5 commit 469948b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/functional/feature_fedpeg.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def setup_network(self, split=False):
125125
'-parent_bech32_hrp=bcrt',
126126
# Turn of consistency checks that can cause assert when parent node stops
127127
# and a peg-in transaction fails this belt-and-suspenders check.
128+
# NOTE: This can cause spurious problems in regtest, and should be dealt with in a better way.
128129
'-checkmempool=0',
129130
]
130131
if not self.options.parent_bitcoin:
@@ -470,9 +471,11 @@ def run_test(self):
470471
self.start_node(1)
471472
connect_nodes_bi(self.nodes, 0, 1)
472473

473-
# Don't make a block, race condition when pegin-invalid block
474-
# is awaiting further validation, nodes reject subsequent blocks
475-
# even ones they create
474+
# Make some blocks right here, as a regression test for
475+
# https://gl.blockstream.com/liquid/elements/-/issues/42 .
476+
print("Generating some blocks, to stress-test handling of this scenario")
477+
sidechain.generate(10)
478+
476479
print("Now waiting for node to re-evaluate peg-in witness failed block... should take a few seconds")
477480
self.sync_all(self.node_groups)
478481
print("Completed!\n")

0 commit comments

Comments
 (0)