Release: develop -> main - #4460
Merged
Merged
Conversation
* 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.
github-actions
Bot
requested review from
TaprootFreak and
davidleomay
as code owners
July 29, 2026 15:11
* 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
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatic Release PR
This PR was automatically created after changes were pushed to develop.
Commits: 1 new commit(s)
Checklist