Skip to main content

Calldata construction


Build an update calldata

This section outlines the calldata format requirements for valid updates. The complete calldata can be constructed by concatenating all bytes in the specified order below.

FieldSizeRecommended value
Major versionuint81
Minor versionuint80
Trailing Header Sizeuint80
Hyperlane message lengthuint16length

Then, comes the hyperlane message:

FieldSizeRecommended value
Hyperlane versionuint81
SignaturesSignatures-
Nonceuint32-
Emitter chain iduint32chain id
Emitter addressbytes32(starknet address)-
PayloadPayload-

Signatures are packed encoded, starting with a single byte indicating the total number of signatures(uint8). Each signature then consists of:

  • one-byte index (mapping the signature to its corresponding validator in the Hyperlane contract)
  • 32-byte r-component
  • 32-byte s-component
  • one-byte v-component

Finally the payload:

FieldSizeRecommended value
Merkle tree hook addressbytes32-
Checkpoint rootbytes32-
Checkpoint indexuint32-
Message iduint256-
Num updatesuint8-
Update Sizeuint16length
Proof lengthuint16length
Proof--
Update dataUpdateData-
Feed idbytes32-
Publish timeuint64-

UpdateData represents the packed encoding abi.encodePacked of the desired feed type, which could be SpotMedian, TWAP, Options, Perpetuals, or other supported types. For applications, the process of building calldata is simplified; it can be retrieving through the get_calldata theoros endpoint.