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

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.operator and 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_SEED and contract_storage.last_block_id + 1 with bump).

    • Mutable: Yes.

    • Constraints: Must be a new account initialized with space 8 + 233 (discriminator + Block size)

  • last_deposit: The previous deposit data.

    • Signer: No.

    • Init: No.

    • PDA: Yes (derived from DEPOSIT_SEED and facts.next_state_facts.last_deposit_index with 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_SEED and facts.da_commitment with bump).

    • Mutable: No.

    • Constraints: Must be FactStateStorage where da_fact_state.state is FactState::Finalized.

  • 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

  • Checks that facts.next_state_facts.deposit_root is valid by ensuring it is either all zeros when facts.next_state_facts.last_deposit_index is 0 and last_deposit is None or matches the hash of last_deposit when a deposit exists.

  • Creates and stores a Block with the facts from the input parameter.

  • Increments contract_storage.last_block_id.

  • Logs a ProposeBlock event.

CPI

N/A.

Zellic © 2025Back to top ↑