Skip to main content

Module relay_server

Module relay_server 

Source
Expand description

A relay server that’s collecting and serving the light client state signatures

Modules§

lcv1_relay
lcv2_relay
lcv3_relay
stake_table_tracker

Structs§

RelayError
Wire-compatible error envelope: mirrors http_client::error::ClientErr’s {status, message} JSON/VBS shape, since production clients (state_signature.rs, hotshot-state-prover) deserialize error responses into that type.
StateRelayServerState
State that checks the light client state update and the signature collection

Constants§

LATEST_STATE_PATH 🔒
LEGACY_STATE_PATH 🔒
STATE_PATH 🔒

Functions§

decode_body 🔒
get_latest_legacy_state 🔒
GET legacy-state: mirrors tide’s getlatestlegacystate.
get_latest_state 🔒
GET state (deprecated): mirrors tide’s getlateststate, always the LCV2 bundle regardless of version, since all three registered API versions shared this handler.
get_latest_state_v1 🔒
get_latest_state_v2 🔒
get_latest_state_v3 🔒
get_lateststate_v1 🔒
get_lateststate_v2 🔒
get_lateststate_v3 🔒
get_legacy_state 🔒
get_state 🔒
healthcheck 🔒
post_legacy_state 🔒
post_legacy_state_signature 🔒
Handle a POST to legacy-state: tries LCV1, then LCV2 (downgraded to LCV1). Mirrors tide’s postlegacystatesignature.
post_state 🔒
post_state_signature 🔒
Handle a POST to state/api/state: tries LCV3, then LCV2 (auto-downgrading to LCV1 if the signature verifies against the legacy scheme), then LCV1. Mirrors tide’s poststatesignature.
router 🔒
Build the relay server router. Tide-disco registered api under three stacked major API versions (v1, v2, v3) with identical handlers for every route except lateststate; requests with no version prefix were redirected to the latest (v3). We reproduce that by serving the same handlers at the unversioned and all three /v{1,2,3} paths, and only special-casing lateststate per version.
run_relay_server
run_relay_server_with_state
serve 🔒

Type Aliases§

SharedState 🔒
Shared, lock-guarded server state, cloned into every axum handler via State.