Skip to content

askrene: clean up post-impression follow-ups - #9387

Open
w3lld1 wants to merge 1 commit into
ElementsProject:masterfrom
w3lld1:cleanup/issue-9378
Open

askrene: clean up post-impression follow-ups#9387
w3lld1 wants to merge 1 commit into
ElementsProject:masterfrom
w3lld1:cleanup/issue-9378

Conversation

@w3lld1

@w3lld1 w3lld1 commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • remove dead askrene downgrade and offer state, including the unused impression decode context
  • make timestamp trimming stop at the first retained entry and clarify impression-related schema text
  • sanitize unsafe plugin ID prefixes and clamp expired-offer invoice expiry to one second
  • clean up the related amount sentinel, utility comments, and range documentation

Validation

  • compiled every changed C translation unit with the repository's configured GCC flags and -Werror
  • uv run make check-source BASE_REF=origin/master BOLTDIR=../bolts CARGO=false CC=devtools/cc-nobuild SUPPRESS_GENERATION=1
  • verified all four changed JSON schemas are in canonical jq format
  • git diff --check origin/master...HEAD

The full linked build and integration suite are deferred to CI.

Checklist

  • Changelog reviewed (Changelog-None; these are cleanups for unreleased v26.09 changes)
  • Tests reviewed (no new behavior surface; changed C paths compile with -Werror and source checks pass)
  • Documentation reviewed and updated
  • Related issue linked below
  • Downgrade behavior considered; impression records remain omitted for both supported downgrade paths

Changelog-None

Fixes #9378

@w3lld1
w3lld1 requested a review from Lagrang3 as a code owner August 5, 2026 20:02
Comment thread tools/lightning-downgrade.c Outdated
static const char *downgrade_askrene_layers(const tal_t *ctx, struct db *db,
bool convert_bias,
bool convert_impression)
bool convert_bias)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit.

By the AI logic the bool convert_impression was redundant.
It was there for us humans, to understand that if we add some new feature in 26.12
we can reuse downgrade_askrene_layers with convert_bias=false and convert_impression=false.

Therefore, it is not wrong but it is not necessary to remove it neither.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave tools/lightning-downgrade.c as it is.

Comment thread plugins/offers_invreq_hook.c
@Lagrang3

Lagrang3 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

@w3lld1: For CI to pass you need to include in this commit also the auto generated documentation files.

Build the project

uv sync --all-groups --all-extras && ./configure && uv run make

add the generated files

git add contrib/msggen/msggen/schema.json && git commit --amend

@w3lld1
w3lld1 requested a review from cdecker as a code owner August 6, 2026 11:29
@w3lld1

w3lld1 commented Aug 6, 2026

Copy link
Copy Markdown
Author

Thanks — addressed both points in 83601c9a: restored tools/lightning-downgrade.c to the current master implementation and regenerated contrib/msggen/msggen/schema.json from doc/schemas.

Validation:

  • schema bundle generation completed successfully and is idempotent
  • tools/lightning-downgrade.c matches current upstream master
  • git diff --check

@Lagrang3

Lagrang3 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

@w3lld1, since the second commit fixes the first, please squash them into a single commit.

Remove dead state and parameters left after the askrene impression changes, and make the timestamp-ordered trimming logic stop at the first retained entry.

Also harden plugin IDs and expired-offer invoice expiry handling, and correct the associated schema and utility documentation.

Issue ElementsProject#9378 notes that the absolute-expiry subtraction can underflow when an offer is already expired. Clamp that case to a one-second relative expiry so zero retains its cancellation meaning.

Changelog-None
@w3lld1
w3lld1 force-pushed the cleanup/issue-9378 branch from 83601c9 to d5af48f Compare August 6, 2026 19:53
@w3lld1

w3lld1 commented Aug 6, 2026

Copy link
Copy Markdown
Author

Thanks — squashed the branch into a single commit (d5af48f7). The diff is unchanged, and git diff --check passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

askrene/downgrade/offers: dead code and doc cleanups from #9150

2 participants