Maintainer
Overview
Maintainers are core participants in the MAP Protocol v2.0 cross-chain system, responsible for monitoring cross-chain events, participating in TSS signing, and submitting observation results. This chapter details the Maintainer lifecycle management, including registration, updates, election, state transitions, and TSS switching processes.
Maintainer State Machine
Maintainers go through the following states during their lifecycle:
Register
│
▼
┌──────────┐ ┌─────────────┐
│ UNKNOWN │ │ WHITELISTED │
│ │ │ │
└──────────┘ └─────────────┘
│
│ Verification Passed
▼
┌─────────────┐
│ STANDBY │◀─────────────┐
│ │ │
└─────────────┘ │
│ │
│ Elected │ Exit Active Set
▼ │
┌─────────────┐ │
│ READY │ │
│ │ │
└─────────────┘ │
│ │
│ KeyGen Success │
▼ │
┌─────────────┐ │
│ ACTIVE │──────────────┘
│ │
└─────────────┘
│
│ Voluntary Withdrawal/Slashed
▼
┌─────────────┐
│ DISABLED │
│ │
└─────────────┘UNKNOWN
Initial state, unregistered address
WHITELISTED
Registered, waiting for verification to join whitelist
STANDBY
Standby state, can participate in election but not selected
READY
Elected, waiting for KeyGen to complete
ACTIVE
Active state, participating in cross-chain signing
DISABLED
Disabled, no longer participates in any operations
Registration and Updates
Registration
Validators register as Maintainer candidates by calling the register function.
Function Signature:
Parameter Description:
secp256Pubkey
bytes
secp256k1 public key for TSS signing
ed25519PubKey
bytes
ed25519 public key for P2P communication authentication
p2pAddress
string
P2P network address for inter-node communication
Prerequisites:
Caller must be a Validator of MAP Relay Chain
Caller has not yet registered as a Maintainer
Registration Flow:
Update
Registered Maintainers can update their public keys and P2P address information.
Function Signature:
Restrictions:
Only Maintainers in STANDBY or WHITELISTED state can update information
ACTIVE Maintainers cannot update, must wait until they exit the active set
Deregistration
Maintainers can voluntarily deregister.
Function Signature:
Deregistration Flow:
Notes:
ACTIVE Maintainers must wait for TSS switching to complete before fully exiting after deregistration
Deregistration does not immediately return stake, must wait for unlock period
Election Mechanism
Elections are automatically triggered at the end of each epoch, selecting a new active set from STANDBY Maintainers.
Election Trigger
Function Signature:
Trigger Conditions:
Called by MAP Relay Chain system contract during epoch transitions
Only callable at the VM level
Election Rules
1/3 Change Limit
To ensure system stability and security, during each TSS switch:
No more than 1/3 of members can be removed from the original Maintainer set
This ensures the system can operate normally even if some nodes have issues
If more than 1/3 of nodes need to be removed, it will be done gradually over multiple epochs
Election Results
After election completion:
Selected Maintainers change state to READY
Unselected ones remain in STANDBY state
KeyGen event is triggered, notifying nodes to begin key generation
TSS Switching (Churn) Process
TSS switching refers to the process of generating a new Vault and migrating assets when the Maintainer set changes.
Overall Flow
KeyGen Flow
After election produces a new Maintainer set, TSS key generation is required.
KeyGen Parameter Structure:
KeyGen Flow:
Vault State Transition
After KeyGen success, Vault states transition:
Before KeyGen success
Active
-
After KeyGen success
Retiring
Active
After asset migration complete
Retired
Active
Exception Handling
KeyGen failure
Trigger next round election at current epoch end, doesn't affect existing Vault operation
Vote doesn't reach consensus
Wait for epoch end to re-elect, existing Vault continues service
Partial consensus reached
Next churn continues to attempt completion
Migration tx fails on-chain
Keep retrying, don't proceed to next election until current migration completes
Node doesn't submit vote
Node gets SlashPoint recorded, re-election after epoch ends
Maintainer State Changes
After TSS switching completes:
Newly joined Maintainer
READY → ACTIVE
Continuing Maintainer
ACTIVE (maintained)
Exiting Maintainer
ACTIVE → STANDBY
Vault Management
Vault Information Structure
Vault Sync Strategy
Maintainer nodes need to sync the following Vault information:
Active
Full sync, for processing new cross-chain requests
Retiring
Full sync, for completing asset migration
Retired
Sync those within recent N blocks (for handling delayed transactions and refunds)
Vault and Member Relationships
Each Vault has a fixed Maintainer member list
Different Vaults' members can overlap (same node may belong to both Active and Retiring Vaults)
Nodes decide whether to participate in signing for a Vault based on whether they are members
P2P Node Discovery
Maintainer nodes communicate through P2P network, node discovery methods:
From On-chain
Returns all registered Maintainer information, including P2P addresses.
MaintainerInfo Structure
Last updated