Skip to main content

hopper_exact_entrypoint

Macro hopper_exact_entrypoint 

Source
macro_rules! hopper_exact_entrypoint {
    ( $( ( $disc:literal, $bound:expr, $helper:path ) ),* $(,)? ) => { ... };
}
Expand description

Declare the count-exact program entrypoint.

Reads the discriminator from the SIMD-0321 r2 instruction-data pointer first, then materializes exactly the matched instruction’s declared account bound before dispatching to the helper #[program] generated for it. arms pairs each one-byte discriminator with that bound and that helper. Accounts past the bound are neither materialized nor walked, and there is no transaction-sized pointer table: the entry cost is the declared accounts only. The Context (segment borrow registry, write gate, parametric args) is built exactly as on the scanning path.

The r2 gate (5xXZc66h4UdB6Yq7FzdBxBiRAFMMScMLwHxk2QZDaNZL) is active on mainnet-beta, devnet, and testnet. A runtime that leaves r2 zero gets ProgramError::InvalidArgument back instead of a scanning fallback, which keeps the dual-path code out of the binary; hopper feature-gate reports the gate for a target cluster.