Stage 1: Dry Run
The dry run simulates your Cairo module against live RPC data. It produces the key set that the fetcher later turns into proofs.
Entry point
crates/dry_run/src/lib.rs
Execution flow
- Load the compiled Cairo module.
- Construct
HDPDryRunInput(compiled class, params, injected state). - Run the Cairo VM with
CustomHintProcessor. - Syscall handlers call RPC endpoints and collect keys.
- Write
dry_run_output.jsonwith the serialized handler state.
The dry run uses the all_cairo layout in the Cairo VM.
Output artifacts
dry_run_output.json: serializedSyscallHandlercontaining key sets for each handler.- Printed output (optional):
HDPDryRunOutputwithtask_hashandoutput_rootfields.
dry_run_output.json structure (high level)
The file is a JSON serialization of the Rust SyscallHandler. At a high level it looks like:
{
"call_contract_handler": {
"evm_call_contract_handler": { "key_set": [ ... ] },
"starknet_call_contract_handler": { "key_set": [ ... ] },
"injected_state_call_contract_handler": { "key_set": { "<label>": [ ... ] } },
"unconstrained_call_contract_handler": { "key_set": [ ... ] }
}
}
This file is the only input needed by the fetcher.
If you pass --print_output, the command prints the decoded HDPDryRunOutput struct, which includes task hash and output root values.
Requirements
Dry run requires RPC endpoints for any chain your module queries.
CLI usage
hdp dry-run -m <module.compiled_contract_class.json> --print_output
Important flags:
--output <path>: output path fordry_run_output.json--inputs <path>: JSON module input parameters--injected_state <path>: injected state JSON--print_output: prints the Cairo output segment