Commit fe9a3e1
committed
funding: fix race in itest for zero-conf funding
Fix a race condition where forwarding through a public zero-conf channel
could fail with UnknownNextPeer when using the confirmed SCID. The issue
occurred because ReportShortChanID (which updates the switch's baseIndex
to handle the confirmed SCID) was called AFTER addToGraph (which announces
the confirmed SCID to the network).
With slow backends like postgres, addToGraph takes significant time,
creating a window where other nodes learn about the confirmed SCID from
gossip and attempt to route through it, but the receiving node's switch
hasn't been updated yet to handle forwards using the confirmed SCID.
The fix reorders operations to call ReportShortChanID before addToGraph,
ensuring the switch is ready to handle the confirmed SCID before it's
announced to the network. Forwards using either the alias or confirmed
SCID will work since getLinkByMapping uses baseIndex to map both to the
same link in forwardingIndex.
Fixes flaky test: zero_conf-channel_policy_update_public_zero_conf1 parent cb3991e commit fe9a3e1
2 files changed
+26
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3957 | 3957 | | |
3958 | 3958 | | |
3959 | 3959 | | |
| 3960 | + | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
3960 | 3976 | | |
3961 | 3977 | | |
3962 | 3978 | | |
| |||
3985 | 4001 | | |
3986 | 4002 | | |
3987 | 4003 | | |
3988 | | - | |
3989 | | - | |
3990 | | - | |
3991 | | - | |
3992 | | - | |
3993 | | - | |
3994 | | - | |
3995 | | - | |
3996 | | - | |
3997 | | - | |
3998 | | - | |
3999 | | - | |
4000 | | - | |
4001 | 4004 | | |
4002 | 4005 | | |
4003 | 4006 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4726 | 4726 | | |
4727 | 4727 | | |
4728 | 4728 | | |
4729 | | - | |
4730 | | - | |
4731 | | - | |
4732 | | - | |
4733 | | - | |
4734 | | - | |
4735 | | - | |
4736 | | - | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
4737 | 4732 | | |
4738 | 4733 | | |
4739 | 4734 | | |
| |||
4746 | 4741 | | |
4747 | 4742 | | |
4748 | 4743 | | |
| 4744 | + | |
| 4745 | + | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
4749 | 4751 | | |
4750 | 4752 | | |
4751 | 4753 | | |
| |||
0 commit comments