Skip to content

NethermindEth/frida-hotstuff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

90 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Frida and DeFrida Hotstuff Benchmarks

Overview

This repository contains a comprehensive benchmarking suite for evaluating the performance of both Frida and DeFrida implementations using the Hotstuff consensus protocol.

๐Ÿš€ Quickstart

  1. Configure your experiment by editing benchmark_config.yaml in the project root
  2. Run the benchmark:
cargo run --release -p benchmark

This will execute the benchmarks for both Frida and DeFrida using the configured parameters. Results are automatically saved to the results/ directory with detailed logs in logs/.

๐Ÿ“ Project Structure

The codebase is organized into focused crates for maintainability and modularity:

  • crates/benchmark/ - The main benchmarking binary that orchestrates the entire benchmarking process
  • crates/common/ - Shared utilities and data structures used across multiple crates
  • frida-app/ - Complete implementation of the Frida protocol using Hotstuff consensus
  • defrida-app/ - Complete implementation of the DeFrida protocol using Hotstuff consensus

โš™๏ธ Configuration

YAML Configuration System

All benchmark parameters are configured through benchmark_config.yaml in the project root. This file serves as both configuration and documentation, explaining the impact of each parameter.

The benchmark creates a matrix of tests by computing the cartesian product of all configured parameters:

Total Tests = (validator counts) ร— (data sizes) ร— (FRI configurations)

Configuration Parameters

Validator Counts (num_of_validators)

Number of validator nodes participating in consensus:

num_of_validators:
  - 5
  - 10
  - 20
  - 50
  - 100

Data Sizes (data_sizes)

Dimensions of data matrices for cryptographic operations:

data_sizes:
  - height: 100
    width: 100
  - height: 1000
    width: 1000
  - height: 10000
    width: 10000

FRI Options (fri_options)

Fast Reed-Solomon Interactive proof system parameters:

fri_options:
  - blowup_factor: 2        # Low-Degree Extension multiplier
    folding_factor: 2       # Polynomial degree reduction per round
    max_remainder_degree: 1 # Direct verification threshold

Output Files (output_files)

Specify where benchmark results are written:

output_files:
  frida_benchmark: "results/frida-benchmark.csv"
  defrida_benchmark: "results/defrida-benchmark.csv"

๐Ÿ“Š Benchmark Output

Output Files

Results are automatically organized into structured directories:

  • results/frida-benchmark.csv - Frida protocol performance metrics
  • results/defrida-benchmark.csv - DeFrida protocol performance metrics
  • logs/logging.log - Detailed execution logs with timestamps

Measured Metrics

Each benchmark captures comprehensive performance data:

pub struct PhaseTimingAndProofSize {
    pub propose_block_time: BenchmarkTiming,        // Block proposal timing
    pub send_proposal_time: BenchmarkTiming,        // Network transmission timing
    pub validate_proposal_time: BenchmarkTiming,    // Proposal validation timing
    pub send_signed_proposal_time: BenchmarkTiming, // Signature transmission timing
    pub validate_signature_time: BenchmarkTiming,   // Signature validation timing
    pub proposal_proof_size: BenchmarkProofSize,    // Cryptographic proof sizes
    pub receive_proposal_proof_size: BenchmarkProofSize, // Received proof sizes
}

Each timing and proof size metric includes minimum, mean, and maximum values across all consensus rounds for statistical analysis.

Performance Analysis

The benchmark results enable comparative analysis between:

  • Frida vs DeFrida performance characteristics
  • Scalability across different validator set sizes
  • Memory impact of varying data dimensions
  • Cryptographic trade-offs between different FRI configurations

๐Ÿ› ๏ธ Installation

Prerequisites

  • Rust toolchain (see rust-toolchain.toml for version)
  • Git with proper SSH/HTTPS access

Setup

git clone <repository-url>
cd frida-hotstuff
cargo build --release

If you encounter issues with frida-poc dependency, follow this configuration guide.

๐Ÿšง Current Status & Future Work

Completed Features โœ…

  • โœ… YAML-based configuration system for flexible experiment design
  • โœ… Frida protocol benchmarking with comprehensive metrics
  • โœ… Structured logging and reporting system
  • โœ… Multi-dimensional performance analysis (validators, data size, FRI params)

In Progress ๐Ÿ”„

  • ๐Ÿ”„ DeFrida protocol integration (framework ready, implementation in progress)
  • ๐Ÿ”„ Enhanced statistical analysis and visualization tools

Future Improvements ๐Ÿ”ฎ

  1. Consensus round-based termination instead of time-based (for more consistent averaging)
  2. Real P2P networking layer integration (e.g., libp2p) instead of mock networks

License

The crates in this repository are licensed under the following licence.

  • Apache 2.0 license (LICENSE) is applied to all commits

Would like to contribute?

see Contributing.

About

HotStuff consensus with FRIDA/DeFRIDA data availability sampling schemes.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •