Skip to content

Build trace histogram tool (reproduce traceRes.txt) #4032

Description

@tjayrush

Summary

Create a standalone Go tool (or example) that walks blocks and counts traces per transaction, reproducing the data from the old C++ `traceCounter` that generated `traceRes.txt` for the DDoS article.

Implementation

  • Walk blocks via `GetBlockHeaderByNumber` → `LightBlock.Transactions` (list of tx hashes)
  • Call `GetTracesCount` per transaction (binary search, ~2*log2(N) RPC calls each)
  • Accumulate results into a grid (e.g., 251 block ranges × 100 trace count buckets)
  • Output CSV or JSON suitable for chart generation

Context

  • `GetTracesCount` is implemented in `chifra/pkg/rpc/get_trace_count.go`
  • The old C++ tool scanned the DDoS era (blocks ~2.2M–2.7M) and produced histogram data
  • Could live in `examples/` as a new example project

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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