From 22a5e9e7e6d8b801eab99f01a367fb09123dc318 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 28 Aug 2025 10:10:37 +0930 Subject: [PATCH] common: reintroduce "ignored" primary tag. Prior to 23.05, we used this tag to mark onchain to-self inputs we didn't wait for (because they were too small). This fixes migration if that happened (and we are debating whether we should re-introduce this!). ``` lightningd: FATAL SIGNAL 6 (version v25.09rc2) 0x100c8683 send_backtrace common/daemon.c:33 0x100c876f crashdump common/daemon.c:78 0x7fffb2080493 ??? ???:0 0x7fffb1ab0cac ??? __pthread_kill_implementation+0x1bc:0 0x7fffb1a48a5b ??? __GI_raise+0x2b:0 0x7fffb1a2a3db ??? __GI_abort+0x153:0 0x100935b7 migrate_from_account_db wallet/account_migration.c:424 0x10093ff7 db_migrate wallet/db.c:1139 0x10096763 db_setup wallet/db.c:1185 0x100a1bcb wallet_new wallet/wallet.c:223 0x1004485f main lightningd/lightningd.c:1311 0x7fffb1a2aba3 ??? __libc_start_call_main+0x93:0 0x7fffb1a2adeb ??? __libc_start_main_alias_1+0x1ab:0 0xffffffffffffffff ??? ???:0 lightningd: Died with signal 6 ``` Signed-off-by: Rusty Russell Fixes: https://github.com/ElementsProject/lightning/issues/8484 --- common/coin_mvt.c | 7 ++++++- common/coin_mvt.h | 3 ++- common/test/run-coin_mvt.c | 2 ++ contrib/msggen/msggen/schema.json | 1 + doc/schemas/listchainmoves.json | 1 + plugins/bkpr/account.c | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/common/coin_mvt.c b/common/coin_mvt.c index 4a3063348..4e9ec871e 100644 --- a/common/coin_mvt.c +++ b/common/coin_mvt.c @@ -36,6 +36,7 @@ static const char *mvt_tags[] = { "penalty_adj", "journal_entry", "foreign", + "ignored", }; #define PRIMARY_TAG_BITS ((1ULL << MVT_DEPOSIT) | \ @@ -59,7 +60,8 @@ static const char *mvt_tags[] = { (1ULL << MVT_LEASE_FEE) | \ (1ULL << MVT_PENALTY_ADJ) | \ (1ULL << MVT_JOURNAL) | \ - (1ULL << MVT_CHANNEL_PROPOSED)) + (1ULL << MVT_CHANNEL_PROPOSED) | \ + (1ULL << MVT_IGNORED)) static enum mvt_tag mvt_tag_in_db(enum mvt_tag mvt_tag) { @@ -145,6 +147,9 @@ static enum mvt_tag mvt_tag_in_db(enum mvt_tag mvt_tag) case MVT_FOREIGN: BUILD_ASSERT(MVT_FOREIGN == 26); return mvt_tag; + case MVT_IGNORED: + BUILD_ASSERT(MVT_IGNORED == 27); + return mvt_tag; } abort(); } diff --git a/common/coin_mvt.h b/common/coin_mvt.h index 50d3e2b1f..e9a41b325 100644 --- a/common/coin_mvt.h +++ b/common/coin_mvt.h @@ -40,7 +40,8 @@ enum mvt_tag { MVT_PENALTY_ADJ = 24, MVT_JOURNAL = 25, MVT_FOREIGN = 26, -#define NUM_MVT_TAGS (MVT_FOREIGN + 1) + MVT_IGNORED = 27, +#define NUM_MVT_TAGS (MVT_IGNORED + 1) }; struct mvt_tags { diff --git a/common/test/run-coin_mvt.c b/common/test/run-coin_mvt.c index 6fbac51c2..e7512c089 100644 --- a/common/test/run-coin_mvt.c +++ b/common/test/run-coin_mvt.c @@ -186,6 +186,8 @@ static bool mvt_tag_is_primary(enum mvt_tag tag) return true; case MVT_FOREIGN: return false; + case MVT_IGNORED: + return true; } abort(); } diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index b948a0c3e..69c33acf4 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -16666,6 +16666,7 @@ "to_them", "penalized", "stolen", + "ignored", "to_miner" ], "description": [ diff --git a/doc/schemas/listchainmoves.json b/doc/schemas/listchainmoves.json index d718b0b8f..985105e93 100644 --- a/doc/schemas/listchainmoves.json +++ b/doc/schemas/listchainmoves.json @@ -114,6 +114,7 @@ "to_them", "penalized", "stolen", + "ignored", "to_miner" ], "description": [ diff --git a/plugins/bkpr/account.c b/plugins/bkpr/account.c index e5001b885..6ff4f01c8 100644 --- a/plugins/bkpr/account.c +++ b/plugins/bkpr/account.c @@ -218,6 +218,7 @@ void maybe_update_account(struct command *cmd, case MVT_PENALTY_ADJ: case MVT_JOURNAL: case MVT_FOREIGN: + case MVT_IGNORED: /* Ignored */ break; }