One Fiber LSP, 11,496 channels

We filled one Fiber LSP to 11,496 channels on a local CKB dev chain, with the build and config that our testnet LSP, the one behind the Cellula wallet, ran that day. A payment between two wallets still took 4 to 5 s, as it did with 350 channels.

The channel count turned out not to be the limit. What sizes an LSP is how many wallets are awake at the same moment and how fast it can open channels. Below: how we tested, the numbers, what we changed on the way, and what we would run.

Why we asked

The Cellula wallet pays over Fiber from a browser or a phone, with no node to run. Each wallet’s channel is held at an LSP, a Fiber node that serves many wallets, while the channel keys stay on the device and sign in the wallet’s own signer.

So anyone running an LSP needs to know how many wallets one can carry. Our first estimate, before testing, was 10 to 20 LSPs of about 1,000 channels for 10,000 wallets. A testnet faucet cannot fund 10,000 channels, so we tested on a dev chain instead.

How we tested

Everything that touches the chain matched testnet; only the chain itself was local.

  • Chain: ckb 0.210.0 with Fiber’s dev spec. Testnet’s ckb-auth, FundingLock and CommitmentLock copied byte for byte and deployed by type id.
  • LSP: the binary and config.yml of our testnet LSP, with only paths, ports, keys and the chain changed, and up to 1,500 wallets awake instead of 600 in the 8-core runs. Its own CKB node beside it. LSP support comes from nervosnetwork/fiber#1623.
  • Cores: fnn held to 4 cores for the fill. Then the CKB node, fnn and our gateway held to 8 cores together, as one 8-vCPU server would run them.
  • Wallets: test wallets on a PC, ten to a Node process, each with its own key and the wallet’s signer built for the dev chain.
  • Blocks: every 8 s to measure the opening rate, every 2 s to fill faster.

The fill ran on 2026-10-28. The 11,496 column was measured on 2026-10-29, except the watchtower round, read the evening before at the same count.

What one LSP held

One LSP took every channel we gave it, and payment time barely moved with the count.

Measure 9,988 channels, 4 cores 11,496 channels, 8 cores
One payment, two fresh wallets 3.8 s 3.9, 3.9 and 5.0 s
Ten pairs paying at once, p50 6.4 to 7.7 s 5.4 to 13.0 s
Wallets awake at the same moment not measured 1,420, all served
Restart, until every channel is ready 55 s 68 s
CPU at rest 4 to 6% of one core 7% of one core
Memory after a restart 5.8 GB 6.0 GB
Watchtower round, one core every 10 min 142 s 99 to 117 s

The day before, at 10,698 channels on 8 cores, 1,500 of 1,500 wallets woke. At 11,496 our harness started 1,420: the rest could not reach the one CKB node all test wallets share, and never reached the LSP. Every wallet that started woke, and in both runs the 50 pairs among them paid.

Openings, with 8 s blocks: 40 a minute early in the fill, 61 a minute past 10,000 channels on 8 cores. For comparison, one payment took 3.8 to 4.8 s at 350 channels.

What we changed on the way

Four changes came out of the test, each measured before and after on the same chain.

  1. A tenant registry index in fnn. Finding a tenant by key, or counting tenants, read and deserialized every tenant record on the service actor; registering one tenant did it four times. Now an index is built once from the store, and lsp_get_status answers in 0.6 ms with 10,754 tenants. With 1,500 wallets waking at once, the pairs that paid went from 34 to 50 of 50 and the LSP’s memory from 9.2 to 5.6 GB; waves of 400 openings stopped timing out. Offered upstream as chenyukang/fiber#9, into the LSP support branch.
  2. One shared tenant list in our gateway. A dozen readers each fetched the full list, 4.5 MB at 10,754 tenants. Now they share one copy at most 15 s old.
  3. A faster signer for long histories. The signer stopped decoding its whole state on every request: ten long-history wallets paying one, 128.7 s before, 22.2 s after, the same as fresh wallets.
  4. A smaller signing state. It grew about 14 KB a payment, mostly a recovery record per commitment. In our tests the commitment lock took the newest revocation for any older commitment of the same lane, so the signer now keeps nothing below it. A state after 96 payments went from 1.31 MB to 130 KB, and to about 16 KB with a second pass over settled payments.

The signer changes are live in the Cellula wallet on testnet. We asked the Fiber team on #1623 whether they read the revocation rule the same way. Two other fixes from running this LSP are merged in Fiber: #1703 and #1708.

Sizing an LSP

Eight cores carried 11,496 channels with 1,420 wallets awake at once, the CKB node and our gateway included. We would run two for availability, each on its own CKB node.

What sets the size, in the order we hit it:

  • Wallets awake at once. max_active_tenants caps it; our testnet LSP runs 600. Waking 1,000 wallets at once kept about 7 cores busy for two minutes.
  • Opening rate. 40 to 61 channels a minute. Waves of 100 openings were always clean.
  • The watchtower round. One core, every 10 minutes: 1.8 s at 290 channels, 45 s at 5,000, 99 to 142 s from 9,988 to 11,496.
  • Memory. fnn holds about 6 GB at rest with 11,496 channels, and 6.5 to 8.6 GB with about 1,400 wallets awake. It peaked at 13.5 GB while opening 10,000 channels back to back, so size RAM for the peak.

What’s next

We want to run this on CKB mainnet: a public LSP that any wallet signing with Fiber’s LSP SDK can use, with the signer changes offered to that SDK. Before we put it to the Community Fund DAO, we would like to hear from the Fiber team and from anyone building a wallet on Fiber.

Talk to us

These numbers come from a copy of the LSP behind the Cellula wallet on testnet. Building an LSP or a wallet on Fiber? Reply here, or find us at cellula.id and t.me/cellula_id. Thanks to the Fiber team for fnn and the LSP support this is built on.

8 Likes

Great work! 11.5k channels on a single LSP is pretty encouraging, especially with the optimisations you found along the way.

Would be interesting to see some sustained concurrent payment tests across separate LSPs next, just to get a better feel for real-world scaling.

Also i noticed the watchtower takes around 100s per scan at this scale. Curious whether that’s mainly database reads/scanning or CKB indexer/RPC overhead. Might be a good next optimisation target.

Really nice progress.

2 Likes

You mentioned that a single payment took 3.8–4.8 seconds with 350 channels. Have you measured payment time with the smallest possible setup?

Using WebSocket subscriptions on the client to receive signing requests could significantly reduce per-payment latency. In my own tests with a minimal setup, I’m seeing around 500 ms per payment, although that’s under fairly ideal conditions.

2 Likes

Also, I think we might need to control the test variables a bit more carefully, especially CPU configuration (4 vs 8 cores) and whether store_sync_writes is enabled. Otherwise, it’s hard to isolate the actual bottleneck.

2 Likes

Thanks, Arthur. We ran both on 2026-10-29 on the same dev chain: LSP A with the 11,496 channels on 8 cores, a second LSP B on 4 cores, and lanes where a wallet at A and a wallet at B pay each other 0.1 CKB in turn, the next payment as soon as the last one ends.

  • At first our wallets could not pay across: “no path found”. Each LSP sees only its own wallets’ private channels, and our wallet sent every payment with its own LSP as the only trampoline. With both LSPs as trampolines (the invoice names the payee’s), it worked. That was our wallet, not Fiber.
  • 50 lanes for 5 minutes, with 1, 5 or 10 channels enabled between the LSPs: A to B p50 69.6, 24.2 and 18.5 s; 230, 515 and 534 payments; none failed. With 10 channels most payments still took one of them (80 of 172 log mentions), since routing sorts parallel channels by outbound liquidity, then capacity, then update time.
  • 30 minutes, 10 channels, 50 lanes across and 10 inside each LSP: 4,667 payments, none failed, flat over the run. p50: A to B 32.9 s, B to A 38.9 s, inside A 33.8 s, inside B 9.6 s. Alone, one payment across took 4.8 to 7.0 s in the same runs.
  • The slow side was A: 3.3 cores against B’s 0.4 for the same cross payments. Profiled with frame pointers, 91% of A’s CPU was in has_pending_tlc_for_payment_hash. When a fulfilled TLC is removed and the current channel does not hold the payment hash, it loads and decodes every channel state in the store, so each settled payment costs more as the LSP’s channels grow. The function is the same in develop (11846d65).

The watchtower: neither the database nor the indexer. In a round at 11,496 channels (93 to 115 s), fnn used 85 to 146 CPU seconds and the CKB node 5 to 8. About 70% of fnn’s time went to OpenSSL reading certificates, because run_periodic_check builds a new CkbRpcClient for every channel. With one client for the whole round (a 9 line change on our build), a round took 4.7 to 7.1 s, with the same 22,997 get_transactions calls and no errors. Develop still builds one per channel.

1 Like

Thanks, Joii, you were right. We traced every call of a payment between two wallets at one LSP on a local dev chain (2026-10-30). Of a 6.1 s payment, about 4.5 s were our wallet’s own clocks: the payee asked for signatures every second, read its channel every 3 s and its invoices every 5 s, and the payer asked every second whether it was paid. Nagle’s algorithm added 40 ms to half of our gateway’s calls.

The wallet now waits on the LSP instead. Our fnn build sends a hosted wallet’s store writes to subscribe_store_changes as TenantActivity { tenant_id }, and our gateway, which the wallets go through, answers a long poll when that wallet’s changes move. The gateway also sets TCP_NODELAY. Medians, old wallet against new, same machine and LSP:

before after
no network delay 4.49 s 0.55 s
80 ms added to each call 6.55 s 3.17 s

What is left is 12 signatures in a row: 4 to add the TLC at the payer, 4 at the payee, 4 to remove it at the payee. The payer is paid only after the last, since the upstream TLC settles once the downstream removal is committed. At 80 ms a call that is still about a second.

On our testnet LSP (20 payments, medians), with 80 ms a call and the backup our wallet writes before each signature: 4.98 s until the payee has it, 7.29 s until the payer sees it done. Without the delay and the backup: 1.62 and 2.33 s. The 80 ms adds about 4 s and the backup about 1 s.

3 Likes

Agreed, the table mixes them. What we can say:

  • Writes were synced in every run. All our builds sync each write since 2026-10-12, the same effect as fiber.store_sync_writes: true on develop, where the default is false. We have not measured payments with sync off.
  • Cores: in the 9,988 column only fnn was held to 4 cores. In the 11,496 column the CKB node, fnn and our gateway shared 8. So the columns differ in channels, cores and what shares them.
  • The single payment times in that table could not show either. At the 11,496 channel LSP itself, one payment went from 5.2 s to 0.5 to 0.8 s once our wallet stopped waiting on its own clocks (2026-10-30). Most of those 3.8 to 5.0 s was our wallet.
  • CPU did show under load: in the two LSP run, A used 3.3 cores against B’s 0.4 for the same cross payments, 91% of it in has_pending_tlc_for_payment_hash.

With the wallet no longer waiting on clocks, one change at a time (sync off and on, 4 and 8 cores, same build and channels) would now measure the LSP. We have not run it yet.

2 Likes

Thank you very much for the thorough testing, detailed profiling, and PRs! We really appreciate the effort you’ve put into testing Fiber at this scale and tracking down specific bottlenecks.

We’re working through your PRs and merging them, and some have already landed. Once we complete the LSP support and V2 message handling work, the Fiber team will also focus more on improving performance. Your findings and contributions are very helpful in identifying where we should focus those efforts.

3 Likes

Working on fiber has been a worthy challenge, incredibly rewarding. Thanks you for your feedback and efforts.

1 Like

@quake @LusoCryptoLabs

Maybe we should add upstream support for tenant-scoped business event subscriptions, reusing the internal store watcher where appropriate while keeping subscribe_store_changes restricted to trusted internal services.

2 Likes