CKB Pulse

Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário

Advancing devnet median time for time-lock testsPráticoDe uma correção

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

With the IntegrationTest RPC module enabled, call get_block_template, set current_time (hex ms) to a future value, and submit it with generate_block_with_template, block by block. Since/timestamp checks use the median time, which only moves after many future-dated blocks. Poll get_blockchain_info.median_time until it reaches the target rather than mining one far-future block.

Porque importa: A single future-dated block barely moves the median of recent block timestamps, so median_time stays below the target and time-locked spends stay immature, which fails the scenario's 'median time did not reach the target' check.

Padrão

t = get_block_template(null,null,null); t.current_time = hex(tipMs + step); generate_block_with_template(t); loop until median_time >= target
Conceitos
Testing and devnet, Since and time locks
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-11-15
Última mudança
2026-11-15
Ú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 CKB node, RPC and indexer

Ver as 45 deste tema

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

Citar esta lição
LusoCryptoLabs, "Advancing devnet median time for time-lock tests", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/advancing-devnet-median-time-for-time-lock-tests, CC BY 4.0, last changed 2026-11-15.

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.