Instruction: propose_block
This instruction allows the operator to propose a new block to the bridge.
Input parameters
facts: BlockFacts: Information about the new block to be proposed.
Accounts
operator: The operator account who pays for the new initialized accounts.Signer: Yes.
Init: No.
PDA: No.
Mutable: Yes.
Constraints: Must have the same public key as
contract_storage.operatorand have sufficient lamports to cover the account-creation cost.
block: The account to hold the new proposed block data.Signer: No.
Init: Yes.
PDA: Yes (derived from
BLOCK_STORAGE_SEEDandcontract_storage.last_block_id + 1with bump).Mutable: Yes.
Constraints: Must be a new account initialized with space
8 + 233(discriminator +Blocksize)
last_deposit: The previous deposit data.Signer: No.
Init: No.
PDA: Yes (derived from
DEPOSIT_SEEDandfacts.next_state_facts.last_deposit_indexwith bump).Mutable: No.
Optional: Yes.
Constraints: Must be of type
Deposit.
da_fact_state: The DA commitment account data.Signer: No.
Init: No.
PDA: Yes (derived from
DA_FACT_STORAGE_SEEDandfacts.da_commitmentwith bump).Mutable: No.
Constraints: Must be
FactStateStoragewhereda_fact_state.stateisFactState::Finalized.
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
Checks that
facts.next_state_facts.deposit_rootis valid by ensuring it is either all zeros whenfacts.next_state_facts.last_deposit_indexis0andlast_depositisNoneor matches the hash oflast_depositwhen a deposit exists.Creates and stores a
Blockwith the facts from the input parameter.Increments
contract_storage.last_block_id.Logs a
ProposeBlockevent.
CPI
N/A.