CKB Pulse

Todas as lições · Rust scripts and ckb-std · Começa aqui · Glossário

Relative block number since uses top byte 0x80, not the absolute epoch 0x20PráticoDe uma correção

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

Under RFC 0017 since encoding, bit 63 marks relative and bits 61 to 62 select the metric (00 is block number), so a relative block count is RELATIVE_BLOCK_FLAG (0x8000000000000000) OR the count, and 256 blocks becomes 0x8000000000000100. In this commit the type script checks since >> 56 == 0x80, so reusing the absolute epoch form (top byte 0x20) is rejected on chain with an error code that does not name the since as the cause.

Porque importa: If the absolute epoch flag 0x20 is reused where the script expects a relative block number, the transaction is refused on chain with a generic script error that does not point at the since.

Padrão

Preferir
return RELATIVE_BLOCK_FLAG | n;

Tirado do commit, encurtado.

Um teste mudou no mesmo commit

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

Conceitos
Since and time locks
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
em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga

Fontes (2)

Mais sobre Rust scripts and ckb-std

Ver as 35 deste tema

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

Citar esta lição
LusoCryptoLabs, "Relative block number since uses top byte 0x80, not the absolute epoch 0x20", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/relative-block-number-since-uses-top-byte-0x80-not-the-absol, 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.