Support uniform and zipfian gas distribution in workload modeler - #70
Support uniform and zipfian gas distribution in workload modeler#70ayaanoncrypto wants to merge 1 commit into
Conversation
PR SummaryLow Risk Overview
Tests cover Reviewed by Cursor Bugbot for commit c9adbb0. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c9adbb0. Configure here.
| return err | ||
| } | ||
| if err := zipfian.dist.validate(); err != nil { | ||
| return err |
There was a problem hiding this comment.
Zipfian gas skips theta validation
High Severity
UnmarshalJSON calls validate on the zero-value dist rather than the unmarshaled theta, so every zipfian gas config passes. GenerateGas then copies the unchecked theta onto dist and samples. An out-of-range value, including 1.0 where alpha diverges, yields a numerically broken gas distribution instead of a parse error.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c9adbb0. Configure here.
| } | ||
| z.dist.Theta = z.Theta | ||
| n := z.Max - z.Min + 1 | ||
| idx, err := z.dist.SampleIndex(rng, n) |
There was a problem hiding this comment.
Zipfian gas range is uncapped
High Severity
GenerateGas passes Max - Min + 1 to the zipfian sampler, which precomputes zeta in O(n) with no upper bound, and Validate does not cap this span. The same picker type is used for gasFeeCapPicker and gasTipCapPicker, where a typical wei range is billions of values and stalls the first draw with nothing logged.
Triggered by learned rule: config/: Validate() must reject silently-degrading misconfigurations
Reviewed by Cursor Bugbot for commit c9adbb0. Configure here.


No description provided.