Indexer Debug Playbook (Doginals + Dogenals)
Use this playbook when an indexer “runs” but output looks wrong, missing, or inconsistent across implementations.
1) Fast triage checklist
- Confirm network mode (mainnet/testnet/regtest).
- Confirm first inscription scan height is network-correct.
- Confirm parser recognizes all required markers:
- Era1
ord - Era1
dog(script_sig) - Era2 witness
dogenvelope
- Era1
- Confirm unknown dog versions are indexed as unsupported, not dropped.
- Confirm reorg rollback is enabled and undo state is written.
2) Known high-signal failure modes
- Wrong start height: indexer appears to work but misses early inscriptions.
- Marker mismatch: parser only supports
ordand silently ignoresdog. - Version handling bugs: parser accepts v1 but drops vN without metadata.
- CBOR decode brittleness: malformed payload causes transaction-level abort instead of localized failure.
- Reorg drift: state diverges from tip after short forks.
3) Minimal reproducible tests
Always keep three fixtures in CI:
- Witness
dogv1 fixture (OP_FALSE OP_IF "dog" OP_1 <cbor> OP_ENDIF) - Era1 script_sig
dogfixture (PUSH("dog") PUSH(version) PUSH(cbor...)) - Unknown dog version fixture (
dog+ unsupported version + opaque payload)
Each fixture should assert:
- Parsed marker path
- Parsed or preserved payload
- Final indexed representation
4) PowerShell-first runtime debugging
Use structured logs and filtered output to avoid noise.
$env:RUST_LOG="dogex::indexer=debug,dogex::indexer::envelope=trace,dogex::indexer::updater=debug"
cargo run --bin dogexd -- --network mainnet *>&1 | Tee-Object .\indexer-debug.logQuick scans:
Select-String -Path .\indexer-debug.log -Pattern "reorg|dog|ord|unsupported|error|panic"
Select-String -Path .\indexer-debug.log -Pattern "height|next_sequence_number|last_height"If a run is long, sample around suspicious heights:
Select-String -Path .\indexer-debug.log -Pattern "height=4600000|height=4753897|height=6142069"5) State validation snapshots
After each major parser change:
- Index a small fixed window.
- Export deterministic summary (counts by module/marker/version).
- Compare against prior known-good snapshot.
Recommended summary fields:
- last indexed height
- total inscriptions
- counts by marker (
ord,dog,Ð:*) - counts by dog version (
1, unsupported) - rollback count / last rollback height
6) Cross-indexer parity workflow
For parity checks against a reference implementation:
- Pick a fixed block window.
- Compare transaction-level parse results first.
- Compare final state second.
- Investigate first mismatch only; do not batch-debug many mismatches at once.
7) Operational recommendations
- Keep parser failures localized to the offending envelope or tx.
- Never let a single malformed envelope stop full block indexing.
- Attach enough context in logs:
height,txid,input_index,path(ord/dog),version. - Use explicit feature flags for experimental envelope branches.
8) Definition of done for parser changes
- Unit tests: new happy path + malformed path + unknown-version path.
- Integration test: one fixed block-window run with deterministic summary.
- Reorg test: apply and roll back at least one fixture block.
- Docs updated: spec + vectors + this playbook.