Changelog

Stack v4.0

Preview of the upcoming Formance Stack v4.0 release, including Ledger 3.0 and migration changes.

Upcoming release

This release has not shipped

Stack v4.0 is documented as a preview. Its component pins and its documentation set both change until a v4.0 release publishes its own specification, and no v4.0 stack serves production traffic today. The pages linked from this entry serve at the v4.0 preview; each link below moves you there.

ComponentVersion
ledger3.0.0
auth2.4.3
gateway2.2.0
search2.1.0
stargate2.2.2
mcp0.3.0
connectivity1.0.0
transactionplane0.2.1

Stack composition#

A v4.0 stack pins the components in the table above: Ledger, Auth, Gateway, Search, Stargate, MCP, the transaction plane, and Connectivity. Connectivity is part of the Enterprise Edition. Payments, Wallets, Flows (Orchestration), Reconciliation, and Webhooks are not part of the v4.0 composition and cannot be enabled on a v4.0 stack. Their documentation remains available under Stack v3.2.

Plan those workloads before moving a stack to v4.0. A stack running any of them stays on the v3.2 line until you have a replacement for each.

A new v4.0 stack installs the Ledger module by default. The other modules are not installed by default.

Connectivity#

Connectivity takes over from Payments for bringing external provider activity into the stack. Its connectors read activity from payment processors, banks, exchanges, and cloud billing, and record it directly in Ledger as accounts, transactions, and metadata, keeping the provider's own identities and timing. Browse the Connector Catalog, or read Connectivity for the model.

Ledger#

Ledger moves to its 3.0 release line. This is a new implementation of the ledger rather than an increment on Ledger v2: it keeps the accounting model — transactions through postings or Numscript, reversals, metadata, unique references, idempotency, bulk operations, and read APIs — and replaces the storage, replication, API, and operational surfaces underneath it.

Existing Ledger v2 integrations are not wire-compatible. Read Migrate from Ledger v2 and Update Ledger Clients before planning an upgrade.

PostgreSQL is no longer a runtime dependency#

Ledger stores its data in an embedded Pebble store and replicates writes through Raft. Leader election, follower catch-up, snapshotting, and quorum behavior are owned by the ledger process rather than by a database deployment around it.

This removes the external database from the deployment, and moves WAL placement, disk capacity, backup, and restore into the ledger's own operational surface. See Plan Topology and Manage Cluster Lifecycle and Prepare a Ledger Deployment.

One cluster is one ordering domain#

In Ledger v2 terms, a Ledger 3.0 cluster is equivalent to a single bucket: every ledger it hosts shares one Raft group and one global log ordering.

Cross-ledger atomic batches#

Because all ledgers share one ordering domain, a single command can carry actions targeting more than one ledger. The gRPC Apply call accepts such a command and applies every action atomically.

The HTTP bulk route is ledger-scoped — its ledger name comes from the request path — so atomic=true there means atomic within that ledger. Use gRPC when a batch has to span ledgers. See Process Operations in Bulk and the gRPC API.

Idempotency covers the whole cluster#

Idempotency applies to every operation at the system level rather than to transactions inside one ledger. Keys are no longer scoped per ledger: a key reused anywhere in the cluster with different request content is rejected with HTTP 409 and IDEMPOTENCY_KEY_CONFLICT.

Keys expire after the cluster's --idempotency-ttl, which defaults to 24 hours. Namespace keys per ledger when you generate them. See Retry Writes Safely.

Mirror ledgers#

A mirror ledger follows a running Ledger v2 instance over HTTP or directly from its PostgreSQL database, transforms the incoming records with CEL rules, reports synchronization progress, and is promoted to a normal ledger at cutover. This is the supported migration path off Ledger v2. See Create a Mirror and Transform Mirrored Data.

Data model#

AdditionWhat it does
Typed metadataDeclares the type of each metadata field and validates filters against it. See Metadata and Typed Values.
Account typesMatch addresses by pattern, with AUDIT or STRICT enforcement and NORMAL, EPHEMERAL, or TRANSIENT volume persistence. See Account Types and Enforcement.
Configurable indexesOpt into address, metadata, reference, timestamp, and account-asset indexes per ledger, with backfill progress. See Create and Manage Indexes.
Prepared queriesReusable parameterized filters for list and aggregate reads. See Create Prepared Queries.
Query checkpointsPin a read to a known log position and choose read consistency explicitly. See Choose Read Consistency and Use Checkpoints.
Numscript librarySave Numscript programs per ledger under explicit semantic versions and call them by reference. See Reuse and Version Numscript Programs.

Ledger v2 combined address validation, metadata definition, transaction templates, and query templates behind one Ledger Schema API. Ledger 3.0 models those four concerns as independent resources, so there is no single schema version that selects all of them for a transaction.

Request and response signing#

Ledger 3.0 signs requests and responses with Ed25519, registers and revokes keys through a dynamic key-management API, and can be configured to require a signature on every admitted mutation. See Request and Response Signing and Authentication and Authorization.

Audit log#

The audit log records successful and failed operations, replicated through Raft and stored alongside the ledger's own state. A checker verifies that the audit trail and the persisted projections agree. See Verify Ledger Integrity.

Operations#

  • Maintenance mode blocks writes cluster-wide behind a replicated flag — see Use Maintenance Mode.
  • Disk-space safeguards reject writes once node usage crosses a configured threshold.
  • Full and incremental backups export to object storage, and a restore combines the latest full backup with the incrementals recorded after it — see Back Up a Cluster and Restore a Cluster.
  • Cursor-based event sinks deliver log events to downstream consumers with a durable cursor — see Configure an Event Sink.

gRPC and HTTP are not symmetric#

Both surfaces cover the core accounting workflows: writing transactions from postings or Numscript, reverting, metadata, unique references, idempotency, bulk, and reads. They diverge past that, so choose the surface per workflow rather than once per application.

  • Cross-ledger atomic batches are gRPC-only. The HTTP bulk route takes its ledger from the request path.
  • Several administrative capabilities are exposed through gRPC and ledgerctl with no equivalent HTTP route.
  • Direct HTTP list routes always take the default linearizable read. They expose neither the stale nor the leader consistency selector, nor checkpoint or minimum-sequence options; prepared-query execution is the one HTTP query surface that accepts minLogSequence.
  • Log import and export are unavailable on both surfaces — the interfaces are defined but not implemented.

See HTTP API, the gRPC API, and Limits and Compatibility.

Breaking changes#

Modules removed from the composition#

Payments, Wallets, Flows (Orchestration), Reconciliation, and Webhooks are not composed by a v4.0 stack.

No Ledger v2 compatibility layer#

Ledger 3.0 serves business endpoints under /v3 and does not ship a /v2 shim. Every Ledger v2 integration migrates to the /v3 HTTP contract or to gRPC.

dryRun is not supported#

Ledger v2 accepted dryRun on transaction creation, reverts, and metadata writes to evaluate a write without committing it. Ledger 3.0 has no equivalent.

Ledger v2 capabilities with no Ledger 3.0 equivalent#

Each of these fails a working Ledger v2 client rather than degrading it. Removed Capabilities covers what replaces each one.

  • Account date fields. firstUsage, insertionDate, and updatedAt are gone from the account and can't be used to filter or order accounts.
  • Pre-commit and effective volumes. postCommitVolumes remains and is returned on every transaction, with no flag to toggle it.
  • Per-account balance and volume routes. GET /accounts/{address}/balances and GET /accounts/{address}/volumes are gone.
  • Point-in-time volume queries. /volumes no longer accepts startTime, endTime, or insertionDate.
  • prefix= and reference= query parameters. Both are expressed through filter=.
  • metadataCount in ledger statistics. It is no longer reported.
  • Log import and export. Mirror mode is the supported way to move history into Ledger 3.0.
  • Per-ledger features on ledger creation. There is no equivalent field.