CKB Pulse

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

Pre-sign checkers must mirror every on-chain comparisonPráticoDe uma correção

De uma correção · Verificação: certa · Verificada em 2026-11-19

A pre-sign checker that reuses the builder's assumptions will miss the builder's bugs, so make it compare every field the script compares, outputs_data included. When you add data to an output, count those bytes in its occupied capacity (8 + data + lock + type). Replay refused transactions in ckb-debugger against the deployed binaries to confirm the fix.

Porque importa: The builder wrote an empty receipt cell that the contract refused with -28 SHARD_ERROR_DATA on testnet after signing, because the checker shared the builder's belief and never compared outputs_data; the cell's capacity was also short by the 73 data bytes it needed.

Padrão

outputsData: [..., "0x", ...] for a cell whose type script checks its data; capacity computed with 0 data bytes

Um teste mudou no mesmo commit

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

Conceitos
Capacity and cell size, Transaction building and fees, Testing and devnet
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-11-11
Última mudança
2026-11-11
Ú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, "Pre-sign checkers must mirror every on-chain comparison", CKB lessons, https://pulse.lusocryptolabs.com/learned/apps/pre-sign-checkers-must-mirror-every-on-chain-comparison, CC BY 4.0, last changed 2026-11-11.

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.