Skip to content

Fix flakes #17 #8258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rustyrussell
Copy link
Contributor

Changelog-None

CLTV can be one less if l1 hasn't seen block yet:

```
2025-04-24T05:38:12.8587408Z >       l1.daemon.wait_for_log(f'Adding HTLC 0 amount=15002msat cltv={110 + 1 + 100 + 200 + 400}')
2025-04-24T05:38:12.8587715Z 
2025-04-24T05:38:12.8587804Z tests/test_xpay.py:824: 
...
2025-04-24T05:38:12.9889506Z lightningd-1 2025-04-24T05:30:45.255Z DEBUG   022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: Adding HTLC 0 amount=15002msat cltv=812 gave CHANNEL_ERR_ADD_OK
```

Signed-off-by: Rusty Russell <[email protected]>
Make sure l1 sees the l5 channel!

```
2025-04-29T02:39:42.1086397Z         # now we send two 'sticky' htlcs, l1->l5 + l4->l1
2025-04-29T02:39:42.1086837Z         amt = 10**8 // 2
2025-04-29T02:39:42.1087231Z         sticky_inv_1 = l5.rpc.invoice(amt, '2', 'sticky')
2025-04-29T02:39:42.1087767Z >       route = l1.rpc.getroute(l5.info['id'], amt, 1)['route']
2025-04-29T02:39:42.1088126Z 
2025-04-29T02:39:42.1088279Z tests/test_closing.py:1432: 
...
2025-04-29T02:39:42.1111693Z         elif "error" in resp:
2025-04-29T02:39:42.1111976Z >           raise RpcError(method, payload, resp['error'])
2025-04-29T02:39:42.1113258Z E           pyln.client.lightning.RpcError: RPC call failed: method: getroute, payload: {'id': '032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e', 'amount_msat': 50000000, 'riskfactor': 1, 'cltv': 9}, error: {'code': -32602, 'message': '032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e: unknown destination node_id (no public channels?)'}
```

Signed-off-by: Rusty Russell <[email protected]>
We were supposed to put the sqlite db in a different directory, but
the test was wrong!  So occasionally we would crash with:

```
Failed to commit DB transaction: Failed to commit a transaction: disk I/O error
```

Signed-off-by: Rusty Russell <[email protected]>
@rustyrussell rustyrussell added this to the v25.05 milestone May 2, 2025
Otherwise it comes out as "**BROKEN**" messages:

```
lightningd-2 2025-05-02T03:51:28.760Z **BROKEN** plugin-chanbackup: Peer storage sent!
lightningd-1 2025-05-02T03:51:28.770Z **BROKEN** plugin-chanbackup: Peer storage sent!
```

Signed-off-by: Rusty Russell <[email protected]>
It's not completely stable, which is OK, and we will solve this next release.

Signed-off-by: Rusty Russell <[email protected]>
fundwallet() actually mines a block, putting our count out.  If we see
both blocks at once, we will say "52" blocks instead of "51":

```
2025-05-02T05:28:40.5315155Z         have_forgotten = l2.daemon.is_in_log(
2025-05-02T05:28:40.5315650Z             r"UNUSUAL {}-chan#1: Forgetting channel: It has been 51 blocks without the funding transaction ".format(l1.info['id'])
2025-05-02T05:28:40.5316105Z         )
2025-05-02T05:28:40.5316263Z     
2025-05-02T05:28:40.5316417Z         if dopay:
2025-05-02T05:28:40.5316616Z             assert not have_forgotten
2025-05-02T05:28:40.5317056Z             assert set([c['peer_id'] for c in l2.rpc.listpeerchannels()["channels"]]) == set([l1.info['id'], l3.info['id']])
2025-05-02T05:28:40.5317477Z         else:
2025-05-02T05:28:40.5317662Z >           assert have_forgotten
2025-05-02T05:28:40.5317887Z E           assert None
```

```
0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#1: Forgetting channel: It has been 52 blocks without the funding transaction 0bb0579df6b1d983dda49dad47513afc71696c9d5bea3c8b955ba4b76bb053de getting deeply confirmed. We are fundee and can forget channel without loss of funds.
```

Signed-off-by: Rusty Russell <[email protected]>
Copy link
Collaborator

@endothermicdev endothermicdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catches. I didn't realize libplugin did not support trace level logging.

ACK b63c1db

@ShahanaFarooqui ShahanaFarooqui merged commit a12c02b into ElementsProject:master May 2, 2025
16 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants