CKB Pulse

Todas as lições · Developer tooling · Começa aqui · Glossário

Devnet commits need the proposal windowPráticoDe uma correção

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

On a devnet a transaction is not committed as soon as you send it: it must be proposed in one block and committed in a later one inside the proposal window, so a fixed small number of mined blocks can still leave the old cell state. Before asserting, mine a couple of blocks at a time in a bounded loop and re-read the cell state until it equals the expected value or the retry limit is reached.

Porque importa: Without the bounded mine and re-read loop, the assertion can read the cell state before the Renew transaction is committed and fail with the old deadline, even though the transaction is valid.

Padrão

send(tx); const after = await readState(); assert(after...) → loop { mine(2); re-read } until the state matches or N tries are used up
Conceitos
Testing and devnet
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 Developer tooling

Ver as 35 deste tema

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

Citar esta lição
LusoCryptoLabs, "Devnet commits need the proposal window", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/devnet-commits-need-the-proposal-window, 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.