Skip to content

Commit

Permalink
gossipd: log at trace, not debug for regular messages.
Browse files Browse the repository at this point in the history
See: ElementsProject#7899

A node with 23 connections gets far too many debug messages.

Changelog-Fixed: `gossipd` now does logging at trace, not debug level.
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Dec 3, 2024
1 parent 6346b06 commit a20eb3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void status_vfmt(enum log_level level,
size_t n = traces_suppressed;
traces_suppressed = 0;
/* Careful: recursion! */
status_debug("...[%zu debug/trace messages suppressed]...", n);
status_trace("...[%zu debug/trace messages suppressed]...", n);
} else if (traces_suppressed || qlen > TRACE_QUEUE_LIMIT) {
traces_suppressed++;
return;
Expand Down
2 changes: 1 addition & 1 deletion contrib/pyln-testing/pyln/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


LIGHTNINGD_CONFIG = OrderedDict({
"log-level": "debug",
"log-level": "trace",
"cltv-delta": 6,
"cltv-final": 5,
"watchtime-blocks": 5,
Expand Down
12 changes: 6 additions & 6 deletions gossipd/gossmap_manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ struct gossmap_manage *gossmap_manage_new(const tal_t *ctx,
/* Catch CI giving out-of-order gossip: definitely happens IRL though */
static void bad_gossip(const struct node_id *source_peer, const char *str)
{
status_peer_debug(source_peer, "Bad gossip order: %s", str);
status_peer_trace(source_peer, "Bad gossip order: %s", str);
}

/* Send peer a warning message, if non-NULL. */
Expand Down Expand Up @@ -585,7 +585,7 @@ const char *gossmap_manage_channel_announcement(const tal_t *ctx,
return NULL;
}

status_debug("channel_announcement: Adding %s to pending...",
status_trace("channel_announcement: Adding %s to pending...",
fmt_short_channel_id(tmpctx, scid));
if (!map_add(&gm->pending_ann_map, scid, pca)) {
/* Already pending? Ignore */
Expand Down Expand Up @@ -613,7 +613,7 @@ void gossmap_manage_handle_get_txout_reply(struct gossmap_manage *gm, const u8 *
if (!fromwire_gossipd_get_txout_reply(msg, msg, &scid, &sat, &outscript))
master_badmsg(WIRE_GOSSIPD_GET_TXOUT_REPLY, msg);

status_debug("channel_announcement: got reply for %s...",
status_trace("channel_announcement: got reply for %s...",
fmt_short_channel_id(tmpctx, scid));

pca = map_del(&gm->pending_ann_map, scid);
Expand Down Expand Up @@ -807,7 +807,7 @@ static const char *process_channel_update(const tal_t *ctx,
/* Used to evaluate gossip peers' performance */
peer_supplied_good_gossip(gm->daemon, source_peer, 1);

status_peer_debug(source_peer,
status_peer_trace(source_peer,
"Received channel_update for channel %s/%d now %s",
fmt_short_channel_id(tmpctx, scid),
dir,
Expand Down Expand Up @@ -948,7 +948,7 @@ static void process_node_announcement(struct gossmap_manage *gm,
/* Used to evaluate gossip peers' performance */
peer_supplied_good_gossip(gm->daemon, source_peer, 1);

status_peer_debug(source_peer,
status_peer_trace(source_peer,
"Received node_announcement for node %s",
fmt_node_id(tmpctx, node_id));
}
Expand Down Expand Up @@ -1263,7 +1263,7 @@ void gossmap_manage_channel_spent(struct gossmap_manage *gm,
cd.scid = scid;

/* Remember locally so we can kill it in 12 blocks */
status_debug("channel %s closing soon due"
status_trace("channel %s closing soon due"
" to the funding outpoint being spent",
fmt_short_channel_id(tmpctx, scid));

Expand Down

0 comments on commit a20eb3e

Please sign in to comment.