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)
- 2026-11-15 · psawyerberlin/ckb-revocable-timelock · more from this project
More about CKB node, RPC and indexer
- Decoding the packed epoch field (number, index, length)
- get_transaction returns an object with a null transaction for rejected and unknown txs
- CKB log subscription notifications may carry params.result as a JSON string
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.