Gauss Docs
  • 🌐Getting Started
    • Welcome to Gauss
    • Whitepaper
      • Blockchain Providers Need to Do Better
        • Solving a Lack of Token Adoption
          • An Evolving Space With Untapped Potential
        • Security & Reliability
          • Curation & Vetting
            • Important Note For Brands
        • Token Creation
      • WHY BUILD WITH GAUSS?
      • Use Cases
        • Use Cases (Chart)
      • Roadmap
      • Technical Background and Blockchain Development
        • Why Another Blockchain?
        • Gauss 1.0: Built With Efficiency and a Strong Infrastructure to Launch Rapidly
        • Gauss 2.0: Added Functionality For a Better User Experiance
          • Noble Swap 2.0
          • NFTs in Gauss 2.0
          • Token Development Kit (TDK)
          • Gaming DAO
          • Omnipool
      • Token Economics
        • Gang Token Economics: Designed to Ensure Trust and Transparency
        • Token Locking Schedule
        • Reflections: Rewarding the Gauss Community
        • Charitable Allocations: Grants, Scholarships, & Financial Assistance
      • The Gauss Team
      • Important Definitions
      • DISCLAIMER
        • PURCHASER WARNING
        • PROMINENT STATEMENTS
        • FUTURE STATEMENTS
        • VALUE RISKS
        • NOT A SECURITY
    • How To Connect
      • Create Metamask Wallet
    • Links
  • ⚡Launching with Gauss
    • Benefits of Building with Gauss
      • Fostering an Environment for Success
      • Gauss Growth Grant Program
      • Gauss Liquidity Program
      • Ecosystem Integrity Fund
      • Client Referral Program
    • A Guide to Curation
      • Core Principles and Curation Guidelines
      • Curation Stages and Processing Fees
    • Building on Gauss
  • 🖥️Gauss Ecosystem
    • Gauss Chain
      • Polygon-Edge Overview
      • Architecture
      • Consensus
      • Client Modules
        • Blockchain
        • Minimal
        • Networking
        • State
        • TxPool
        • JSON RPC
        • Consensus
        • Storage
        • Types
        • Syncer
        • Sealer
        • Other Modules
      • Polygon-Edge Performance Reports
      • For Developers
        • Operate a Node
          • Local Install
          • Genesis Contract
          • Server Config
          • CLI Commands
          • Key Management
        • Run a Validator
          • Validator FAQ
        • Smart Contract Deployment Permissioning
        • Deploying Contracts
          • Remix
          • Truffle
          • Hardhat
          • Replit
    • Gauss Explorer
      • Features
      • Navigating the Explorer
        • Menus
        • Blocks
        • Transactions
      • Verifying a Smart Contract
        • Hardhat Plugin
        • Sourcify Plugin
        • OpenZeppelin Plugin
      • Interacting With Smart Contracts
      • Exporting Transactions
      • FAQ
      • For Developers
        • Gauss Explorer Dependencies
        • Deployment Guide
          • Smart Contract Verification
          • Cleaning an instance from the previous deployment
          • ENV Variables
          • Testing
        • APIs
          • Requests & Limits
          • GraphQL
          • ETH RPC
    • Noble Swap
      • Liquidity Boost Program
    • Tokens
    • Gauss NFTs
      • Ferro Cards
      • F.E.R.R.E.T. NFTs
    • Contests & Giveaways
    • Gauss Faucet
      • For Developers
    • Address List
  • 💡Additional Resources
    • Partnerships & Affiliates
    • Discord Channel
    • Contact Us
    • Learning Materials
      • Web3 Glossary
    • Media Kit
Powered by GitBook
On this page
  • Overview​
  • Perfomance report​
  1. Gauss Ecosystem
  2. Gauss Chain
  3. Client Modules

Syncer

PreviousTypesNextSealer

Last updated 2 years ago

Overview

This module contains the logic for the synchronization protocol. It is used for syncing a new node with the running network, or validating/inserting new blocks for the nodes which do not participate in the consensus (non-validators).

The Polygon Edge uses libp2p as the networking layer, and on top of that runs gRPC.

There are essentially 2 sync types in Polygon Edge:

  • Bulk Sync - sync a large range of blocks at a time

  • Watch Sync - sync on a per-block basis

Bulk Sync

The steps for Bulk Syncing are pretty straightforward to accomodate the goal of Bulk Sync - sync as many blocks as possible (available) from the other peer in order to catch up, as quickly as possible.

This is the flow of the Bulk Sync process:

  1. Determine if the node needs to Bulk Sync - In this step, the node checks the peer map to see if there is anyone who has a bigger block number than what the node has locally

  2. Find the best peer (using the sync peer map) - In this step the node finds the best peer to sync with based on the criteria mentioned in the example above.

  3. Open a bulk sync stream - In this step the node opens a gRPC stream to the best peer in order to bulk sync blocks from the common block number

  4. The best peer closes the stream when done bulk sending - In this step the best peer the node is syncing with will close the stream as soon as it sends all available blocks that it has

  5. When done bulk syncing, check if the node is a validator - In this step, the stream is closed by the best peer, and the node needs to check if they are a validator after bulk syncing.

  • If they are, they jump out of sync state and start participating in the consensus

  • If they are not, they continue to Watch Sync

INFO

The step for Watch Syncing is only executed if the node is not a validator, but a regular non-validator node in the network that just listens for oncoming blocks.

The behavior of Watch Sync is pretty straightforward, the node is already synced up with the rest of the network and only needs to parse new blocks that are coming in.

This is the flow of the Watch Sync process:

  1. Add a new block when a peer's status is updated - In this step the nodes listen for the new block events, when it has a new block it will run a gRPC function call, get the block and update the local state.

  2. Check if the node is a validator after syncing the latest block

    • If it is, jump out of sync state

    • If it is not, continue listening for new block events

INFO

Performance was measured on a local machine by syncing a million blocks

Name
Result

Syncing 1M blocks

~ 25 min

Tranfering 1M blocks

~ 1 min

Number of GRPC calls

2

Test coverage

~ 93%

Watch Sync

Perfomance report

🖥️
​
​
​
​