ElementsProject / ElementsProject/lightning

CI Flake `test_gossip_force_broadcast_channel_msgs`

Open
#9,270 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.1k
Forks
1k
Avg merge
4d 10h
Merged PRs (30d)
13

Description

It appears sometimes two channels are announced instead of the expected 1. Either two channel announcements is fine or the duplicate announcement is a sign of some underlying bug.

([CI Log](https://github.com/ElementsProject/lightning/actions/runs/28471872223/job/84389393698))

```
def test_gossip_force_broadcast_channel_msgs(node_factory, bitcoind):
""" Send our own channel_update, node_announcement or channel_announcement to existing peers, even if they say they're not interested.
"""
l1, l2 = node_factory.get_nodes(2)

# One block away from being announced.
node_factory.join_nodes([l1, l2], wait_for_announce=False)
bitcoind.generate_block(4)

# It will send timestamp_filter. It should also send a channel_announcement, a
# channel_update, and a node_announcement, even though we said no gossip.
# It may or may not send:
# query_short_channel_ids, query_channel_range, a ping (which we gossipwith replies to)
process = subprocess.Popen(['devtools/gossipwith',
'--no-gossip',
'--hex',
'--network={}'.format(TEST_NETWORK),
'--max-messages={}'.format(7),
'--handle-pings',
'--timeout-after=30',
'{}@localhost:{}'.format(l1.info['id'], l1.port)],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Now do the final announcement
bitcoind.generate_block(1)

stdout, stderr = process.communicate(timeout=30 + TIMEOUT)
assert process.returncode == 0, f"Exit failed: output = {stderr}"

lines = stdout.decode('utf-8').splitlines()
types = {'0100': 'channel_announce',
'0102': 'channel_update',
'0101': 'node_announce',
'0105': 'query_short_channel_ids',
'0107': 'query_channel_range',
'0109': 'gossip_filter',
'0012': 'ping'}
tally = {key: 0 for key in types.values()}
for l in lines:
tally[types[l[0:4]]] += 1

# Make sure the noise is within reasonable bounds
assert tally['query_short_channel_ids'] <= 1
assert tally['query_channel_range'] <= 1
assert tally['ping'] <= 5
assert tally['gossip_filter'] >= 1
del tally['query_short_channel_ids']
del tally['query_channel_range']
del tally['ping']
del tally['gossip_filter']
> assert tally == {'channel_announce': 1,
'channel_update': 1,
'node_announce': 1}
E AssertionError: assert {'channel_announce': 2, 'channel_update': 1, 'node_announce': 1} == {'channel_announce': 1, 'channel_update': 1, 'node_announce': 1}
E
E Common items:
E {'channel_update': 1, 'node_announce': 1}
E Differing items:
E {'channel_announce': 2} != {'channel_announce': 1}
E
E Full diff:
E {
E - 'channel_announce': 1,
E ? ^
E + 'channel_announce': 2,
E ? ^
E 'channel_update': 1,
E 'node_announce': 1,
E }

tests/test_gossip.py:2408: AssertionError
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with tests/test_gossip.py:2408, reproduce the failure using devtools/gossipwith, and review the linked CI log. Determine whether two channel announcements are valid or indicate a duplicate in the gossip behavior. Done means the behavior is resolved and the test reliably reflects the intended announcement count.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
networking, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.