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
andblock_id
with bump).Mutable: Yes.
Constraints: The block's
prev_state_facts
must 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_SEED
with bump).Mutable: Yes.
Constraints: Must be a
ContractStorage
account.
Additional checks and behavior
Sets
block.finalized
totrue
.Sets
contract_storage.fina_block_id
toblock_id
.Sets
contract_storage.fina_state_facts
toblock.facts.next_state_facts
.Logs a
FinalizeBlock
event.
CPI
N/A.