Phala Network Docs
  • Home
    • πŸ‘ΎPhala Network Docs
  • Overview
    • βš–οΈPhala Network
      • πŸ’ŽPhala Cloud
      • πŸ₯·Dstack
      • πŸ”GPU TEE
    • πŸ’ŽPHA Token
      • πŸͺ™Introduction
      • πŸ‘Delegation
        • Delegate to StakePool
        • What is Vault
        • What is Share
        • WrappedBalances & W-PHA
        • Examples of Delegation
        • Use Phala App to Delegate
        • Estimate Your Reward
      • πŸ—³οΈGovernance
        • Governance Mechanism
        • Join the Council
        • Voting for Councillors
        • Apply for Project Funding
        • Phala Treasury
        • Phala Governance
        • Setting Up an Account Identity
  • Phala Cloud
    • πŸš€Getting Started
      • Create Your Phala Cloud Account
      • Your First CVM Deployment
      • Explore Templates
        • Launch an Eliza Agent
        • Start from Template
    • πŸͺ¨TEEs, Attestation & Zero Trust Security
      • Attestation
      • Security Architecture
    • πŸ₯·Phala Cloud User Guides
      • Deploy and Manage CVMs
        • Deploy CVM with Docker Compose
        • Set Secure Environment Variables
        • Deploy Private Docker Image to CVM
        • Debugging and Analyzing Logs
          • Check Logs
          • Private Log Viewer
          • Debug Your Application
        • Application Scaling & Resource Management
        • Upgrade Application
        • Deployment Cheat Sheet
      • Building with TEE
        • Access Your Applications
        • Expose Service Port
        • Setting Up Custom Domain
        • Secure Access Database
        • Create Crypto Wallet
        • Generate Remote Attestation
      • Advanced Deployment Options
        • Deploy CVM with Phala Cloud CLI
        • Deploy CVM with Phala Cloud API
        • Setup a CI/CD Pipeline
    • 🚒Be Production Ready
      • CI/CD Automation
        • Setup a CI/CD Pipeline
      • Production Checklist
      • Troubleshooting Guide
      • Glossary
    • πŸ”’Use Cases
      • TEE with AI
      • TEE with FHE and MPC
      • TEE with ZK and ZKrollup
    • πŸ“‹References
      • Phala Cloud CLI Reference
        • phala
          • auth
          • cvms
          • docker
          • simulator
      • Phala Cloud API & SDKs
        • API Endpoints & Examples
        • SDKs and Integrations
      • Phala Cloud Pricing
    • ❓FAQs
  • Dstack
    • Overview
    • Getting Started
    • Hardware Requirements
    • Design Documents
      • Decentralized Root-of-Trust
      • Key Management Service
      • Zero Trust HTTPs (TLS)
    • Acknowledgement
    • ❓FAQs
  • LLM in GPU TEE
    • πŸ‘©β€πŸ’»Host LLM in GPU TEE
    • πŸ”GPU TEE Inference API
    • 🏎️GPU TEE Benchmark
    • ❓FAQs
  • Tech Specs
    • ⛓️Blockchain
      • Blockchain Entities
      • Cluster of Workers
      • Secret Key Hierarchy
  • References
    • πŸ”Setting Up a Wallet on Phala
      • Acquiring PHA
    • πŸŒ‰SubBridge
      • Cross-chain Transfer
      • Supported Assets
      • Asset Integration Guide
      • Technical Details
    • πŸ‘·Community Builders
    • 🀹Hackathon Guides
      • ETHGlobal Singapore
      • ETHGlobal San Francisco
      • ETHGlobal Bangkok
    • 🀯Advanced Topics
      • Cross Chain Solutions
      • System Contract and Drivers
      • Run Local Testnet
      • SideVM
    • πŸ†˜Support
      • Available Phala Chains
      • Resource Limits
      • Transaction Costs
      • Compatibility Matrix
      • Block Explorers
      • Faucet
    • ⁉️FAQ
  • Compute Providers
    • πŸ™ƒBasic Info
      • Introduction
      • Gemini Tokenomics (Worker Rewards)
      • Budget balancer
      • Staking Mechanism
      • Requirements in Phala
      • Confidence Level & SGX Function
      • Rent Hardware
      • Error Summary
    • 🦿Run Workers on Phala
      • Solo Worker Deployment
      • PRBv3 Deployment
      • Using PRBv3 UI
      • PRB Worker Deployment
      • Switch Workers from Solo to PRB Mode
      • Headers-cache deployment
      • Archive node deployment
    • πŸ›‘οΈGatekeeper
      • Collator
      • Gatekeeper
  • Web Directory
    • Discord
    • GitHub
    • Twitter
    • YouTube
    • Forum
    • Medium
    • Telegram
Powered by GitBook
LogoLogo

Participate

  • Compute Providers
  • Node
  • Community
  • About Us

Resources

  • Technical Whitepaper
  • Token Economics
  • Docs
  • GitHub

More

  • Testnet
  • Explorer
  • Careers
  • Responsible Disclosure

COPYRIGHT Β© 2024 PHALA.LTD ALL RIGHTS RESERVED. May Phala be with you!

On this page
  • Concepts
  • Prepare a new collator
  • Enable an invulnerable collator
  • Apply for a public collator

Was this helpful?

Edit on GitHub
  1. Compute Providers
  2. Gatekeeper

Collator

Collators on Phala (Khala) are supposed to be Gatekeepers, who also run the pRuntime as the Gatekeeper role, helping manage the keys in the network. However, Gatekeeper is not open for election now.

Concepts

Phala Network is currently running its collators on Aura consensus. Aura is a simple block authoring engine that rotates the block producers among the registered collator candidates one by one.

            Host              Session
            Api               Manager
 Collator <===== [Session]  <--------- [CollatorSelection]
   node            pallet                     pallet

On the blockchain, the block authoring is handled collaboratively by Session and CollatorSelection pallets. The Session pallet controls how the blocks are produced and validated. Therefore it has a list of the selected block authors. However, the Session doesn’t decide the list on its own. Instead, it delegates that to the CollatorSelection pallet.

The CollatorSelection pallet implements the SessionManager trait and is injected as the manager of the Session pallet in the runtime.

The CollatorSelection pallet is a minimal PoS system. It has a configurable bound amount for all the collator candidates. Anyone can run a collator as long as they meet the minimal bound. It also kicks the unresponsive collator out after each session. Besides the public collators, it also holds a special group of collators called invulnerables, who are not vulnerable to kicks even if they are offline.

Prepare a new collator

  1. Create an account with a minimum amount of bound available (16 PHA by default)

  2. Deploy a collator full node with the --collator flag enabled

  3. Generate a session key. Two options:

    1. Call RPC api.rpc.author.rotateKeys() to generate a new session key in the node, and note the public key it outputs

    2. Generate the session key externally (dangerous), calculate the public key, and note it

  4. Set the session (public) key of the collator account by calling session.setKeys()

  5. Start the collator node

Enable an invulnerable collator

This operation can only be done with the Sudo permission. To apply for a public collator, please refer to the next section.

Call collatorSelection.setInvulnerables(list), where list is the full list of all the invulnerables collators including the old ones. The current invulnerable collator list can be found from collatorSelection.invulnerables().

Apply for a public collator

To become a public collator, you will need to put a fixed amount of the deposit. The deposit can be found at collatorSelection.candidacyBond(). Up to a certain number of the public collators are allowed (the genesis collators are not included). The number can be found at collatorSelection.desiredCandidates(), and the current candidates can be found at collatorSelection.candidates(). As of writing, the bond is 1000 PHA, and the desired candidate number is 12.

After the collator account and the node is setup correctly, submit a proposal by calling collatorSelection.registerAsCandidate() from the account. Once it’s submitted, you will need to wait for two sessions to become a collator.

The blockchain will detect offline collators. If the produced blocks in a session is under a threshold, it will be kicked out from the collator candidate list, and the bond will be returned in full.

At any time, a collator account can signal the intention to leave the collator candidate list by calling collatorSelection.leaveIntent().

PreviousGatekeeperNextGatekeeper

Last updated 1 month ago

Was this helpful?

πŸ›‘οΈ