#[repr(C, packed(1))]pub struct HopperHeader {
pub disc: u8,
pub version: u8,
pub flags: u16,
pub layout_id: [u8; 8],
pub schema_epoch: u32,
}Expand description
The canonical 16-byte header at the start of every Hopper account.
The Hopper Safety Audit’s “header epoching” recommendation asked
the reserved tail to carry a schema_epoch: u32 so the runtime
can distinguish schema-compatible minor versions from wire-
incompatible revisions without bumping the single version byte.
byte 0 : disc (u8)
byte 1 : version (u8)
bytes 2-3 : flags (u16 LE)
bytes 4-11 : layout_id (first 8 bytes of canonical wire fingerprint)
bytes 12-15: schema_epoch (u32 LE), audit-addedschema_epoch defaults to 1 at account initialisation via
init_header. Programs that publish a migration bump this
field to advertise the new shape while retaining the same
disc/version; on-chain manifests (future work) pin the
(disc, version, schema_epoch, layout_id) tuple so clients can
verify they’re reading the expected wire format.
Fields§
§disc: u8§version: u8§flags: u16§layout_id: [u8; 8]§schema_epoch: u32Schema-evolution epoch. Little-endian u32. 1 for freshly
initialised headers; bumped by migration helpers.
Implementations§
Source§impl HopperHeader
impl HopperHeader
Trait Implementations§
Source§impl Clone for HopperHeader
impl Clone for HopperHeader
Source§fn clone(&self) -> HopperHeader
fn clone(&self) -> HopperHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more