Skip to content

Commit e5ba4e8

Browse files
gwillenapoelstra
authored andcommitted
Regression test for pegin validation issues during sync
Add a regression test for #891 . This checks 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 7f79f72 commit e5ba4e8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/functional/feature_fedpeg.py

Lines changed: 7 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,12 @@ 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 a bunch of blocks while catching up, as a regression test for
475+
# https://github.com/ElementsProject/elements/issues/891 (sporadic
476+
# failures when catching up after loss of parent daemon connectivity.)
477+
print("Generating some blocks, to stress-test handling of parent daemon reconnection")
478+
sidechain.generate(10)
479+
476480
print("Now waiting for node to re-evaluate peg-in witness failed block... should take a few seconds")
477481
self.sync_all(self.node_groups)
478482
print("Completed!\n")

0 commit comments

Comments
 (0)