CKB Pulse

Todas as lições · Apps and UI · Começa aqui · Glossário

Resolving cell deps per cell after redeploying a data-hashed scriptPráticoDe uma correção

De uma correção · Verificação: certa · Verificada em 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.

Porque importa: 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.

Padrão

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

Um teste mudou no mesmo commit

Está ao lado da correcção. Nós não o corremos.

Conceitos
Cell deps and script lookup, Type ID and upgrades, Indexer queries and cell collection
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-11-17
Última mudança
2026-11-17
Última verificação
2026-11-19
Verificação contra o commit
certa: a lição sai do commit e continua a valer no código de hoje

Fontes (1)

Mais sobre Apps and UI

Ver as 9 deste tema

Manténs um projeto de onde esta lição veio? Confirma ou corrige

Citar esta lição
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.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.