Skip to content

Metadata Propagation

Beyond token value, M Portals are crucial for maintaining consistency of the M0 protocol state across chains.

  • Purpose: To ensure yield calculations and governance-defined parameters are synchronized between the Hub (authoritative source) and all Spoke chains.
  • Propagated Data:
    • $M Earning Index: A continuously accruing value representing the aggregate yield earned within the M0 system on Ethereum. Propagating this allows the $M representation on Spoke chains to reflect the correct yield.
    • TTG Registrar Values: Key-value pairs stored in the Registrar contract on Ethereum, set by M0 governance (TTG). Examples include the EARNERS_LIST which dictates which addresses are eligible for yield. Propagation ensures Spoke chains respect Hub governance decisions.
  • Propagation Mechanisms:
    • Implicit (Index Only): Every token transfer message initiated from the HubPortal automatically includes the current $M Earning Index from Ethereum within the additionalPayload field of the Wormhole NTT message. When the receiving SpokePortal processes this token transfer message (within the _receiveMToken function inherited from Portal), it decodes this additionalPayload to extract the index. This index is then passed to the SpokePortal's _mintOrUnlock function, which conditionally updates the Spoke MToken's index via ISpokeMTokenLike.mint(address, uint256, uint128) only if the received index is greater than the Spoke MToken's currentIndex(). Otherwise, it proceeds to mint tokens using ISpokeMTokenLike.mint(address, uint256) without updating the index.
    • Explicit (Index & Registrar): Anyone can trigger metadata propagation permissionlessly by calling specific functions on the HubPortal:
      • sendMTokenIndex(uint16 destinationChainId): Sends the current $M Index to a specific Spoke chain.
      • sendRegistrarKey(uint16 destinationChainId, bytes32 key): Sends the value associated with a specific key from the Hub Registrar to a Spoke Registrar.
      • sendRegistrarListStatus(uint16 destinationChainId, bytes32 listKey, address entry): Sends the inclusion status of a specific address within a list (like EARNERS_LIST) in the Hub Registrar to the Spoke Registrar.
    • Frequency: While implicit updates occur with transfers, explicit updates (especially for the index) are often triggered periodically by automated bots to ensure timely synchronization even without user transfer activity.