Expand description
Hopper Native – sovereign raw backend for Solana.
Direct syscall-native runtime layer purpose-built for zero-copy state frameworks. A sovereign substrate with genuinely novel features no other framework provides:
- Alignment-safe wire types:
LeU64,LeU32,LeBooletc. – alignment-1 types with checked arithmetic by default, explicit endianness, const constructors. The foundation for safe zero-copy structs. (wire) - Verified CPI:
LamportSnapshot,DataFingerprint– snapshot state before CPI, verify post-conditions after. First framework to provide substrate-level CPI result verification. (verify) - Cross-program lenses:
read_address(),read_le_u64()– read specific fields from foreign program accounts by byte offset without importing their types at compile time. (lens) - Instruction introspection:
is_cpi(),require_top_level(),require_ed25519_instruction()– CPI guard and precompile signature verification patterns. (introspect) - SVM-optimized memory:
memcpy,memset,memcmp– dispatch to the VM’s JIT-compiled intrinsics instead of Rust’s libc. (mem) - Lazy account parsing:
LazyContext– dispatch on instruction data before touching any accounts, parse only what you need. (lazy) - Compile-time capability types:
SignerView,WritableView,MutableView,OwnedView– prove account roles in the type system with zero runtime cost after boundary validation. (capability) - Zero-copy struct projection:
project::<T>()with bounds, alignment, and discriminator checks in one operation. (project) - CU budget tracking:
CuBudgetsnapshots andcu_trace!macro for structured profiling. (budget) - Hash syscall wrappers:
sha256,keccak256– zero-alloc multi-part hashing via direct syscalls. (hash) - Typed CPI return data:
invoke_and_read::<T>()– CPI + deserialization in one step. (return_data) - Chainable validation:
account.check_signer()?.check_writable()?– Steel-inspired fluent validation, improved and built in. (account_view) - Packed flags:
account.flags(),account.expect_flags(SIGNER|WRITABLE)– check multiple account properties in a single comparison. (account_view) - Full sysvar access: Clock, Rent, EpochSchedule with computed
helpers. (
sysvar) - Batch operations:
close_and_transfer,realloc_checked,require_account_typewith proper atomicity. (batch)
no_std, no_alloc, zero external runtime dependencies.
Re-exports§
pub use account_view::AccountView;pub use address::Address;pub use borrow::Ref;pub use borrow::RefMut;pub use error::ProgramError;pub use pod::Pod;pub use raw_account::RuntimeAccount;pub use budget::CuBudget;pub use capability::ExecutableView;pub use capability::MutableView;pub use capability::OwnedView;pub use capability::ReadonlyView;pub use capability::SignerView;pub use capability::WritableView;pub use lazy::LazyContext;pub use pda::verify_pda_strict;pub use pda::find_bump_for_address;pub use pda::read_bump_from_account;pub use pda::verify_pda_from_stored_bump;pub use return_data::ReturnData;pub use verify::BalanceSnapshot;pub use verify::DataFingerprint;pub use verify::LamportSnapshot;pub use wire::LeBool;pub use wire::LeI16;pub use wire::LeI32;pub use wire::LeI64;pub use wire::LeU128;pub use wire::LeU16;pub use wire::LeU32;pub use wire::LeU64;pub use instruction::CpiAccount;pub use instruction::InstructionAccount;pub use instruction::InstructionView;pub use instruction::Seed;pub use instruction::Signer;
Modules§
- account_
view - RuntimeAccount memory layout and AccountView zero-copy wrapper.
- address
- Solana address type – 32-byte public key.
- batch
- Batch account operations.
- borrow
- Deterministic borrow guards for account data.
- budget
- Compute-unit budget tracking and instrumentation.
- capability
- Compile-time account capability types.
- cpi
- Cross-program invocation via
sol_invoke_signed_c. - entrypoint
- Program entrypoint ownership for Hopper Native.
- error
- Program error type for Solana on-chain programs.
- expert
- Expert optimized path for Hopper Native.
- hash
- Cryptographic hash functions via Solana syscalls.
- instruction
- CPI instruction types: InstructionView, InstructionAccount, Seed, Signer.
- introspect
- Instruction introspection – stack height and sibling instruction access.
- lazy
- Lazy account parser – on-demand account deserialization.
- lens
- Cross-program account lenses – read foreign fields by offset.
- log
- Zero-allocation logging via Solana syscalls.
- mem
- SVM-optimized memory operations.
- pda
- PDA (Program Derived Address) helpers.
- pod
- Substrate-level
Podmarker. - raw
- Raw escape hatch for Hopper Native.
- raw_
account - Raw account header for the Solana loader input buffer.
- raw_
input - Raw loader input parsing for Hopper Native.
- return_
data - CPI return data retrieval and typed deserialization.
- safe
- Safe default path for Hopper Native.
- syscalls
- Raw Solana syscall declarations.
- system
- System program CPI instructions.
- sysvar
- Sysvar access via direct syscalls.
- token
- SPL Token program CPI instructions.
- verify
- Verified CPI – pre/post state assertions around cross-program invocations.
- wire
- Alignment-safe wire types for zero-copy account data.
Macros§
- address
- Compile-time base58 address literal.
- cu_
measure - Run a closure and log the CU consumed by it (feature-gated).
- cu_
trace - Structured CU tracing macro for profiling.
- fast_
entrypoint - Backward-compatible alias for
hopper_fast_entrypoint!. - hopper_
fast_ entrypoint - Declare a fast two-argument Hopper Native program entrypoint.
- hopper_
lazy_ entrypoint - Declare the canonical lazy program entrypoint that defers account parsing.
- hopper_
program_ entrypoint - Declare the canonical Hopper Native program entrypoint.
- lazy_
entrypoint - Backward-compatible alias for
hopper_lazy_entrypoint!. - msg
- Convenience macro for logging. Equivalent to
hopper_native::log::log(msg). - no_
allocator - Set up a no-op global allocator that aborts on allocation.
- nostd_
panic_ handler - Default no_std panic handler that aborts immediately.
- program_
entrypoint - Backward-compatible alias for
hopper_program_entrypoint!. - seeds
- Convenience macro for building an array of
Seedfrom expressions.
Constants§
- MAX_
PERMITTED_ DATA_ INCREASE - Maximum permitted data increase during realloc (10 KiB).
- MAX_
TX_ ACCOUNTS - Maximum number of accounts in a single transaction.
- NOT_
BORROWED - Borrow state value indicating the account is not currently borrowed.
- SUCCESS
- Success return code for the BPF entrypoint.
Traits§
- Projectable
- Marker trait for types that can be safely projected from raw account data.
Type Aliases§
- Program
Result - Result type for Solana program instructions.