PLT-465: wire key/size/op distributions into StorageRW#54
Conversation
Turn StorageRW into the contention + size axes: slot = keyDist.SampleIndex( recordcount), op (read/write/rmw) by configured proportions, calldata pad = sizeDist bucket draw — each on an INDEPENDENT seeded sub-stream so changing one axis never perturbs another. Nil-guarded like the gas-picker: no distribution config => fixed slot 0 / rmw / empty pad, byte-identical to the PLT-461 scaffold (consumes zero randomness, account cadence untouched). Adds one append-only sub-stream id (dist:%d:op) to the FROZEN set per the append-only derivation rule; pad gas added as intrinsic EIP-2028 cost so it can't underprovision. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Scenario JSON gains optional The new Reviewed by Cursor Bugbot for commit a541fba. Bugbot is set up for automated code reviews on this repo. Configure here. |
…view) - Scenario.Validate rejects SizeBuckets[i] < 0 (make([]byte,-1) panic on the pickPad hot path) and > maxCalldataPadBytes (1 MiB OOM guard); wired via LoadConfig.ValidateScenarios in loadConfig, mirroring ValidateFunding. - Inline OperationMix.stream (drop the one-field opStreamHolder wrapper) to match GasPicker/Distribution; move the mis-subjected doc comment to the field. No change to draw behavior — byte-identical-default + independence tests green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
De-changelog the doc.go StorageRW narrative (drop 'PLT-465 turns it into', 'PLT-461 scaffold byte-for-byte') to a timeless present-tense description, and replace the now-dangling era term 'scaffold' with 'default' in inline default-path notes. Keep load-bearing comments (FROZEN append-only stream-id ledger, EIP-2028 gas-per-byte why, nil-guard/default invariants, the no-underprovision note). Comment-only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Implements PLT-465 (M3.3) — turns StorageRW into the two customer-named axes (key-contention + tx-size).
What (
generator/scenarios/StorageRW.go)keyDist.SampleIndex(recordcount); op (read/write/rmw) by configured proportions; calldata pad length =sizeDistbucket draw.dist:%d:key,dist:%d:size(existing),dist:%d:op(new, append-only to the FROZEN set) — changing one axis never perturbs another's sequence (guarded by a determinism test).One-way door (flagged)
The new
dist:%d:opsub-stream id is an append-only addition to the FROZEN seed→stream contract (doesn't reseed existing streams; expands the saved-replay surface).Verify
make lint0 issues ·go build·go test -race ./...green. Tests: contention sweep, size-bucket histogram, key/size + key/op independence, op-mix, byte-identical default, additive config.🤖 Generated with Claude Code
📐 Design: decision brief — PLT-465 · parent design