Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast sync intro #1275

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/sidebar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ module.exports = {
"operators/setup/basic-node-configuration",
"operators/setup/node-endpoints",
"operators/setup/install-node",
"operators/setup/fast-sync",
"operators/setup/open-files",
"operators/setup/upgrade",
"operators/setup/joining",
Expand Down
18 changes: 0 additions & 18 deletions source/docs/casper/operators/becoming-a-validator/fast-sync.md

This file was deleted.

20 changes: 20 additions & 0 deletions source/docs/casper/operators/setup/fast-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Fast Sync
---

# Introducing Fast Sync

import useBaseUrl from '@docusaurus/useBaseUrl';

A Casper Network requires new nodes to download and execute every block to join the network. From genesis (start of the Mainnet), the node executes each deploy in every block. This process continues until the node has arrived at the current state of the blockchain. Syncing a node this way can take a very long time.

We have introduced a fast syncing process (fast sync) to provide a faster alternative to joining a Casper network. Fast sync does not start syncing at the genesis block; instead, the operator verifies a recent block and provides a [trusted hash](../setup/basic-node-configuration.md#trusted-hash-for-synchronizing) to the node software. The global state, account balances, and all other on-chain information is the storage layer of the blockchain and is massive in size, so fast sync downloads the global state of only the most recent block. The following section briefly describes the fast sync process.

## How Fast Sync Works

<img src={useBaseUrl("/image/fast-sync-process.png")} class="Fast-sync process" width="500"/>

For fast sync, operators must provide the trusted hash of a block in the `config.toml` file. An example can be found [here](https://github.com/casper-network/casper-node/blob/f7d8228de3cb56a3fe705f5a787d3dbf03ff7998/resources/production/config-example.toml#L7).

Fast sync uses this trusted block as part of the cryptographic verification for the later blocks. The node downloads the trusted block first, then newer blocks up to and including the most recent block from the current era. For example, if the trusted hash is 5 hours old, it will first download that block, then newer blocks, until it arrives at one that is only a few minutes old. It then downloads the newer block's global state. Finally, it executes all the blocks the network created while the download was in progress until it is entirely in sync.

2 changes: 1 addition & 1 deletion source/docs/casper/operators/setup/install-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ For more details, see the [Node Setup](./basic-node-configuration.md#create-fund

## Getting a Trusted Hash

In the past, we have used a lower `trusted_hash`. Connecting at the tip, we now use as high of a `trusted_hash` as possible.
In the past, we have used a lower `trusted_hash`. Connecting at the tip, we now use as high of a `trusted_hash` as possible. Find out more about [Fast Sync](./fast-sync.md).

### Node Address

Expand Down