Skip to content

Transaction Simulation

Transaction simulation runs your call against the current chain state without submitting it. Use it to estimate gas, validate arguments, and preview failures before you sign and send a real transaction.

Simulation is especially important for sealed (private mempool) flows: you should simulate locally before sealing because validators can’t inspect sealed payloads.

Terminal window
# Simulate only (default)
ashen call 0xCONTRACT transfer '["0xTO", 100]' --key $ASHEN_PRIVATE_KEY
Terminal window
ashen contract call \
--contract 0x1234... \
--method transfer \
--args '["0xTO", 100]' \
--idl ./token.idl \
--key $ASHEN_PRIVATE_KEY
Terminal window
ashen contract call ... --wait
Terminal window
ashen contract call ... --force --wait

For programmatic use, the RPC provides dedicated simulation methods:

  • tx_simulate — simulate execution and estimate gas
  • tx_simulate_access — simulation + storage access list
  • tx_simulate_trace — simulation with execution trace
  • tx_simulate_pipeline — multi‑step pipeline (txs + view calls)
  • tx_build_simulate — build + simulate in one call

See /reference/rpc-api/ for full request/response types.

Access lists are hints for the VM to prefetch state and reduce cold storage penalties. To generate a list automatically, use tx_simulate_access and attach it to subsequent transactions.

If you need deeper visibility, use tx_simulate_trace and inspect the execution trace. This is useful for:

  • pinpointing a failing opcode
  • confirming storage keys touched
  • evaluating gas hotspots
  • Simulate with the same origin you’ll use in production.
  • Use fresh state: simulations are only valid for the current head.
  • Simulate before sealing: sealed txs can’t be inspected in the mempool.
  • /guides/using-the-cli/ for call command details
  • /reference/rpc-api/ for simulation endpoints
  • /concepts/private-mempool/ for sealed transaction behavior