| Crates.io | protosol |
| lib.rs | protosol |
| version | 2.0.0 |
| created_at | 2025-10-21 15:59:36.511563+00 |
| updated_at | 2025-10-21 15:59:36.511563+00 |
| description | Protobuf definitions for the SVM fuzzing project. |
| homepage | |
| repository | https://github.com/firedancer-io/protosol |
| max_upload_size | |
| id | 1894054 |
| size | 55,967 |
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.
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.
txn.proto)SanitizedTransaction: Complete transaction with message and signaturesTransactionMessage: Transaction payload with accounts and instructionsCompiledInstruction: Individual program instructions with account referencesMessageHeader: Transaction metadata (signatures, read-only accounts)block.proto)BlockContext: Input state for block execution (transactions, accounts, block hash queue)BlockEffects: Output state after block execution (bank hash, costs, leader schedule)BlockFixture: Complete test fixture combining input context and expected effectscontext.proto)AcctState: Complete account state (address, lamports, data, owner)FeatureSet: Enabled Solana features for executionSlotContext: Slot-specific information (POH, parent hashes)EpochContext: Epoch-level data (vote accounts, feature sets)pack.proto)PackComputeBudgetContext: Input for compute budget testingPackComputeBudgetEffects: Output effects of compute budget executionAdd to your Cargo.toml:
[dependencies]
protosol = "X.Y.Z"
use protosol::protos;
// Create a transaction fixture
let txn = protos::SanitizedTransaction {
message: Some(protos::TransactionMessage {
header: Some(protos::MessageHeader {
num_required_signatures: 1,
num_readonly_signed_accounts: 0,
num_readonly_unsigned_accounts: 0,
}),
account_keys: vec![/* account keys */],
recent_blockhash: vec![/* blockhash */],
instructions: vec![/* instructions */],
address_table_lookups: vec![],
}),
signatures: vec![vec![/* signature bytes */]],
};
// Create account state
let account = protos::AcctState {
address: vec![/* 32-byte address */],
lamports: 1000000,
data: vec![/* account data */],
executable: false,
owner: vec![/* 32-byte owner */],
};
// Create block context for testing
let block_ctx = protos::BlockContext {
txns: vec![txn],
acct_states: vec![account],
blockhash_queue: vec![/* recent blockhashes */],
slot_ctx: Some(protos::SlotContext {
slot: 12345,
poh: vec![/* POH hash */],
parent_bank_hash: vec![/* parent hash */],
parent_lthash: vec![/* parent LT hash */],
}),
epoch_ctx: Some(protos::EpochContext {
epoch: 100,
features: Some(protos::FeatureSet {
features: vec![/* feature flags */],
}),
vote_accounts: vec![],
}),
};
These protocol buffers are designed for:
This crate is specifically designed for use with the anza-xyz/agave repository's testing infrastructure:
cargo build
cargo test
The protobuf code is automatically generated during build. To force regeneration:
cargo clean
cargo build
proto/
├── block.proto # Block execution context and effects
├── context.proto # Account states and execution context
├── txn.proto # Transaction structures
├── pack.proto # Compute budget testing
├── metadata.proto # Test fixture metadata
└── *.options # Nanopb configuration files
Apache-2.0