Skip to Content

Relayers

A relayer watches the source chain for outbound message events, assembles the attestation that the route’s protocol requires, and submits the event and its attestation to the destination chain. Relaying is permissionless: anyone can run a relayer. No relayer is trusted, because the destination chain verifies everything a relayer submits.

SupraNova does not distribute relayer software. Anyone can build and run their own relayer against the entry points and proof formats described on this page and in Message and Proof Formats.

SupraNova’s relayers deliver Token Bridge transfers only. An application that sends its own messages through Messaging must run or arrange a relayer that delivers them to its entry points. Such a relayer follows the steps below, with the application’s entry point in place of the Token Bridge. Relay a Message lists the public endpoints that serve each part of the proof bundle.

What a relayer does

  1. Watch the source chain for message events: MessagePosted logs on Ethereum and SupraEVM, and MessagePostedEvent events on SupraMVM.
  2. Wait until the event can be verified. For events from Ethereum, the wait depends on the verification strategy. See Finality. Events from SupraMVM and SupraEVM can be relayed once their block is certified.
  3. Build the proof bundle. Events from Ethereum need receipt and ancestry proofs. See Ethereum Consensus Verification. Events from Supra need Merkle proofs and the inclusion certificate. See Supra Consensus Verification.
  4. Submit the event and its proof bundle to the Token Bridge on the destination chain, paying the verification fee.

SupraNova’s relayer design

SupraNova’s own relayer is split into independent services that a message broker connects, so each service can be scaled and restarted separately. You can follow the same design:

ComponentResponsibility
Event ListenerWatches the source chain for message events and publishes each one to the message broker.
Message brokerQueues events between the Event Listener and the relayer, so that neither loses events when the other restarts.
ProverBuilds the proofs for each event: receipt and ancestry proofs for events from Ethereum, and Merkle proofs and the inclusion certificate for events from Supra.
RelayerConsumes events from the broker, obtains their proofs, and submits each event with its proof bundle to the destination chain.

For EVM source chains, a single chain-agnostic Event Listener serves every route. It first retrieves any events it has not yet processed, starting from its last recorded position, and then follows new blocks as they are produced. The Event Listener delivers events in chain order, so a restart neither skips nor reorders them.

Entry points

A relayer submits each message to the Token Bridge on the destination chain. The Token Bridge passes the message to the verifier:

DirectionSubmitted toFunctions
Ethereum → SupraMVMtoken_bridge_service on SupraMVMexecute_optimistic_or_safe, execute_finality on Mainnet; execute_optimistic_or_safe_v2, execute_finality_v2 on Testnet
SupraMVM → EVM chain (Ethereum, SupraEVM)TokenBridge on the EVM chainreceiveTokensFromSupra, batchReceiveTokensFromSupra
SupraEVM → SupraMVMtoken_bridge_service on SupraMVMreceive_tokens_from_sevm
  • The _v2 functions on Testnet accept the proof format introduced by Ethereum’s Gloas upgrade. On Testnet, the original execute_optimistic_or_safe and execute_finality are disabled and abort with EFUNCTION_DEPRECATED.
  • For messages from Ethereum, both functions apply the Token Bridge’s stored verification strategy. Call execute_finality when the Token Bridge is set to Finality, and execute_optimistic_or_safe otherwise. get_verification_method_and_safety_level on token_bridge_service returns the current setting.
  • For messages from Supra, receiveTokensFromSupra has a second form that omits the certificate. Use it when a certificate for the same block has already been verified. The transaction value must equal the verification fee times the number of messages submitted.

Rewards

A relayer is paid in the same transaction that delivers the message. The reward is part of the service fee charged to the user. It is calculated to cover the relayer’s gas cost and the verification fee the relayer pays, plus a margin. See Fees.

Failure handling

FailureEffectRecovery
A relayer stops or fails to submitThe message waits on the source chainAny other relayer can deliver it
A relayer submits an invalid proofThe verifier rejects the submission, and the relayer loses its gasA valid submission can follow

No relayer failure puts funds at risk. Each direction of a route depends only on its own relayers and verifier, so a failure in one direction does not affect the other.

Last updated on