Updater
Updater Code: https://github.com/nomad-xyz/rust/tree/main/agents/updater
The Updater is an off-chain agent that does the following:
Observe the Home contract on the origin chain
Sign attestations to new roots
Publish the signed attestation to the Home
The Home contract permissions an "updater" that must attest to the state of the message tree. The updater places a bond on the home chain and is required to periodically sign attestations (updates or U). Each attestation contains the root from the previous attestation (U_prev), and a new root (U_new).
Performing Updates
The Updater maps logically to a single Home contract. Its entire job is to observe the Home to ensure that new messages (and hence new roots) are notarized such that they can be relayed to any number of Replicas.
The Updater listens for events on the Home, and calls functions to perform its job.
Listening for New Roots
Cross-chain applications enqueue messages to be sent by calling dispatch
on the Home contract. Once the message is enqueued in the Home's message tree, the Home emits the following event:
Updaters listen for these events, and after batching some number of messages (per their SLA), will sign an update over the old root and new root.
Publishing an Update
Updaters sign attestations off-chain and publish them by calling update
on the Home contract:
Once the update has been performed, a Relayer may relay the new update to Replica contracts on destination chains.
Updater Selection
Updaters are selected and enrolled on the Home contract by the UpdaterManager contract, which is established at initialization time.
The UpdaterManager can be changed by calling _setUpdaterManager
. This function can only be called by the owner
role, which belongs to Nomad governance.
At a given time, there is only one Updater enrolled per Home contract. This helps reduce overhead of verification, relative to externally verified systems that require many validators or guardians.
Updater Slashing
If an Updater ever attempts to commit fraud (by attesting to an invalid root), the Home contract will be set to a failed state, at which point the Updater will be slashed:
The slashUpdater
function in the UpdaterManager will be implemented when updater bonding and rotation are also implemented in the future.
Last updated