Skip to content

Phase 1: Distribution primitive (uniform/zipfian, seeded) #35

Description

@bdchatham

Part of #33.

Problem

The only distribution knob today is the gas picker (config/gas.go, {Name, Min, Max} polymorphic). We need one reusable sampling abstraction for every axis (key, size, later wallet/contract).

Approach

  • Generalize the gas-picker pattern into a Distribution that draws an index into a keyspace [0,N). Phase 1 kinds: uniform, zipfian(θ) only.
  • Match the existing Name discriminator (do not introduce a second kind convention); reject unknown kinds loudly.
  • Re-home GasPicker onto Distribution so existing gas configs deserialize unchanged.
  • Seeded PRNG with a pinned seed → per-distribution/per-worker sub-stream derivation (load-bearing for run replay; today's math/rand/v2 globals are unseeded).

Acceptance criteria

  • uniform + zipfian(θ) selectable via config; deterministic given seed.
  • Existing gas-picker configs and profiles/*.json behave identically (BC).

Design: https://github.com/sei-protocol/platform/blob/main/docs/designs/sei-load-workload-modeler.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions