Todas as lições · Rust scripts and ckb-std · Começa aqui · Glossário
Type ID code cell upgrade keeps code_hash but spends the old cell depPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-23
To upgrade a contract deployed under a Type ID type script, spend the old code cell and create exactly one output carrying the identical Type ID type script (same args) with the new binary as data. The type hash that cells reference with hash_type type stays the same. The old out point is spent, though, so any client that pins the code cell dep by tx hash and index must switch to the new out point, or its transactions are rejected.
Porque importa: After the upgrade, every SDK or demo transaction that still lists the old, now spent, code cell out point as a cell dep is rejected until the config points at the new out point.
Padrão
outputs: [{ lock: deployerLock, type: typeScript, capacity: requiredCapacity }],Tirado do commit, encurtado.
- Conceitos
- Type ID and upgrades, Cell deps and script lookup
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-21
- Última mudança
- 2026-11-21
- Última verificação
- 2026-11-23
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-11-21 · salmansarwarr/Tranfr · mais deste projeto
Mais sobre Rust scripts and ckb-std
- Delegating script validation via exec to a hash bound cell dep
- Separate builds for test-only contract constants
- Check that a derived successor type args match the spent cell's type args
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Type ID code cell upgrade keeps code_hash but spends the old cell dep", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/type-id-code-cell-upgrade-keeps-code-hash-but-spends-the-old, CC BY 4.0, last changed 2026-11-21.