Skip to content

Gas Throughput Analysis

This document provides gas throughput estimates for the chain under various hardware configurations and execution modes.

ParameterDefault ValueNotes
target_gas_per_block15,000,000EIP-1559 target (50% of max)
max_gas_per_block30,000,000Hard cap per block
min_base_fee1Floor for dynamic pricing
max_base_fee10,000,000Ceiling for dynamic pricing
base_fee_change_denominator8EIP-1559 adjustment rate

Configuration defined in src/core/mod.rs via GasPricingConfig.

CategoryGasExamples
ALU1add, sub, xor, and, or
Shift/Bitmanip2sll, srl, sra, rotates
Branch/Jump2jal, jalr, conditionals
Multiply5mul, mulh variants
Divide/Remainder20div, rem variants
OperationGasNotes
Load warm stack/rodata2Aligned access
Load cold stack/rodata6First touch
Load warm heap/data4Aligned access
Load cold heap/data10First touch
Store warm stack2-
Store warm heap/data6-
Store cold heap/data12First touch
Page fault (first touch)50Per 4KB page
Dirty page (first write)10Per page
Predecode per byte1Basic block parsing
SyscallBase GasPer 32BNotes
storage_read_warm200+4Warm slot
storage_read_cold600+8Cold slot
storage_write400+8Any write
call500+4 in/outCross-contract
static_call400+4 in/outRead-only call
emit_log150+4 data, +20/topicEvent emission
keccak256800+20Hash precompile
sha2_256800+20Hash precompile
blake3400+10Hash precompile
verify_sig6000+20Signature verification
create2000+20Contract deployment

Full schedule in docs/gas-schedules/gas-v1.json.

Test Configuration: 16 cores, 32GB RAM, 4TB NVMe SSD

This represents a mid-range validator/RPC node setup.

Transaction TypeTypical GasNotes
Native transfer~21,000Base tx cost
ERC20 transfer~50,000-65,0002 storage writes
AMM swap~150,000-200,000Multiple reads/writes
Complex DeFi~300,000-500,000Multiple calls
Contract deploy (small)~500,000-1,000,000Code size dependent
ModeMax Gas/BlockEst. TPSBottleneck
Sequential (current)30M200-300Single-core VM
Block-STM (planned)100-150M600-1000Conflict rate
Optimistic ceiling200M1500+I/O, consensus
  • CPU: RISC-V interpreter runs ~30-50M gas/sec on single core
  • Storage: Not bottlenecked; NVMe handles 500K+ IOPS
  • Memory: 32GB sufficient for hot state cache
  • Consensus: Simplex single-slot finality at 1s blocks is not limiting

Recommendation: Keep max_gas_per_block at 30M.

Block-STM enables optimistic parallel execution with conflict detection:

  • Effective parallelism: 3-5x on typical DeFi workloads
  • Conflict-free workloads: Up to 8-12x theoretical
  • High-conflict workloads: Falls back to sequential

Current status: Execution is still sequential (SimpleExecutionEngine applies blocks in order). The prerequisites for Block-STM exist (access lists, per-transaction state journaling, deterministic rollback), but the parallel scheduler + MVCC validation loop is not implemented yet. The design lives in docs/design/block-stm-parallel-execution.md and is deferred until throughput constraints demand it.

Recommendation: After Block-STM implementation, increase to 100M gas/block.

ResourceCapacityAt 30M gas/blockAt 100M gas/block
CPU (sequential)~50M gas/sec60% utilizedBottleneck
CPU (parallel, 16 cores)~200M gas/sec15% utilized50% utilized
NVMe IOPS500K/sec~15% (75K writes)~50% (250K writes)
Memory bandwidth~100GB/s<1%<5%
Network (consensus)1 block/secNot limitingNot limiting

At sustained max throughput (30M gas/block):

MetricValueNotes
Max storage writes/block75,00030M / 400 gas per write
Write rate~7.5 MB/secAssuming 100B avg value
Daily growth~650 GBAt 100% utilization
4TB SSD lifespan~6 daysWithout pruning

Note: Real-world utilization is typically 10-30% of max, and state pruning/compaction is required for long-term operation.

To test different gas limits:

Terminal window
# Run devnet with custom gas config
ASHEN_MAX_GAS_PER_BLOCK=50000000 just devnet-small
# Monitor block gas usage
just rpc-call chain_getBlock '{"height": "latest"}' | jq '.gas_used'
# Stress test with batch transactions
cargo run --release -p ashen --bin ashen -- \
batch execute --count 1000 --gas-limit 100000
  1. Block execution time: Should stay under block time (1s)
  2. Gas utilization: gas_used / max_gas_per_block
  3. State growth rate: Monitor disk usage
  4. Mempool depth: Indicates demand vs capacity
Use Casemax_gastarget_gasBlock TimeNotes
Testnet30M15M1sDefault, conservative
Production (sequential)30M15M1sCurrent implementation
Production (Block-STM)100M50M1sAfter parallel execution
High-throughput L2150M75M500msRequires tuning
  • Gas schedule: docs/gas-schedules/gas-v1.json
  • Gas pricing config: src/core/mod.rs (GasPricingConfig)
  • VM gas metering: crates/vm-gas/src/lib.rs
  • Execution engine: src/core/execution/mod.rs