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 theEARNERS_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 theadditionalPayload
field of the Wormhole NTT message. When the receivingSpokePortal
processes this token transfer message (within the_receiveMToken
function inherited fromPortal
), it decodes thisadditionalPayload
to extract theindex
. This index is then passed to theSpokePortal
's_mintOrUnlock
function, which conditionally updates the Spoke MToken's index viaISpokeMTokenLike.mint(address, uint256, uint128)
only if the received index is greater than the Spoke MToken'scurrentIndex()
. Otherwise, it proceeds to mint tokens usingISpokeMTokenLike.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 HubRegistrar
to a SpokeRegistrar
.sendRegistrarListStatus(uint16 destinationChainId, bytes32 listKey, address entry)
: Sends the inclusion status of a specific address within a list (likeEARNERS_LIST
) in the HubRegistrar
to the SpokeRegistrar
.
- 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.
- Implicit (Index Only): Every token transfer message initiated from the