Skip to content

db: fix intvars being truncated to 32 bits on write and read - #9497

Open
Andezion wants to merge 1 commit into
ElementsProject:masterfrom
Andezion:fix/vars-intval-64bit
Open

db: fix intvars being truncated to 32 bits on write and read#9497
Andezion wants to merge 1 commit into
ElementsProject:masterfrom
Andezion:fix/vars-intval-64bit

Conversation

@Andezion

Copy link
Copy Markdown
Collaborator

Fixes #9467

What changed

  • db/exec.c - db_set_intvar, db_get_intvar, and db_data_version_get (reads the same column) now use the existing 64-bit db_bind_s64/db_col_s64 helpers instead of the 32-bit ones

  • wallet/migrations.c - new migration widens vars.intval to BIGINT on Postgres only (/PSQL/ no-op on SQLite, which doesnt enforce column width), with a matching revert

  • wallet/test/run-db.c - added a regression case round-tripping a value >32 bits, verified it fails on the old code and passes with the fix

Changelog-Fixed: db: fixed vars table integers being truncated to 32 bits

Important

26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12.

RC1 is scheduled on August 17th

The final release is scheduled for September 7th.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

Changelog-Fixed: db: fixed vars table integers being truncated to 32 bits
@Andezion Andezion self-assigned this Sep 11, 2026
@Andezion Andezion added the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status::Ready for Review The work has been completed and is now awaiting evaluation or approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deleted_forward_fees integer type in vars table too small

1 participant