Skip to main content

Module frame

Module frame 

Source
Expand description

Borrowed-state execution context.

The Frame is Hopper’s execution model. It wraps the instruction’s accounts and data, enforcing single-mutable-borrow discipline and phased execution.

§Execution Phases

  1. Resolve – Parse accounts from the input slice into named typed slots
  2. Validate – Run the validation graph (account-local, cross-account, state-transition)
  3. Borrow – Obtain zero-copy overlays with borrow discipline
  4. Mutate – Execute state changes through verified mutable references
  5. Emit – Fire events
  6. Commit – (implicit: Solana runtime commits on success)

The Frame ensures that:

  • Each account is borrowed at most once mutably
  • Immutable borrows can coexist
  • Validation runs before mutation
  • Events are emitted after state changes

Modules§

args
Phase-specific instruction argument decomposition.
phase
Phased execution builder for the Frame.

Structs§

Frame
Execution frame holding the instruction’s accounts and data.
FrameAccount
Immutable account view within a Frame.
FrameAccountMut
Mutable account view within a Frame.

Constants§

MAX_FRAME_ACCOUNTS
Maximum accounts in a single frame. Matches Solana’s transaction limit.