Altius Benchtools
This is a collection of tools for Altius benchmarking, featuring a profiler for RPC server execution tracing and a transaction_generator for Ethereum test cases.
Tip: Start by running the example in
examples/how_to_use_profiler.rsto see the profiler in action and understand its different usage patterns.
1. Profiler
A tool for tracing and profiling RPC server execution with detailed timing and event tracking capabilities.
Features
- Task timing with start/end markers
- Multi-threaded profiling support
- Event annotation with notes and descriptions
- JSON and ZIP output formats
- Special handling for transaction and commit events
Usage
// Start timing a task
start;
// ... your code here ...
// Add notes to the current task
note_str;
// ... your code here ...
// End timing a task
end;
// Export results
dump_json;
// or
dump_zip;
Multi-threaded Usage
The profiler supports concurrent operations across multiple threads:
// In any thread
start_multi;
// ... your code here ...
// In any thread
note_str_multi;
// ... your code here ...
// In any thread
end_multi;
// ... your code here ...
// Export results
dump_json;
// or
dump_zip;
Output Format
The profiler generates a JSON structure containing:
- Timing information for each task
- Thread identification
- Custom annotations and notes
- Transaction and commit event details
An example of the output JSON is as follows:
2. Transaction Generator
This tool generates a JSON file containing a list of transactions and a pre-state of the blockchain.
Usage
- Run
cargo build --release --features generatorto build the project. - Run
./target/release/generate --helpto see the available options.
ETH-transfer Usage
After building the project, you can use the following commands to generate test cases.
-
Generate a JSON file with 100 ETH-transfer transactions in 10 groups, using the
one-to-manypattern, and save it to./test-case.json.# or -
Generate a JSON file with 200 ETH-transfer transactions in 5 groups, using the
chainedpattern, and save it to./test-case.json.# or # or -
Generate a JSON file with 100 ETH-transfer transactions with 60% conflict rate, and save it to
./test-case.json.# or
ERC20-transfer Usage
Directly use the erc20 flag to generate ERC20-transfer transactions. Other options are the same as ETH-transfer.
-
Generate a JSON file with 100 ERC20-transfer transactions in 10 groups, using the
one-to-manypattern, and save it to./test-case.json.# or -
Other options are the same as ETH-transfer.
Output Format
The output JSON file is a list of transactions and a pre-state of the blockchain.
An example of the output JSON is as follows:
How To Contribute
We welcome contributions to the Altius Benchtools project! Here's how you can contribute:
Reporting Issues
If you encounter any bugs or have feature requests:
- Check the Issues page to see if your issue has already been reported.
- If not, create a new issue with a clear description and steps to reproduce.
Contributing Code
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/toolbench.git - Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name - Make your changes, ensuring you follow the code style of the project.
- Run tests and linting to ensure your changes don't break existing functionality:
- Commit your changes with a descriptive commit message.
- Push your branch to your fork:
git push origin feature/your-feature-name - Create a Pull Request from your fork to the main repository.
Pull Request Guidelines
- Never commit directly to the
developbranch. All changes must go through pull requests. - Ensure your code is properly formatted with
cargo fmt. - Make sure all linting checks pass with
cargo clippy. - Write clear commit messages that explain the purpose of your changes.
- Update documentation if your changes affect the public API or user-facing features.