Skip to main content

check_common_consensus_rules

Function check_common_consensus_rules 

Source
fn check_common_consensus_rules(
    tx: &Transaction,
    height: Height,
    network: &Network,
) -> Result<(), TransactionError>
Expand description

Applies every consensus rule that a transaction must satisfy in both block and mempool context.

§Correctness

BlockTxVerifier and MempoolTxVerifier are separate services with no shared code path, so a rule added to only one of them silently makes the two disagree. When the mempool accepts a transaction that block verification would reject, that transaction reaches block templates but makes the resulting block unmineable, stalling block production for every pool running Zebra. See https://github.com/ZcashFoundation/zebra/issues/9301.

Any new rule that applies to a transaction regardless of where it is being verified belongs here, so that both verifiers pick it up. Rules that only apply to one context (mempool policy such as ZIP-317 and input standardness, or whole-block context such as the block’s own time) stay in the respective service.

The is_coinbase branches are unreachable from mempool verification, which rejects coinbase transactions before calling this.