Fix test_restored_packages_retry serialized monitor payload
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Wed, 10 May 2023 17:39:19 +0000 (10:39 -0700)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Wed, 10 May 2023 18:39:49 +0000 (11:39 -0700)
commit4f63fbcb5b5f61d77d94e55eadcc1d23906b3914
tree7cf5fdbfe27781dc8f143612231c55b469a3fc67
parent17a74fcfc74936b48923bba5a416be73a01d2367
Fix test_restored_packages_retry serialized monitor payload

The purpose of this payload is to ensure we retry restored packages on a
`ChannelMonitor` that has upgraded from a version that previously did
not have such retry logic. We can verify this works by checking whether
a restored package has a `height_timer` of `None` upon deserializing the
monitor payload.

In the previous commit, we added a helper that constructs blocks
whenever tests demand blocks be connected. This helper moved towards
having all connected blocks have a version of 0x2000_0000 (also known as
NO_SOFT_FORK_SIGNALLING). However, previously, it was possible for some
blocks to be connected with a slighty different version: 0x0200_0000,
resulting in different block hashes.

This block hash divergence prompted a failure in this test when
`ConnectStyle::HighlyRedundantTransactionsFirstSkippingBlocks` is used
for `nodes[0]`, since this block connection style reconfirms
transactions redundantly and the serialized monitor payload kept a
reference to the hash of the block with version 0x0200_0000, when it
should be expecting one with version 0x2000_0000.
lightning/src/ln/monitor_tests.rs