Assessment reports>N1 Bridge>Threat Model>Instruction: finalize_block

Instruction: finalize_block

This instruction finalizes a proposed block.

Input parameters

  • block_id: u64: The ID for the block to finalize.

Accounts

  • payer: The signer for this transaction.

    • Signer: Yes.

    • Init: No.

    • PDA: No.

    • Mutable: Yes.

    • Constraints: None.

  • block: The block to be finalized.

    • Signer: No.

    • Init: No.

    • PDA: Yes (derived from BLOCK_STORAGE_SEED and block_id with bump).

    • Mutable: Yes.

    • Constraints: The block's prev_state_facts must match contract_storage.fina_state_facts, the block must not be finalized, and the current time slot should be greater than block.slot_proposed + contract_storage.challenge_period_slots.

  • contract_storage: The global contract storage.

    • Signer: No.

    • Init: No.

    • PDA: Yes (derived from CONTRACT_STORAGE_SEED with bump).

    • Mutable: Yes.

    • Constraints: Must be a ContractStorage account.

Additional checks and behavior

  • Sets block.finalized to true.

  • Sets contract_storage.fina_block_id to block_id.

  • Sets contract_storage.fina_state_facts to block.facts.next_state_facts.

  • Logs a FinalizeBlock event.

CPI

N/A.

Zellic © 2025Back to top ↑