Skip to content

Release: develop -> main - #4460

Merged
TaprootFreak merged 2 commits into
mainfrom
develop
Jul 29, 2026
Merged

Release: develop -> main#4460
TaprootFreak merged 2 commits into
mainfrom
develop

Conversation

@github-actions

Copy link
Copy Markdown

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

* perf(log): index the financial-log query columns

The log table is the largest in the database at 1353 MB (527339 rows) and
carried only its primary key. The minute-interval LedgerMarkService query
filters on system, subsystem, severity and valid with a created range, then
orders by created — which forced a Parallel Seq Scan plus an explicit Sort,
reading ~674 MB from disk per call and discarding 175629 rows per worker at
the filter.

The composite index puts the four equality predicates first and the range
column last, so Postgres can serve both the filter and the ordering from it.

This addresses disk load and the sort step only. The transferred payload —
up to 5001 rows carrying a 5.8 KB message column, roughly 47 MB per call —
is unchanged and remains the dominant cost on the Node side.

* perf(log): include id in the index and correct the lock wording

Review follow-ups.

The query orders by (created, id), so an index ending at created still needs
a sort step whenever rows share a created value. id is now the sixth column.

The lock comment claimed a short SHARE lock. It is held for the entire build,
and lock_timeout caps only the wait to acquire it, not the hold. The build
duration was not measured against production, so no upper bound is claimed.

down() now schema-qualifies the index like every existing migration does.
* fix(realunit): complete all quotes of a batch settlement tx

The issuer may settle multiple purchases in a single on-chain tx with one
transfer event each. Quote completion deduplicated consumed settlements per
tx hash, so only the first quote of a batch was ever completed and the
remaining quotes were stuck in WaitingForPayment although the shares had
arrived. Consumption is now tracked per transfer event, identified by its
(tx hash, share amount) pairing and counted, which also reconstructs the
consumed event of already completed requests and thereby heals stuck quotes
on the next cron run.

* test(realunit): cover the (tx hash, amount) settlement pairing

Reducing the settlement key to the plain tx hash — the very semantics this
branch replaces — left all existing specs green, so the amount component of
the pairing was never exercised. Add the case a tx-hash-only match gets
wrong: the already consumed transfer is not the first event of the batch tx.

Also use Util.sort instead of a hand-rolled comparator and move the private
helpers behind the HELPER METHODS section marker, as in the sibling job
services.

---------

Co-authored-by: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com>
@TaprootFreak
TaprootFreak merged commit 9e36667 into main Jul 29, 2026
17 checks passed
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.

2 participants