CKB Pulse

All lessons · CKB node, RPC and indexer · Start here · Glossary

Advancing devnet median time for time-lock testsWorkingFrom one fix

From one fix · Check: right · Checked 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.

Why it matters: 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.

Pattern

t = get_block_template(null,null,null); t.current_time = hex(tipMs + step); generate_block_with_template(t); loop until median_time >= target
Concepts
Testing and devnet, Since and time locks
Evidence
From one fix: from one project, checked against its commit
First seen
2026-11-15
Last changed
2026-11-15
Last checked
2026-11-19
Check against the commit
right: the lesson follows from its commit and still holds in the code today

Sources (1)

More about CKB node, RPC and indexer

All 45 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
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.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.