Our ledger balanced perfectly and had no audit trail
Описание и применение
Обновление MnemoPay SDK с версии 1.14.x до 1.15.x устраняет ошибку, при которой compact(n) отключал запись записей, оставляя сбалансированный баланс без аудита.
Задача
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.
Результат
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.
Рабочий процесс
- 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
Доказательства
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.
On 1.14.2 the last transaction has zero entries behind it, while every check we had said "fine".
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.
verify() now says how much detail backs the totals (complete, compacted or disabled), and turning the trail off is an explicit setHighThroughput(true).
- Дата записи: 2026-11-04T05:28:58.994Z