Expand description
Hopper Runtime – canonical semantic runtime surface.
Hopper Runtime owns the public rules, validation, typed loading, CPI semantics, and execution context that authored Hopper code targets. Hopper Native owns the raw execution boundary.
Re-exports§
pub use account::AccountView;pub use account_wrappers::Account;pub use account_wrappers::InitAccount;pub use account_wrappers::Interface;pub use account_wrappers::InterfaceAccount;pub use account_wrappers::InterfaceAccountLayout;pub use account_wrappers::InterfaceAccountResolve;pub use account_wrappers::InterfaceSpec;pub use account_wrappers::Program;pub use account_wrappers::ProgramId;pub use account_wrappers::Signer as HopperSigner;pub use account_wrappers::SystemAccount;pub use account_wrappers::SystemId;pub use account_wrappers::UncheckedAccount;pub use address::Address;pub use audit::AccountAudit;pub use audit::DuplicateAccount;pub use behavior::BehaviorChecked;pub use behavior::BehaviorWrite;pub use behavior::HopperBehavior;pub use borrow::Ref;pub use borrow::RefMut;pub use compact::CompactDynamicLayout;pub use compact::CompactLayout;pub use compact::COMPACT_BODY_OFFSET;pub use compute::check_compute_units;pub use compute::remaining_compute_units;pub use compute::require_compute_units;pub use context::Context;pub use context::ScopedContext;pub use cpi::invoke;pub use cpi::invoke_checked;pub use cpi::invoke_signed;pub use cpi::invoke_signed_checked;pub use crypto::blake3;pub use crypto::blake3_single;pub use crypto::keccak256;pub use crypto::keccak256_single;pub use crypto::recover_ethereum_address;pub use crypto::secp256k1_recover;pub use crypto::sha256;pub use crypto::sha256_single;pub use error::ProgramError;pub use field_map::FieldInfo;pub use field_map::FieldMap;pub use foreign::ExplainExternal;pub use foreign::ExternalAccount;pub use foreign::ExternalBytes;pub use foreign::ExternalChecked;pub use foreign::ExternalExplainSink;pub use foreign::ExternalLens;pub use foreign::ExternalLensValue;pub use foreign::ExternalProof;pub use foreign::ExternalResolve;pub use foreign::ExternalZeroCopy;pub use foreign::ForeignLens;pub use foreign::ForeignManifest;pub use interop::TransparentAddress;pub use lamports::transfer_lamports;pub use lazy::LazyContext;pub use migrate::apply_pending_migrations;pub use migrate::ensure_fits_with_rent;pub use migrate::migrate_layout;pub use migrate::migrate_layout_resizing;pub use migrate::validate_header_for_epoch_migration;pub use migrate::LayoutMigration;pub use migrate::MigrationEdge;pub use policy::HopperInstructionPolicy;pub use policy::HopperProgramPolicy;pub use policy::HopperProgramProfile;pub use proof::AccountProof;pub use proof::ExecutableChecked;pub use proof::HasOneChecked;pub use proof::LayoutChecked;pub use proof::OwnerChecked;pub use proof::SeedsChecked;pub use proof::SignerChecked;pub use proof::TokenExtensionsChecked;pub use proof::Unchecked;pub use proof::WritableChecked;pub use ref_only::HopperRefOnly;pub use remaining::RemainingAccountViews;pub use remaining::RemainingAccounts;pub use remaining::RemainingError;pub use remaining::RemainingExternalAccounts;pub use remaining::RemainingGroup;pub use remaining::RemainingLazy;pub use remaining::RemainingLazySlot;pub use remaining::RemainingMode;pub use remaining::RemainingSigners;pub use remaining::RemainingTyped;pub use remaining::MAX_REMAINING_ACCOUNTS;pub use return_data::get_return_data;pub use return_data::set_return_data;pub use return_data::try_set_return_data;pub use return_data::ReturnData;pub use tail::borrow_address_slice;pub use tail::borrow_bounded_str;pub use tail::read_tail;pub use tail::read_tail_len;pub use tail::seq_capacity_for;pub use tail::seq_region_bytes_for;pub use tail::tail_capacity;pub use tail::tail_payload;pub use tail::write_tail;pub use tail::write_tail_payload;pub use tail::BoundedString;pub use tail::BoundedVec;pub use tail::HopperString;pub use tail::HopperVec;pub use tail::SeqElement;pub use tail::SeqTailRead;pub use tail::SeqTailWrite;pub use tail::TailBytes;pub use tail::TailCodec;pub use tail::TailElement;pub use tail::TailSeq;pub use tail::TailSeqIter;pub use tail::TailSeqMut;pub use tail::TailStr;pub use tail::SEQ_LEN_PREFIX;pub use instruction::CpiAccount;pub use instruction::InstructionAccount;pub use instruction::InstructionView;pub use instruction::Seed;pub use instruction::Signer;pub use instruction::StoredAccountMeta;pub use instruction::StoredInstruction;pub use layout::HopperHeader;pub use layout::LayoutContract;pub use layout::LayoutInfo;pub use result::ProgramResult;pub use segment::FieldCapability;pub use segment::Segment;pub use segment::TypedSegment;pub use segment::FIELD_POLICY_AUTHORITY_GATED;pub use segment::FIELD_POLICY_CHECKED_MATH;pub use segment::FIELD_POLICY_IMMUTABLE_AFTER_INIT;pub use segment::FIELD_ROLE_AUTHORITY;pub use segment::FIELD_ROLE_BALANCE;pub use segment::FIELD_ROLE_DATA;pub use segment::FIELD_ROLE_VERSION;pub use segment_borrow::AccessKind;pub use segment_borrow::SegmentBorrow;pub use segment_borrow::SegmentBorrowGuard;pub use segment_borrow::SegmentBorrowRegistry;pub use segment_lease::SegRef;pub use segment_lease::SegRefMut;pub use segment_lease::SegmentLease;pub use segment_lease::SegmentsMut;pub use write_policy::ParametricWriteRange;pub use write_policy::WritePolicy;pub use write_policy::WriteRange;pub use write_policy::WRITE_POLICY_VIOLATION_PAGE;pub use zerocopy::AccountLayout;pub use zerocopy::WireLayout;pub use zerocopy::ZeroCopy;
Modules§
- account
- Hopper-owned account view for Solana programs.
- account_
wrappers - Typed account wrappers for
#[derive(Accounts)]and Hopper context lowering. - address
- Hopper-owned address type for Solana programs.
- audit
- behavior
- Reusable, parameterized account lifecycle behaviors.
- borrow
- Hopper-owned borrow guards for account data.
- compact
- Tier 1 of the three-tier metadata model: compact account access.
- compute
- Compute-budget introspection helpers.
- context
- Execution context for Hopper programs.
- cpi
- Cross-program invocation for Hopper programs.
- cpi_
event - Self-CPI event emission: the wire format, the verification primitives, and the runtime half of the one-line macro surface.
- crank
- Crank marker type emitted by the
#[hopper::crank]attribute. - crypto
- Runtime cryptography helpers built on Solana syscalls and precompiles.
- dyn_cpi
- Stack-allocated variable-length CPI builder.
- error
- Hopper-owned program error type for Solana on-chain programs.
- field_
map - Field-level layout descriptors for inspectable state contracts.
- foreign
- Manifest-backed foreign-account lenses.
- instruction
- Hopper-owned CPI instruction types.
- interop
- Type interop for Hopper-owned address values.
- lamports
- Gate-aware lamport movement.
- layout
- Layout contracts as runtime truth.
- lazy
- Runtime-typed lazy account parsing.
- log
- Hopper logging helpers.
- memory
- Hopper-owned memory helpers backed by Solana memory syscalls.
- migrate
- Schema-epoch in-place migration runtime.
- option_
byte - Zero-copy, tag-validated optional values for instruction args.
- pda
- Hopper-owned PDA ergonomics on top of the native runtime boundary.
- pod
Pod, the canonical runtime-layer “safe to interpret from raw bytes” marker.- policy
- Program-level safety policy.
- proof
- Proof-carrying account markers.
- ref_
only - Compile-proven borrow-guard constraint.
- remaining
- Remaining-accounts accessor with strict and passthrough modes.
- rent
- Rent-exemption helpers.
- result
- Canonical result type for Hopper programs.
- return_
data - CPI return-data helpers.
- segment
- Runtime-local segment primitive.
- segment_
borrow - Segment-level borrow registry for fine-grained access control.
- segment_
lease - RAII-leased typed segment guards.
- sha256
- Const SHA-256 implementation used for Hopper-owned discriminators.
- syscall
- Small Hopper-owned wrappers for individual runtime syscalls used directly by framework crates.
- syscalls
- Minimal syscall shims exposed through Hopper Runtime.
- system
- Hopper-native System Program CPI builders.
- tail
- Hybrid serialization tail for
#[hopper::state(dynamic_tail = T)]. - token
- Hopper-native SPL Token CPI builders.
- token_
2022_ ext - Zero-copy Token-2022 extension TLV readers.
- utils
- Small utilities for Hopper program authors.
- write_
policy - Declared write sets enforced at borrow acquisition.
- zerocopy
- Unified zero-copy trait family.
Macros§
- address
- Compile-time base58 address literal.
- const_
pda - A program-derived address evaluated at compile time:
const_pda!(PROGRAM_ID, [seed, ...], bump)ispda::const_program_addresswith the seed list spelled inline (each seed anything that casts to&[u8]: a byte-string literal, anAddress::as_array(), a&[u8; N]). See that function for the bump contract and the soundness note. - declare_
id - Declare a program’s on-chain id, mirroring the
declare_id!convention every other Solana framework ships (Anchor, Pinocchio, Quasar). - default_
allocator - Install the default bump allocator over the SVM heap region. Opt-in
counterpart to
no_allocator!for programs that needallocon a cold path. Seehopper_native::BumpAllocator. - err
- Return an error immediately. Parallel to Anchor’s
err!. - error
- Alias for
err!. Anchor-style spelling for ported code. Functionally identical. - fast_
entrypoint - Backward-compatible alias for the fast Hopper entrypoint macro.
- hopper_
emit_ cpi - Emit a Hopper event via self-CPI for reliable indexing, the manual-wiring form.
- hopper_
entrypoint - Declare the explicit Hopper runtime entrypoint bridge.
- hopper_
exact_ entrypoint - Declare the count-exact program entrypoint.
- hopper_
fast_ entrypoint - Without the
simd-0321feature the “fast” entrypoint is an alias for the standard scanning entrypoint. The SIMD-0321 gate is live on every public cluster (mainnet-beta 2026-04-01), so the two-argument form is sound to build; it stays opt-in because the r2 path measured CU-neutral against the fused scanning walk for ~368 bytes of extra.text(see thesimd-0321feature note in the workspaceCargo.toml). Build with--features simd-0321to select the r2 entrypoint. - hopper_
lazy_ entrypoint - Declare the Hopper lazy entrypoint, RUNTIME-typed, matching the
eager
hopper_fast_entrypoint!’s layering. - hopper_
log - Cheap structured logging for hot handlers.
- hopper_
unsafe_ region - Auditable raw-pointer boundary.
- layout_
migrations - Compose a layout’s
LayoutMigration::MIGRATIONSchain from a list of#[hopper::migrate]-emitted edge constants. - lazy_
entrypoint - Backward-compatible alias for the lazy Hopper entrypoint macro.
- migrate_
chain - Typed multi-hop layout migration: probe-and-migrate each declared
hop in declaration order, so ONE call heals an account from ANY
declared starting version to the newest, the chain Quasar’s
pairwise
Migration<From, To>cannot express in one instruction. - msg
- Backend-neutral logging macro.
- no_
allocator - nostd_
panic_ handler - program_
entrypoint - Declare the canonical Hopper program entrypoint.
- require
- Early-return with an error if the condition is false.
- require_
eq - Assert two values are equal, returning an error on mismatch.
- require_
gt - Assert
left > rightstrictly. - require_
gte - Assert
left >= right, returning the supplied error on underrun. Useful for lamport / balance checks. - require_
keys_ eq - Assert two public keys (or any byte slices convertible via
[
AsRef<[u8; 32]>]) are equal. Narrower thanrequire_eq!but matches the ergonomic spelling ecosystem migrators coming from Anchor / Jiminy are familiar with. - require_
keys_ neq - Assert two public keys are not equal. Used for pinning distinct
accounts (authority != user, source != destination). Same coercion
and error semantics as
require_keys_eq!. - require_
lt - Assert
left < rightstrictly. Anchor-parity sibling ofrequire_gt!. Default error isProgramError::InvalidArgumentbecause a failed ordering check most often flags a bad user input. - require_
lte - Assert
left <= right. Anchor-parity sibling ofrequire_gte!. - require_
neq - Assert two values are not equal. Early-returns with the supplied
error on match (or
ProgramError::InvalidArgumentin the short form). Symmetric withrequire_eq!. - seeds
- Convenience macro for building an array of
Seedfrom expressions.
Constants§
Traits§
- Pod
- Marker for types that can be safely overlaid as
&T/&mut Ton raw account bytes at any offset. - Value
Pod - Marker for
Copy + Sizedscalars/arrays that may be read by value from raw bytes withread_unaligned_value(alignment-independent). - Zeroable
- Marker for
Copy + Sizedvalues that are valid for every bit pattern.
Functions§
- read_
unaligned_ value - Read a
ValuePodscalar/array out ofbytesatoffsetby value, tolerating any alignment (usescore::ptr::read_unaligned).