| Crates.io | stylus-trace |
| lib.rs | stylus-trace |
| version | 0.1.0 |
| created_at | 2026-01-21 17:31:34.690769+00 |
| updated_at | 2026-01-21 17:31:34.690769+00 |
| description | Performance profiling and flamegraph generation for Arbitrum Stylus transactions |
| homepage | https://github.com/Timi16/stylus-trace |
| repository | https://github.com/Timi16/stylus-trace |
| max_upload_size | |
| id | 2059733 |
| size | 174,215 |
Performance profiling and flamegraph generation for Arbitrum Stylus transactions.
Stylus Trace turns opaque Stylus transaction traces into interactive flamegraphs and actionable performance reports.
Profile gas usage, identify bottlenecks, and catch regressions — all locally using the Arbitrum Nitro dev node.
Built for the Arbitrum Stylus ecosystem.
cast)cargo install --force cargo-stylus
cargo install stylus-trace
Verify:
stylus-trace help
git clone https://github.com/OffchainLabs/nitro-devnode.git
cd nitro-devnode
./run-dev-node.sh
This starts a local Arbitrum node at:
http://localhost:8547
Verify:
curl -X POST http://localhost:8547 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
cargo stylus new my-contract
cd my-contract
Example contract (src/lib.rs):
#![cfg_attr(not(any(feature = "export-abi", test)), no_main)]
extern crate alloc;
use stylus_sdk::alloy_primitives::U256;
use stylus_sdk::prelude::*;
sol_storage! {
#[entrypoint]
pub struct Counter {
uint256 value;
}
}
#[public]
impl Counter {
pub fn add(&mut self, left: U256, right: U256) -> U256 {
let sum = left + right;
self.value.set(sum);
sum
}
pub fn get_value(&self) -> U256 {
self.value.get()
}
}
Deploy:
cargo stylus deploy \
--private-key <PRIVATE_KEY> \
--endpoint http://localhost:8547
CONTRACT_ADDRESS="0x..."
TX_HASH=$(cast send $CONTRACT_ADDRESS \
"add(uint256,uint256)" 42 58 \
--private-key <PRIVATE_KEY> \
--rpc-url http://localhost:8547 \
--json | jq -r '.transactionHash')
stylus-trace capture \
--rpc http://localhost:8547 \
--tx $TX_HASH \
--output profile.json \
--flamegraph flamegraph.svg \
--summary
open flamegraph.svg # macOS
xdg-open flamegraph.svg # Linux
stylus-trace --help
Commands:
capturevalidateschemaversionMIT
Built with ❤️ for the Arbitrum Stylus ecosystem