Protosol
Protocol buffer definitions for the Solana Virtual Machine (SVM) testing harness in Agave. This crate provides Rust bindings for protobuf schemas used in fuzzing and testing the Solana blockchain's execution environment.
Overview
Protosol defines the data structures used to capture, serialize, and replay Solana blockchain execution contexts for testing and fuzzing purposes. These protocol buffers represent the complete state and execution flow of Solana transactions, blocks, and virtual machine operations.
What These Protocol Buffers Represent
Core Components
- Transaction Processing: Complete transaction lifecycle from input to execution effects
- Block Execution: Block-level context including transactions, account states, and consensus data
- Virtual Machine State: SVM execution context, compute budgets, and program execution
- Account Management: Account states, ownership, and data storage
- Consensus Context: Slot information, epoch data, and leader schedules
Usage
As a Dependency
Add to your Cargo.toml:
[]
= "X.Y.Z"
Basic Usage
use protos;
// Create a transaction fixture
let txn = SanitizedTransaction ;
// Create account state
let account = AcctState ;
// Create block context for testing
let block_ctx = BlockContext
Testing and Fuzzing
These protocol buffers are designed for:
- Test Fixture Generation: Create reproducible test cases with complete blockchain state
- Fuzzing: Generate random but valid blockchain execution contexts
- State Capture: Record actual blockchain execution for later replay
- Regression Testing: Compare execution results across different SVM implementations
Integration with Agave
This crate is specifically designed for use with the anza-xyz/agave repository's testing infrastructure:
- SVM Fuzzing: Generate test cases for the Solana Virtual Machine
- Execution Testing: Validate transaction and block execution across different implementations
- Performance Testing: Measure execution costs and resource usage
- Compatibility Testing: Ensure different SVM implementations produce identical results
Usage
Add to your Cargo.toml:
[]
= "6.0.0"
No system dependencies needed — pre-generated Rust code is included.
Development
Setup
Pre-commit hooks
Modifying proto schemas
If you change files in proto/, you must regenerate src/generated/:
The exact pinned compiler revision comes from the submodule commit recorded in this repository (.gitmodules records its URL and branch hint). The deps.sh script builds from this vendored submodule. Prerequisites for deps.sh: CMake, Make, C++ compiler.
CI
CI runs on every push and pull request:
cargo fmt --checkcargo build --release --locked(default andsolana-typesfeatures)cargo clippy --all-features --locked -- -D warnings- Regenerates from source and verifies
src/generated/is up to date
File Structure
src/generated/ # Pre-generated Rust code (checked in, no tools needed to build)
proto/
├── block.proto # Block execution context and effects
├── context.proto # Account states and execution context
├── elf.proto # ELF loader fuzz fixtures
├── gossip.proto # Gossip protocol structures
├── invoke.proto # Program invocation context
├── metadata.proto # Test fixture metadata
├── pack.proto # Compute budget testing
├── serialize.proto # Serialization structures
├── shred.proto # Shred structures
├── txn.proto # Transaction structures
├── vm.proto # Virtual machine state
└── *.options # Nanopb configuration files
shlr/
└── protobuf/ # Vendored protobuf compiler (submodule, pinned in .gitmodules)
License
Apache-2.0