CKB Pulse

All lessons · CKB node, RPC and indexer · Start here · Glossary

CKB log subscription notifications may carry params.result as a JSON stringWorkingFrom one fix

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

When subscribing to the CKB node's "log" topic over the TCP subscription RPC, the notification's params.result can be a JSON-encoded string of the log entry (message, level, target, date) rather than an object. Parse it with JSON.parse when it is a string, and skip malformed payloads instead of stopping the stream; otherwise script debug output (target ckb_script::verify) is silently dropped.

Why it matters: A client that only accepts an object in params.result discards every log notification CKB sends as a JSON string, so script debug output from ckb_script::verify never reaches the developer.

Pattern

Prefer
if (typeof result === 'string') { try { result = JSON.parse(result); } catch { return null; } }

Taken from the commit, shortened.

A test changed in the same commit

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

Concepts
Network and RPC reliability, Testing and devnet
Evidence
From one fix: from one project, checked against its commit
First seen
2026-11-09
Last changed
2026-11-09
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 CKB node, RPC and indexer

All 45 in this topic

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

Cite this lesson
LusoCryptoLabs, "CKB log subscription notifications may carry params.result as a JSON string", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/ckb-log-subscription-notifications-may-carry-params-result-a, CC BY 4.0, last changed 2026-11-09.

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.