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_SEEDandblock_idwith bump).Mutable: Yes.
Constraints: The block's
prev_state_factsmust matchcontract_storage.fina_state_facts, the block must not be finalized, and the current time slot should be greater thanblock.slot_proposed + contract_storage.challenge_period_slots.
contract_storage: The global contract storage.Signer: No.
Init: No.
PDA: Yes (derived from
CONTRACT_STORAGE_SEEDwith bump).Mutable: Yes.
Constraints: Must be a
ContractStorageaccount.
Additional checks and behavior
Sets
block.finalizedtotrue.Sets
contract_storage.fina_block_idtoblock_id.Sets
contract_storage.fina_state_factstoblock.facts.next_state_facts.Logs a
FinalizeBlockevent.
CPI
N/A.