1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
[]
= "hopper-core"
= "0.1.0"
= "2021"
= "Apache-2.0"
= ["BluefootLabs <contact@bluefootlabs.com>", "MoonManQuark"]
= "Core engine for the Hopper zero-copy state framework. Account memory architecture, ABI types, validation graphs, phased execution, zero-copy collections, layout evolution, and cross-program interfaces."
= "https://github.com/BluefootLabs/Hopper-Solana-Zero-copy-State-Framework"
= "https://hopperzero.dev"
= "https://docs.rs/crate/hopper-core/0.1.0"
= "README.md"
= ["solana", "zero-copy", "state", "framework", "no-std"]
= ["no-std", "embedded"]
[]
= "hopper_core"
[]
= { = true, = false }
# Optional: const-SHA256 is used for the canonical layout_id fingerprint and
# for Anchor-compat discriminators. Under the `spartan` profile the crate
# compiles without pulling sha2, substituting a pure-core FNV-1a fallback for
# layout_id generation (Anchor-compat helpers are compiled out entirely).
= { = true, = true }
[]
= { = true }
# The audit-regression tests in `frame` need direct access to the
# native substrate's `RuntimeAccount` layout so they can fabricate
# accounts without spinning up the full BPF entrypoint. Only pulled in
# as a dev-dep; the main library never names `hopper-native`.
= { = true }
[]
= ["programs", "hopper-native-backend", "advanced", "cpi", "collections", "sha2-layout-id", "anchor-compat"]
= []
= []
= ["hopper-runtime/hopper-native-backend"]
= ["hopper-runtime/legacy-pinocchio-compat"]
= ["hopper-runtime/solana-program-backend"]
= ["hopper-runtime/cpi"]
# SHA-256 backed layout_id generation. ON by default. Pulls `sha2-const-stable`
# as a hard build dep. Spartan programs turn this off; `hopper_layout!` then
# hashes via a const FNV-1a-64 implementation that lives entirely in
# `hopper-core`. The fingerprint space is still 8 bytes and collision-resistant
# for realistic program sizes, but it is NOT byte-equal to an SHA-256-derived
# layout_id, so off-chain tooling must be rebuilt with the same feature set.
= ["dep:sha2-const-stable"]
# Anchor discriminator compat helpers (`anchor_discriminator`,
# `anchor_account_discriminator`). These require SHA-256 by definition (the
# Anchor ABI specifies SHA-256), so they implicitly enable `sha2-layout-id`.
# Drop them to shave the last bit of Anchor-adjacent surface.
= ["sha2-layout-id"]
# Advanced subsystems (opt-in, not hot-path).
# These modules are valuable but sit outside the core access model.
# Programs that only need load/load_mut/segment_ref/segment_mut can
# disable `advanced` for a leaner compile surface.
= ["frame", "receipt", "policy", "graph", "migrate", "virtual-state", "diff", "explain"]
= []
= ["diff"]
= []
= []
= []
= []
= []
= []
# Zero-copy collections (FixedVec, RingBuffer, SlotMap, BitSet, Journal,
# Slab, PackedMap, SortedVec). Default on. Turn off for programs that
# only touch raw fields and segments, to drop ~800 lines of compile-time
# surface. Not part of `advanced` because collections are useful in
# hot-path code while advanced subsystems are not.
= []
# Spartan profile: the "Pinocchio-parity" build. Turning this on via
# `default-features = false, features = ["spartan"]` leaves only the raw
# access primitives (load / load_mut / segment_ref / segment_mut), the
# runtime backend the caller picked, and nothing else; no advanced
# subsystems, no collections, no Anchor compat, no third-party deps.
# The build target is "zero deps outside of hopper-runtime itself".
= ["programs"]
[]
= { = "allow", = [
'cfg(target_os, values("solana"))',
'cfg(feature, values("frame", "receipt", "policy", "graph", "migrate", "virtual-state", "diff", "explain", "advanced", "cpi", "collections", "sha2-layout-id", "anchor-compat", "spartan"))',
] }