CKB Pulse

All lessons · Apps and UI · Start here · Glossary

Resolving cell deps per cell after redeploying a data-hashed scriptWorkingFrom one fix

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

After a data/data1 type script is redeployed with a new code hash, old cells still run against the old code. Keep a list of retired deployments and query the indexer for every one. Pick each cell's cell dep by matching the codeHash and hashType of that cell's own type script, not a single 'current' manifest entry.

Why it matters: Indexer scans and holdings filters keyed only to the newest code hash miss every cell made under the replaced contract. A transaction built with the newest contract's cell dep for such a cell is built against the wrong code, and the app's checker refuses it.

Pattern

manifest.scripts[name] used for every cell → resolve per cell: deployments.find(d => d.codeHash===cell.type.codeHash && d.hashType===cell.type.hashType)

A test changed in the same commit

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

Concepts
Cell deps and script lookup, Type ID and upgrades, Indexer queries and cell collection
Evidence
From one fix: from one project, checked against its commit
First seen
2026-11-17
Last changed
2026-11-17
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 Apps and UI

All 9 in this topic

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

Cite this lesson
LusoCryptoLabs, "Resolving cell deps per cell after redeploying a data-hashed script", CKB lessons, https://pulse.lusocryptolabs.com/learned/apps/resolving-cell-deps-per-cell-after-redeploying-a-data-hashed, CC BY 4.0, last changed 2026-11-17.

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.