Skip to main content

Evaluation

Tools for simulating HAL expressions before publishing. Expressions run in a sandboxed Tevm fork — no real transactions are submitted.

Evaluate Existing Action

Simulate a saved action by ID. Loads the action’s HAL expression, injects the main() call with provided inputs, and simulates the entire action.

Parameters

ParameterRequiredDescription
actionIdYesAction ID to simulate
inputsYesInput values for the action’s parameters

Returns

  • Evaluation result — Final output of the expression
  • Operation log (oplog) — Full trace of every function call during execution
  • Simulated transaction hashes — Can be inspected with Query Transaction
Always simulate actions before publishing. Iteration is expected: simulate → inspect results with Query Transaction (works on simulated tx hashes) → fix issues → simulate again.

Evaluate Arbitrary Expression

Evaluate a complete, self-contained HAL expression in a sandboxed Tevm fork. Use this for testing expressions that aren’t saved yet.

Parameters

ParameterRequiredDescription
expressionYesComplete HAL expression (JSON array)
inputsNoInput values if the expression has parameters

Returns

  • Evaluation result — Final output
  • Operation log (oplog) — Full execution trace
Before constructing a HAL expression, read the HAL documentation using the Documentation tool with document IDs hal://spec/syntax, hal://spec/modules/herd, and hal://spec/examples. HAL has non-obvious syntax requirements (e.g., ABI arrays must be wrapped in ["quote", [...]] to prevent evaluation).

Tevm Fork Behavior

  • Forks are created lazily — only when the expression performs on-chain actions (read-function, write-function, swap)
  • Pure expressions evaluate without any blockchain interaction
  • Simulated transaction hashes can be queried with Query Transaction to inspect traces

Understanding Oplogs

Both evaluation tools return an operation log (oplog) — a detailed trace of every function call during execution. Each entry contains:
FieldDescription
operationIdUnique ID for this operation
functionNameFunction called (e.g., code, read-function, getPath, user-defined)
statussuccess or error
argsArguments passed to the function
resultReturn value (or error message)
timestampWhen the operation executed

Debugging with Oplogs

  • Trace execution flow — See which functions run and in what order
  • Inspect inputs/outputs — Check what each function receives and returns
  • Identify failures — Failed operations show "status": "error" with error messages
  • Inspect transactions — Use simulated tx hashes with Query Transaction to discover missing approvals, encoding errors, etc.

Simulation Workflow

  1. Read docs — Fetch HAL documentation with the Documentation tool
  2. Search adapters — Find existing adapters with Actions & Adapters
  3. Build expression — Construct your HAL expression
  4. Simulate — Run with Evaluate Arbitrary or Evaluate Existing
  5. Inspect — Check oplog and use Query Transaction on simulated hashes
  6. Iterate — Fix issues and simulate again
  7. Publish — Once validated, publish via Actions & Adapters

Next Steps

Query Transaction

Inspect simulated transactions

HAL Reference

Full HAL language documentation