CKB Pulse

All lessons · Light client · Start here · Glossary

Light client set_scripts "all" replaces the whole registered script setWorkingFrom one fix

From one fix · Check: right · Checked 2026-11-19

The CKB light client's set_scripts with the all command replaces every registered script, so a call carrying only one wallet's lock script unregisters all other wallets. When several scripts must stay tracked, either pass the full set with each script's own start block, or use the partial command to update only the changed script. If registrations can race, serialise them so a stale full set cannot overwrite a newer one.

Why it matters: Re-registering one wallet with the all command after a sync mode change silently stopped syncing every other wallet in the app.

Pattern

Avoid
setScriptsAndRecord(scriptStatuses + ..., listOf(activeWalletId) + ..., LightClientNative.CMD_SET_SCRIPTS_ALL)

Taken from the commit, shortened.

A test changed in the same commit

It sits next to the fix. We did not run it.

Concepts
Indexer queries and cell collection, Network and RPC reliability
Evidence
From one fix: from one project, checked against its commit
First seen
2026-09-30
Last changed
2026-09-30
Last checked
2026-11-19
Check against the commit
right: the lesson follows from its commit and still holds in the code today

Sources (1)

More about Light client

All 5 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "Light client set_scripts "all" replaces the whole registered script set", CKB lessons, https://pulse.lusocryptolabs.com/learned/light-client/light-client-set-scripts-all-replaces-the-whole-registered-s, CC BY 4.0, last changed 2026-09-30.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.