Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Our ledger balanced perfectly and had no audit trail

Description and use

Upgrading MnemoPay SDK from 1.14.x to 1.15.x fixes a bug where compact(n) disabled entry recording, leaving a balanced ledger without an audit trail.

Problem

Calling Ledger.compact(n) with n<=100 in MnemoPay SDK 1.14.2 permanently disabled entry recording, leaving a balanced ledger with no audit trail.

Outcome

Upgrading from 1.14.x to 1.15.x restores audit trail functionality; compact() now preserves hash chain and allows archiving, while verify() reports audit detail level.

Workflow

  • 1. Import Ledger from @mnemopay/sdk
  • 2. Create a new Ledger instance
  • 3. Record funding, charges, and settlements in a loop
  • 4. Call ledger.compact(50) every 5 iterations
  • 5. Verify the ledger with ledger.verify()
  • 6. Observe entryCount, entriesForLastTx, auditTrail, and chainValid

Evidence

Ledger.compact(n) trims old entries so memory stays bounded. In 1.14.2, calling it with n <= 100 also switched entry recording off permanently.

Source

On 1.14.2 the last transaction has zero entries behind it, while every check we had said "fine".

Source

In 1.15.0, compact() only trims, keeps the hash-chain link, and hands dropped entries to an archiveSink you can point at durable storage.

Source

verify() now says how much detail backs the totals (complete, compacted or disabled), and turning the trail off is an explicit setHighThroughput(true).

Source

  • Record date: 2026-11-04T05:28:58.994Z