CKB Pulse

All lessons · Developer tooling · Start here · Glossary

Separate submit and commit verification environmentsAdvancedFrom one fix

From one fix · Check: right · Checked 2026-11-19

When verifying a transaction offline with ckb-script, use TxVerifyEnv::new_submit(&tip) for the submit phase. It evaluates since at tip number + 1 + proposal_window.closest, so it is more permissive than inclusion in the next block. For the commit phase, use TxVerifyEnv::new_commit(&candidate), where candidate is a header whose parent_hash is the real tip and whose number is tip + 1, and take median time from env.parent_hash() rather than tip.parent_hash().

Why it matters: Treating the tip as the candidate block evaluates block and median time since locks at the wrong height, so a transaction can be reported valid at submit and then be rejected as immature when it is actually committed.

Pattern

Treating tip_header as the candidate block and using TxVerifyEnv::new_commit(&tip) with median time taken from tip.parent_hash(), instead of separate submit and commit environments where the commit candidate is a verified direct child of the real tip.

A test changed in the same commit

It sits next to the fix. We did not run it.

Concepts
Since and time locks, Testing and devnet
Evidence
From one fix: from one project, checked against its commit
First seen
2026-11-12
Last changed
2026-11-12
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 Developer tooling

All 35 in this topic

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

Cite this lesson
LusoCryptoLabs, "Separate submit and commit verification environments", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/separate-submit-and-commit-verification-environments, CC BY 4.0, last changed 2026-11-12.

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.