Warning: Work in progress. Do not use.
Rust implementation of Hyperscale consensus protocol.
What's different:
- Pure consensus layer — no I/O, no locks, no async
- Created with deterministic simulation testing in mind
- Faster two-chain commit consensus based on HotStuff-2
- Optimistic pipelining — proposers propose immediately after QC formation
- Improved cross-shard livelock prevention
- Real Radix Engine integration
| Crate | Purpose |
|---|---|
hyperscale-types |
Core types: hashes, blocks, votes, QCs, keys, transactions, topology |
hyperscale-core |
The StateMachine and SubStateMachine traits that everything implements |
hyperscale-messages |
Network message serialization (SBOR encoding) |
hyperscale-bft |
BFT consensus: block proposal, voting, QC formation, view changes |
hyperscale-execution |
Transaction execution with cross-shard 2PC coordination |
hyperscale-mempool |
Transaction pool management |
hyperscale-livelock |
Cross-shard deadlock detection and prevention |
hyperscale-node |
Composes all sub-state machines into the main NodeStateMachine |
hyperscale-provisions |
Centralized provision coordination for cross-shard transactions |
hyperscale-engine |
Radix Engine integration for smart contract execution |
hyperscale-simulation |
Deterministic simulator with configurable network conditions |
hyperscale-simulator |
CLI tool for running simulations with metrics |
hyperscale-production |
Production runner: libp2p networking, RocksDB storage, thread pools |
hyperscale-spammer |
Transaction spammer CLI and library for load testing |
hyperscale-parallel |
Parallel (non-deterministic) simulation for multi-core performance testing |
hyperscale-test-helpers |
Test helpers providing properly-signed fixtures for crypto testing |
Pre-built binaries for Linux (x86_64) and macOS (ARM64) are available on the Releases page.
You can pull the latest Docker image from the GitHub Container Registry:
docker pull ghcr.io/flightofthefox/hyperscale-rs:latestInstall Rust using rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shYou will need clang, lld, protobuf, and openssl.
brew install llvm protobuf openssl pkg-configsudo apt-get update && sudo apt-get install -y \
clang \
lld \
pkg-config \
protobuf-compiler \
git \
build-essential \
libssl-dev \
libc6-devRequired only if you plan to run the launch-docker-compose.sh script or use the provided Dockerfile.
Recommended: Docker Desktop or Rancher Desktop.
Install the Docker Engine and Docker Compose plugin: Install on Ubuntu | Install on Debian | Install on Fedora
Ensure your user is in the docker group to run commands without sudo:
sudo usermod -aG docker $USER
newgrp dockerThis repository uses git submodules for vendor dependencies. When cloning, use:
git clone --recurse-submodules https://github.com/flightofthefox/hyperscale-rs.gitIf you've already cloned the repository without submodules, initialize them with:
git submodule update --init --recursivecargo build --releasecargo run --release --bin hyperscale-simcargo testFor development and testing, you can launch a local cluster using the provided scripts.
The launch-cluster.sh script launches a cluster of validator nodes as background processes on your host machine. This is faster and easier for quick iteration.
./scripts/launch-cluster.shOptions:
--shards <N>: Number of shards (default: 2)--validators-per-shard <M>: Validators per shard (default: 4)--clean: Clean data directories before starting--monitoring: Start Prometheus and Grafana for metrics
The launch-docker-compose.sh script launches a full cluster inside Docker containers using Docker Compose. This more closely mimics a production environment.
Important
Memory Requirement: Please ensure your Docker VM/Desktop is configured with at least 8-10GB of RAM. The validator nodes require significant memory for the high-throughput consensus simulation.
./scripts/launch-docker-compose.shOptions:
--build <true|false>: Whether to build the docker image (default: true). Set to false to use existing image for much faster startup.--use-ghcr-image: Use the latest pre-built image from GHCR instead of building locally.--shards <N>: Number of shards (default: 1)--validators-per-shard <M>: Validators per shard (default: 8)--memory <limit>: Memory limit per validator (e.g.1g,512m)--cpus <limit>: CPU limit per validator (e.g.0.5)--latency <ms>: Artificial network latency per validator--latency-nodes <N>: Number of nodes to apply latency to (default: 1)
To stop the Docker cluster and remove volumes:
./scripts/stop-docker-compose.shTo run load tests against your local cluster, use the hyperscale-spammer binary.
Important
Check Ports: You MUST use the ports outputted by the launch script at the end of its execution. These ports may vary depending on the number of validators and sharding configuration.
Example command (adjust ports as needed):
./target/release/hyperscale-spammer run \
--endpoints "http://localhost:8080,http://localhost:8081" \
--num-shards 2 \
--validators-per-shard 4 \
--tps 100 \
--duration 30sIf you encounter "path too long" errors during cargo build on Windows (often due to deep dependency trees), you need to enable Long Paths in Windows.
- Open PowerShell as Administrator.
- Run the following command to enable long paths in the registry:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- Restart your computer (or sign out and back in).
- Run this git command to ensure git uses long paths:
git config --system core.longpaths true
If you see errors about missing clang.dll or libclang.dll during build (usually from rocksdb or bindgen), you need to set the LIBCLANG_PATH environment variable.
- Ensure LLVM is installed (
choco install llvm). - Ensure protobuf is installed (
choco install protobuf). - Set the environment variable to your LLVM
bindirectory:(Or add it permanently to your System Environment Variables).$env:LIBCLANG_PATH = "C:\Program Files\LLVM\bin"