Skip to content

Add --max_traces flag to chifra export/traces #4031

@tjayrush

Description

@tjayrush

Summary

Add a `--max_traces` flag to `chifra export` and/or `chifra traces` that skips transactions exceeding a trace count threshold. This was present in the old C++ codebase and there's a TODO at `chifra/internal/export/options.go:359`.

Implementation

Use the new `HasNTraces(txHash, n)` function (added in the `trace_get` binary search work) which requires only a single RPC call regardless of trace count. This makes threshold checks essentially free.

Context

  • `HasNTraces` and `GetTracesCount` are already implemented in `chifra/pkg/rpc/get_trace_count.go`
  • Flag would be added via `cmd-line-options.csv`
  • Primary use case: skipping DDoS-era transactions (10K+ traces) during exports

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions