This repository contains a comprehensive benchmarking suite for evaluating the performance of both Frida and DeFrida implementations using the Hotstuff consensus protocol.
- Configure your experiment by editing
benchmark_config.yamlin the project root - Run the benchmark:
cargo run --release -p benchmarkThis 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/.
The codebase is organized into focused crates for maintainability and modularity:
crates/benchmark/- The main benchmarking binary that orchestrates the entire benchmarking processcrates/common/- Shared utilities and data structures used across multiple cratesfrida-app/- Complete implementation of the Frida protocol using Hotstuff consensusdefrida-app/- Complete implementation of the DeFrida protocol using Hotstuff consensus
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)
Number of validator nodes participating in consensus:
num_of_validators:
- 5
- 10
- 20
- 50
- 100Dimensions of data matrices for cryptographic operations:
data_sizes:
- height: 100
width: 100
- height: 1000
width: 1000
- height: 10000
width: 10000Fast 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 thresholdSpecify where benchmark results are written:
output_files:
frida_benchmark: "results/frida-benchmark.csv"
defrida_benchmark: "results/defrida-benchmark.csv"Results are automatically organized into structured directories:
results/frida-benchmark.csv- Frida protocol performance metricsresults/defrida-benchmark.csv- DeFrida protocol performance metricslogs/logging.log- Detailed execution logs with timestamps
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.
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
- Rust toolchain (see
rust-toolchain.tomlfor version) - Git with proper SSH/HTTPS access
git clone <repository-url>
cd frida-hotstuff
cargo build --releaseIf you encounter issues with frida-poc dependency, follow this configuration guide.
- โ 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)
- ๐ DeFrida protocol integration (framework ready, implementation in progress)
- ๐ Enhanced statistical analysis and visualization tools
- Consensus round-based termination instead of time-based (for more consistent averaging)
- Real P2P networking layer integration (e.g., libp2p) instead of mock networks
The crates in this repository are licensed under the following licence.
- Apache 2.0 license (LICENSE) is applied to all commits
see Contributing.