Skip to content

Commit b949921

Browse files
committed
Merge branch 'master' into fix/pays-missing-description
2 parents 5a01f3a + b15f386 commit b949921

30 files changed

+331
-464
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
RUST_PROFILE: release
1717
SLOW_MACHINE: 1
1818
CI_SERVER_URL: "http://35.239.136.52:3170"
19-
PYTEST_OPTS_BASE: "--reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10"
19+
PYTEST_OPTS_BASE: "-vvv --junit-xml=report.xml --timeout=1800 --durations=10"
2020

2121
jobs:
2222
prebuild:
@@ -337,7 +337,7 @@ jobs:
337337
timeout-minutes: 120
338338
env:
339339
RUST_PROFILE: release # Has to match the one in the compile step
340-
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10
340+
PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10
341341
needs:
342342
- compile
343343
strategy:
@@ -453,7 +453,7 @@ jobs:
453453
env:
454454
RUST_PROFILE: release # Has to match the one in the compile step
455455
CFG: compile-gcc
456-
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10 --test-group-random-seed=42
456+
PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10 --test-group-random-seed=42
457457
needs:
458458
- compile
459459
strategy:
@@ -541,7 +541,7 @@ jobs:
541541
RUST_PROFILE: release
542542
SLOW_MACHINE: 1
543543
TEST_DEBUG: 1
544-
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10 --test-group-random-seed=42
544+
PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10 --test-group-random-seed=42
545545
needs:
546546
- compile
547547
strategy:
@@ -553,7 +553,7 @@ jobs:
553553
PYTEST_OPTS: --test-group=1 --test-group-count=12
554554
- NAME: ASan/UBSan (02/12)
555555
GROUP: 2
556-
PYTEST_OPTS: --test-group=2 --test-group-count=12 -n 1
556+
PYTEST_OPTS: --test-group=2 --test-group-count=12
557557
- NAME: ASan/UBSan (03/12)
558558
GROUP: 3
559559
PYTEST_OPTS: --test-group=3 --test-group-count=12
@@ -632,7 +632,7 @@ jobs:
632632
env:
633633
VALGRIND: 0
634634
GENERATE_EXAMPLES: 1
635-
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10
635+
PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10
636636
TEST_NETWORK: regtest
637637
needs:
638638
- compile
@@ -678,7 +678,7 @@ jobs:
678678
timeout-minutes: 120
679679
env:
680680
RUST_PROFILE: release # Has to match the one in the compile step
681-
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10
681+
PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10
682682
needs:
683683
- compile
684684
strategy:

contrib/pyln-grpc-proto/pyln/grpc/node_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from pyln.grpc import node_pb2 as node__pb2
77

8-
GRPC_GENERATED_VERSION = '1.76.0'
8+
GRPC_GENERATED_VERSION = '1.75.1'
99
GRPC_VERSION = grpc.__version__
1010
_version_not_supported = False
1111

@@ -18,7 +18,7 @@
1818
if _version_not_supported:
1919
raise RuntimeError(
2020
f'The grpc package installed is at version {GRPC_VERSION},'
21-
+ ' but the generated code in node_pb2_grpc.py depends on'
21+
+ f' but the generated code in node_pb2_grpc.py depends on'
2222
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2323
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2424
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

contrib/pyln-testing/pyln/testing/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def map_node_error(nodes, f, msg):
498498

499499
map_node_error(nf.nodes, printValgrindErrors, "reported valgrind errors")
500500
map_node_error(nf.nodes, printCrashLog, "had crash.log files")
501-
map_node_error(nf.nodes, checkBroken, "had BROKEN messages")
501+
map_node_error(nf.nodes, checkBroken, "had BROKEN or That's weird messages")
502502
map_node_error(nf.nodes, lambda n: not n.allow_warning and n.daemon.is_in_log(r' WARNING:'), "had warning messages")
503503
map_node_error(nf.nodes, checkReconnect, "had unexpected reconnections")
504504
map_node_error(nf.nodes, checkPluginJSON, "had malformed hooks/notifications")

contrib/pyln-testing/pyln/testing/utils.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ def call(self, method, payload=None, cmdprefix=None, filter=None):
841841

842842

843843
class LightningNode(object):
844-
def __init__(self, node_id, lightning_dir, bitcoind, executor, valgrind, may_fail=False,
844+
def __init__(self, node_id, lightning_dir, bitcoind, executor, may_fail=False,
845845
may_reconnect=False,
846846
broken_log=None,
847847
allow_warning=False,
@@ -900,7 +900,7 @@ def __init__(self, node_id, lightning_dir, bitcoind, executor, valgrind, may_fai
900900
self.daemon.opts["dev-debugger"] = dbgvar
901901
if os.getenv("DEBUG_LIGHTNINGD"):
902902
self.daemon.opts["dev-debug-self"] = None
903-
if valgrind:
903+
if VALGRIND:
904904
self.daemon.env["LIGHTNINGD_DEV_NO_BACKTRACE"] = "1"
905905
self.daemon.opts["dev-no-plugin-checksum"] = None
906906
else:
@@ -926,7 +926,7 @@ def __init__(self, node_id, lightning_dir, bitcoind, executor, valgrind, may_fai
926926
dsn = db.get_dsn()
927927
if dsn is not None:
928928
self.daemon.opts['wallet'] = dsn
929-
if valgrind:
929+
if VALGRIND:
930930
trace_skip_pattern = '*python*,*bitcoin-cli*,*elements-cli*,*cln-grpc*,*clnrest*,*wss-proxy*,*cln-bip353*,*reckless'
931931
if not valgrind_plugins:
932932
trace_skip_pattern += ',*plugins*'
@@ -1653,10 +1653,6 @@ class NodeFactory(object):
16531653
"""
16541654
def __init__(self, request, testname, bitcoind, executor, directory,
16551655
db_provider, node_cls, jsonschemas):
1656-
if request.node.get_closest_marker("slow_test") and SLOW_MACHINE:
1657-
self.valgrind = False
1658-
else:
1659-
self.valgrind = VALGRIND
16601656
self.testname = testname
16611657

16621658
# Set test name in environment for coverage file organization
@@ -1755,7 +1751,7 @@ def get_node(self, node_id=None, options=None, dbfile=None,
17551751
db = self.db_provider.get_db(os.path.join(lightning_dir, TEST_NETWORK), self.testname, node_id)
17561752
db.provider = self.db_provider
17571753
node = self.node_cls(
1758-
node_id, lightning_dir, self.bitcoind, self.executor, self.valgrind, db=db,
1754+
node_id, lightning_dir, self.bitcoind, self.executor, db=db,
17591755
port=port, grpc_port=grpc_port, options=options, may_fail=may_fail or expect_fail,
17601756
jsonschemas=self.jsonschemas,
17611757
**kwargs
@@ -1872,7 +1868,7 @@ def killall(self, expected_successes):
18721868
# leak detection upsets VALGRIND by reading uninitialized mem,
18731869
# and valgrind adds extra fds.
18741870
# If it's dead, we'll catch it below.
1875-
if not self.valgrind:
1871+
if not VALGRIND:
18761872
try:
18771873
# This also puts leaks in log.
18781874
leaks = self.nodes[i].rpc.dev_memleak()['leaks']

gossipd/gossmap_manage.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,6 @@ void gossmap_manage_channel_spent(struct gossmap_manage *gm,
13321332
struct short_channel_id scid)
13331333
{
13341334
struct gossmap_chan *chan;
1335-
const struct gossmap_node *me;
13361335
const u8 *msg;
13371336
struct chan_dying cd;
13381337
struct gossmap *gossmap = gossmap_manage_get_gossmap(gm);
@@ -1341,14 +1340,6 @@ void gossmap_manage_channel_spent(struct gossmap_manage *gm,
13411340
if (!chan)
13421341
return;
13431342

1344-
me = gossmap_find_node(gossmap, &gm->daemon->id);
1345-
/* We delete our own channels immediately, since we have local knowledge */
1346-
if (gossmap_nth_node(gossmap, chan, 0) == me
1347-
|| gossmap_nth_node(gossmap, chan, 1) == me) {
1348-
kill_spent_channel(gm, gossmap, scid);
1349-
return;
1350-
}
1351-
13521343
/* Is it already dying? It's lightningd re-telling us */
13531344
if (channel_already_dying(gm->dying_channels, scid))
13541345
return;

hsmd/libhsmd.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,17 @@ static u8 *handle_sign_anchorspend(struct hsmd_client *c, const u8 *msg_in)
18211821
fmt_wally_psbt(tmpctx, psbt));
18221822
}
18231823

1824+
if (dev_warn_on_overgrind) {
1825+
for (size_t i = 0; i < psbt->num_inputs; i++) {
1826+
if (psbt->inputs[i].signatures.num_items == 1
1827+
&& psbt->inputs[i].signatures.items[0].value_len < 71) {
1828+
hsmd_status_fmt(LOG_BROKEN, NULL,
1829+
"overgrind: short signature length %zu",
1830+
psbt->inputs[i].signatures.items[0].value_len);
1831+
}
1832+
}
1833+
}
1834+
18241835
return towire_hsmd_sign_anchorspend_reply(NULL, psbt);
18251836
}
18261837

lightningd/channel_gossip.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,13 +1096,15 @@ void channel_gossip_update_from_gossipd(struct channel *channel,
10961096
case CGOSSIP_WAITING_FOR_USABLE:
10971097
case CGOSSIP_CHANNEL_DEAD:
10981098
case CGOSSIP_CHANNEL_UNANNOUNCED_DYING:
1099-
case CGOSSIP_CHANNEL_ANNOUNCED_DEAD:
11001099
/* Shouldn't happen. */
11011100
log_broken(channel->log,
11021101
"gossipd gave channel_update in %s? update=%s",
11031102
channel_gossip_state_str(channel->channel_gossip->state),
11041103
tal_hex(tmpctx, channel_update));
11051104
/* fall thru */
1105+
/* ANNOUNCED_DEAD can happen is gossipd hadn't processed block
1106+
* when we restarted; ignore, as it will catch up soon. */
1107+
case CGOSSIP_CHANNEL_ANNOUNCED_DEAD:
11061108
case CGOSSIP_CHANNEL_ANNOUNCED_DYING:
11071109
if (taken(channel_update))
11081110
tal_free(channel_update);

lightningd/connect_control.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,22 @@ static void connect_failed(struct lightningd *ld,
277277
connect_nsec,
278278
connect_attempted);
279279

280-
/* We can have multiple connect commands: fail them all */
281-
while ((c = find_connect(ld, id)) != NULL) {
282-
/* They delete themselves from list */
283-
was_pending(command_fail(c->cmd, errcode, "%s", errmsg));
280+
/* There's a race between autoreconnect and connect commands. This
281+
* matters because the autoreconnect might have failed, but that was before
282+
* the connect_to_peer command gave connectd a new address. This we wait for
283+
* one we explicitly asked for before failing.
284+
*
285+
* A similar pattern could occur with multiple connect commands, however connectd
286+
* does simply combine those, so we don't get a response per request, and it's a
287+
* very rare corner case (which, unlike the above, doesn't happen in CI!).
288+
*/
289+
if (strstarts(connect_reason, "connect command")
290+
|| errcode == CONNECT_DISCONNECTED_DURING) {
291+
/* We can have multiple connect commands: fail them all */
292+
while ((c = find_connect(ld, id)) != NULL) {
293+
/* They delete themselves from list */
294+
was_pending(command_fail(c->cmd, errcode, "%s", errmsg));
295+
}
284296
}
285297
}
286298

lightningd/pay.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,13 @@ static struct command_result *wait_payment(struct lightningd *ld,
784784
/* FIXME: We don't store this! */
785785
fail->msg = NULL;
786786

787-
rpcerrorcode = faildestperm ? PAY_DESTINATION_PERM_FAIL
788-
: PAY_TRY_OTHER_ROUTE;
787+
/* Peers which fail directly can hit this! */
788+
if (failcode & BADONION)
789+
rpcerrorcode = PAY_UNPARSEABLE_ONION;
790+
else if (faildestperm)
791+
rpcerrorcode = PAY_DESTINATION_PERM_FAIL;
792+
else
793+
rpcerrorcode = PAY_TRY_OTHER_ROUTE;
789794

790795
return sendpay_fail(
791796
cmd, payment, rpcerrorcode, NULL, fail,

lightningd/subd.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ static bool handle_peer_error(struct subd *sd, const u8 *msg, int fds[1])
438438

439439
/* Don't free sd; we may be about to free channel. */
440440
sd->channel = NULL;
441+
/* While it's cleaning up, this is not a leak! */
442+
notleak(sd);
441443
sd->errcb(channel, peer_fd, desc, err_for_them, disconnect, warning);
442444
return true;
443445
}
@@ -641,6 +643,8 @@ static void destroy_subd(struct subd *sd)
641643

642644
/* Clear any transient messages in billboard */
643645
sd->billboardcb(channel, false, NULL);
646+
/* While it's cleaning up, this is not a leak! */
647+
notleak(sd);
644648
sd->channel = NULL;
645649

646650
/* We can be freed both inside msg handling, or spontaneously. */
@@ -928,11 +932,6 @@ void subd_release_channel(struct subd *owner, const void *channel)
928932
assert(owner->channel == channel);
929933
owner->channel = NULL;
930934
tal_free(owner);
931-
} else {
932-
/* Caller has reassigned channel->owner, so there's no pointer
933-
* to this subd owner while it's freeing itself. If we
934-
* ask memleak right now, it will complain! */
935-
notleak(owner);
936935
}
937936
}
938937

0 commit comments

Comments
 (0)