Todas as lições · Rust scripts and ckb-std · Começa aqui · Glossário
Absolute epoch since needs the 0x20 metric flag in the top bytePráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
An input since meaning "not before epoch N" must be 0x2000000000000000 | N: top byte 0x20 (absolute, epoch metric) with the epoch number in the low 24 bits. Without the flag the node reads the value as an absolute block number, which for any realistic epoch is already past, so the node enforces no epoch bound. A script that reads since as an epoch must check the metric flag itself, as this project's contract does by refusing a since whose top byte is not 0x20.
Porque importa: Without the flag the node treats an epoch number as a long-past block number. The intended epoch lower bound is then not enforced by the node, and the input is either unlocked early or refused by a script that checks the metric.
Builder side rule for setting the epoch flag.
Padrão
{ previousOutput: shard.outPoint, since: ABSOLUTE_EPOCH_FLAG | epoch }Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- toastmanAu/daowow:
apps/web/test/freeze-tx.test.js - toastmanAu/daowow:
apps/web/test/entry-tx.test.js
- Conceitos
- Since and time locks
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-09-25
- Última mudança
- 2026-09-25
- Ú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 (2)
- 2026-09-25 · toastmanAu/daowow · mais deste projeto
- 2026-09-23 · toastmanAu/daowow · mais deste projeto
Mais sobre Rust scripts and ckb-std
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Absolute epoch since needs the 0x20 metric flag in the top byte", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/absolute-epoch-since-needs-the-0x20-metric-flag-in-the-top-b, CC BY 4.0, last changed 2026-09-25.