Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SDL Reference

Complete reference for the GasHammer Scenario Definition Language.

Top-Level Fields

FieldTypeRequiredDescription
namestringyesUnique scenario name (alphanumeric, hyphens, underscores)
descriptionstringyesHuman-readable description
versionstringyesScenario version

Target Section

Connection parameters for the Nitro deployment under test.

target:
  chain_id: 412346
  sequencer_rpc: "http://sequencer:8547"
  gateway_rpc: "http://gateway:8547"
  feed_relay: "ws://feed-relay:9642"
FieldTypeRequiredDescription
chain_idu64yesChain ID of the Nitro rollup
sequencer_rpcURLyesSequencer JSON-RPC endpoint
gateway_rpcURLnoGateway JSON-RPC endpoint
feed_relayURLnoFeed relay WebSocket URL

Workload Section

Defines the transaction workload.

workload:
  gas_rate:
    type: sustained | ramp | burst
    gas_per_sec: 5_000_000        # for sustained
    start_gas_per_sec: 1_000_000  # for ramp
    end_gas_per_sec: 10_000_000   # for ramp
    burst_gas: 50_000_000         # for burst
    burst_duration_secs: 5        # for burst
  seed: 42
  templates:
    - name: simple-transfer
      weight: 70
    - name: erc20-transfer
      weight: 30

Gas Rate Types

TypeFieldsDescription
sustainedgas_per_secConstant gas rate
rampstart_gas_per_sec, end_gas_per_secLinear ramp between rates
burstburst_gas, burst_duration_secsShort burst followed by zero

Built-in Templates

TemplateEstimated GasDescription
simple-transfer21,000ETH value transfer
erc20-transfer~65,000ERC-20 token transfer
erc20-approve~46,000ERC-20 approval
storage-write~44,000+Write to storage slots
compute-heavyconfigurableCPU-intensive computation

Seed

The seed field (optional, defaults to 0) seeds the deterministic PRNG. The same seed with the same scenario configuration produces the same transaction sequence.

Phases Section

Phases define time segments within a run. Each phase can override the default gas rate.

phases:
  - name: warmup
    duration_secs: 30
    gas_rate_override:
      type: sustained
      gas_per_sec: 1_000_000
  - name: steady-state
    duration_secs: 300
  - name: cooldown
    duration_secs: 30
    gas_rate_override:
      type: sustained
      gas_per_sec: 500_000
FieldTypeRequiredDescription
namestringyesPhase name
duration_secsu64yesPhase duration in seconds (min: 1)
gas_rate_overrideGasRatenoOverride the default gas rate for this phase

Oracle Section

Configure correctness checks.

oracle:
  invariants:
    - balance-conservation
    - nonce-monotonicity
    - gas-accounting
  check_interval_secs: 10
FieldTypeRequiredDescription
invariantslistnoWhich invariant checks to enable
check_interval_secsu64noHow often to run live checks (default: 10)

Fault Schedule Section

Define controlled failures to inject during the run.

fault_schedule:
  - at_secs: 60
    action: inject
    fault:
      type: latency
      target: sequencer-rpc
      latency_ms: 200
      jitter_ms: 50
  - at_secs: 120
    action: clear
    fault:
      type: latency
      target: sequencer-rpc
FieldTypeRequiredDescription
at_secsu64yesSeconds from run start
actioninject or clearyesWhether to start or stop the fault
fault.typestringyesFault type: latency, packet-loss, feed-disconnect, partition
fault.targetstringyesComponent to target
fault.latency_msu64variesAdded latency (for latency type)
fault.jitter_msu64noLatency jitter
fault.loss_pctf64variesPacket loss percentage (for packet-loss type)

Edges Section

Control edge deployment.

edges:
  count: 3
  accounts_per_edge: 100
FieldTypeRequiredDescription
countu32noNumber of edges (default: 1)
accounts_per_edgeu32noAccounts per edge (default: 100)