CKB Pulse

Todas as lições · Developer tooling · Começa aqui · Glossário

Verify header_deps against independently fetched headers, not against the tx's own listPráticoDe uma correção

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

When checking a transaction that uses header_deps for entropy (for example, headers at fixed offsets from a cell's inclusion block), derive the expected headers yourself: get the creating tx with get_transaction, then get_header on its block_hash, then get_header_by_number for the scheduled heights. Only then compare them to the tx's header_deps. Taking the headers from header_deps makes the check circular, since it only confirms the transaction agrees with itself.

Porque importa: A checker that takes headers from the transaction's own header_deps would approve a transaction listing the wrong blocks, so wrong entropy inputs would reach the node marked safe to send.

Padrão

Preferir
const h = await rpc.call("get_header_by_number", ["0x" + n.toString(16)]);

Tirado do commit, encurtado.

Conceitos
Since and time locks, Network and RPC reliability
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-10-02
Última mudança
2026-10-02
Ú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 Developer tooling

Ver as 35 deste tema

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

Citar esta lição
LusoCryptoLabs, "Verify header_deps against independently fetched headers, not against the tx's own list", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/verify-header-deps-against-independently-fetched-headers-not, CC BY 4.0, last changed 2026-10-02.

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.