Skip to content

Release: develop -> main#4317

Merged
TaprootFreak merged 1 commit into
mainfrom
develop
Jul 22, 2026
Merged

Release: develop -> main#4317
TaprootFreak merged 1 commit 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

…booking wedge) (#4309)

* fix(accounting): re-run the idempotent CoA bootstrap after cutover

The Chart-of-Accounts bootstrap only ran inside the one-time ledger
cutover. Custody assets created after the cutover (e.g. the Bank Frick
assets from #4252, prod-live three days after the cutover completed)
never get an ASSET ledger account, so the first bank_tx referencing
them wedges the BankTxConsumer fail-loud ('CoA bootstrap missing'),
stalls the booking watermark and floods the log (~120 errors/h since
2026-07-22 12:16 UTC on bank_tx 207473, Frick/EUR).

Register a recurring 5-minute @DfxCron wrapper (own kill-switch
Process.LEDGER_COA_BOOTSTRAP, gated on isLedgerReady) that re-runs the
idempotent bootstrap, and add a rename-guard in bootstrapAssetAccounts:
UNIQUE is on name only, so after a uniqueName change findOrCreate(name)
would create a second account for the same asset and make
findByAssetId ambiguous — the existing account wins.

* fix(accounting): fail loud on CoA account name collision

After a uniqueName rename, the old name can be reused by a new asset;
findOrCreate then name-hits the foreign account and returns it without
creating anything — the recurring bootstrap would silently no-op on the
exact case it exists to heal. Log an error instead (re-fires every run,
persistent signal). Also cover the guard-skip loop continuation with a
mixed two-asset spec.

* test(accounting): restore the DfxLogger prototype spy after the collision spec

The prototype-level mock outlives beforeEach's createMock rebuilds and
would leak call history into later tests (repo convention restores it,
cf. crypto-input.consumer.spec.ts).

* fix(accounting): create CoA accounts active and isolate per-asset bootstrap failures

Asset.isActive measures user tradability (all custody/bank assets are
false), not account liveness - deriving ledger_account.active from it
made every bootstrap-created ASSET account invisible to the
reconciliation safety net while still being booked. findOrCreate now
always creates live accounts; active=false stays a manual marker.

A failing asset no longer aborts the whole recurring run: log and
continue, so later assets and the transit/named sections still get
their accounts. The collision check now also catches name-hits on
NULL-assetId rows, and a real creation logs an info line as the
post-deploy signal that the recurring bootstrap did its work.

* test(accounting): assert cron schedule and lock timeout of the ledger job wrappers

* fix(accounting): activate the bootstrap-created ASSET ledger accounts

The bootstrap derived ledger_account.active from Asset.isActive, which
is false for every custody/bank asset - so ALL asset-backed accounts
created at cutover are invisible to the daily reconciliation while
still being booked. The code fix stops the derivation for new accounts;
this migration repairs the existing rows so the reconciliation safety
net actually covers them.
@TaprootFreak
TaprootFreak merged commit 62a9dcc into main Jul 22, 2026
12 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