Finality
A LEZ transaction passes through two states, and a client that treats the first as the last will eventually show a user something that gets taken away.
It is included when the sequencer settles it into a zone block, running its public part against live state. A failure that something pays for is included as a revert and still charged; one that nothing pays for, or a malformed transaction, is dropped (Reading the chain). For a private transaction this can be long after proving. It is final when the Logos L1 channel carrying that zone block has itself become immutable.
Only the second is irreversible, and only it is what the indexer’s getLastFinalizedBlockId reports.
Where finality comes from
LEZ does not decide its own finality. It is a channel on the Logos blockchain and inherits that chain’s ordering, and so its notion of immutability.
The L1 runs Cryptarchia, a proof-of-stake consensus whose finality is probabilistic rather than absolute. Its Config carries a security_param, documented in the code as “the k parameter in the Common Prefix property. Blocks deeper than k are generally considered stable and forks deeper than that trigger the additional fork selection rule, which is however only expected to be used during bootstrapping” (logos-blockchain/logos-blockchain: consensus/cryptarchia-engine/src/config.rs).
The latest immutable block is computed from security_param: the engine walks from the current immutable block towards the tip and takes the first block the tip is no more than security_param ahead of, lib_to_tip_blocks (logos-blockchain/logos-blockchain: consensus/cryptarchia-engine/src/lib.rs).
k is not a constant, nor one value per deployment: it is read from the era schedule at the block’s own slot, so it can differ between eras of a chain. The starting values:
| Deployment | security_param |
|---|---|
| Node default | 30 |
Local stack (just run-bedrock, the root compose file) | 3 |
| Testnet deployment template | 120 |
Sources: logos-blockchain/logos-blockchain: nodes/node/era/schedule/0.yaml (era 0 of nodes/node/standalone-deployment-config.yaml) and deployment/ceremony/genesis/testnet/deployment-template.yaml; for the local stack, bedrock/deployment-settings.yaml in this repository.
The local stack has 4-second slots with a block expected in half of them (slot_activation_coeff 1/2), so a local block is final after about half a minute. This repository does not carry the testnet’s slot timing.
No L1 block becomes mathematically irreversible. Depth buys confidence, and k is the depth at which the node treats a block as immutable.
The channel parameter finality_depth (Voting channel parameters) is a different number and does not decide when a zone block is final. It is how many L1 blocks must sit on top of the block where the stake program’s configuration stopped listing a sequencer key before that key’s whole stake can be released. Its doc comment says it must exceed security_param, which the code does not check; it is fixed at genesis: 35 in local.json, 180 in devnet.json and testnet.json (lez/programs/sequencer_stake/core/src/lib.rs).
How a zone block becomes final
A zone is a channel. The sequencer writes its blocks into it as inscriptions, each referencing the previous message by MsgId, so the channel is itself a chain (logos-blockchain/logos-blockchain: core/src/mantle/ops/channel/{mod.rs,inscribe.rs}). Deposits and withdrawals are operations on the same channel, though LEZ rejects withdrawals in this version.
The sequencer then watches the channel: in the code’s words, the channel serving a block “is what makes it irreversible” (lez/sequencer/actors/executor/src/actor/state/bootstrapping.rs). When the L1 finalizes channel messages, the zone blocks they carried move into a final tier. The sequencer collects the newly final blocks and any re-delivered ones into a set it calls irreversible and takes the highest block id:
// Every block at or below the highest finalized one is irreversible, so
// stored blocks there can be marked finalized.
let last_finalized = irreversible.iter().map(|block| block.header.block_id).max();
Everything at or below that height is irreversible, so finality is a single watermark, not a per-block flag.
What final means today
A final zone block has a fixed place in the channel but has not been checked by the L1, which orders the channel’s inscriptions without executing them. Each inscription is signed by one accredited sequencer key, and every node re-executes final blocks itself. A node accepts a bridge deposit mint in one only if it is the mint the node rebuilt from a deposit it saw finalize on L1 and, where the node knows both positions on L1, one that finalized before that block’s channel message. A final block that does not apply is skipped: the final tip stays at the last block that applied, the next valid block at the following height extends it, and where the block was the next entry past the tip and the fault is the producer’s, its signer is reported for slashing (lez/chain_state/src/chain.rs, lez/sequencer/core/src/faults.rs). An invalid block in a final channel message therefore changes no state; it wastes that channel message.
Before the channel message is final, the zone’s recent history can change. The L1 can settle on a different lineage of inscriptions, and zone blocks on the other one leave the head. The sequencer returns their user transactions to the mempool (lez/sequencer/core/src/lib.rs), so an included transaction can disappear and come back in a later block, or not.
What a client should do
Read the watermark from the indexer, or subscribe to it:
getLastFinalizedBlockId -> Option<BlockId>
subscribeToFinalizedBlocks -> stream of finalized block ids
For anything with value attached, show the transaction once included, label it pending, and treat it as done only once its block id is at or below the watermark. The wait is k L1 blocks plus however long the channel takes to carry the zone block, substantial on a 120-deep testnet.
For a transaction with no value attached, inclusion is usually enough.
What a program author should assume
Nothing in a handler can observe finality. A handler sees one message and one actor’s state, and runs on the sequencer or in a proof; in neither case does it know how deep its block is. Time is available only by asserting against the clock, which is itself zone state (System programs).
So finality is a client concern, not a program concern, except at the bridge: a deposit observed in a finalized block is paid out of custody permanently, because its receipt is then in the irreversible tier, and the sequencer drops the pending record tracking it. Until then the payout is reversible along with its block.
Settlement is not finality
A private transaction’s effects on public accounts are applied by the sequencer at settlement, against live state, after the proof is verified (Transactions). That is why a prepared private transaction can be built now and still settle correctly later. Settlement decides whether a transaction takes effect at all; finality decides whether that effect can still be undone.
Only finality involves the L1.