[pull] master from thrasher-corp:master#111
Merged
pull[bot] merged 2 commits intosyther-labs:masterfrom Feb 27, 2026
Merged
Conversation
…d-state flakiness (#2191) * engine: harden orderbook nominal/impact tests against nil panics and shared state * engine: use counter-based unique test exchange names
* fix: update Gate.io websocket handling for size and amount conversions - Added "X-Gate-Size-Decimal" header in the websocket connection for spot trading. - Updated futures and options processing to convert sizes and amounts to float64 where necessary. - Ensured consistency in handling size and amount across various functions in the Gate.io exchange wrapper. * rm verbosity * docs: Update type usage guidelines for API number handling due to benchmarks below `types.Number` vs `float64` with `,string` — benchmark findings Benchmarked at count=100 on AMD Ryzen 7 5800X (Windows, amd64): | Field type | Avg ns/op | B/op | allocs/op | |---|---|---|---| | `float64` (bare number) | ~414 | 216 | 4 | | `types.Number` (quoted string) | ~403 | 216 | 4 | | `float64` + `,string` tag (quoted string) | ~506 | 264 | **7** | `types.Number` is identical in cost to a bare `float64` — the custom `UnmarshalJSON` allocates nothing of its own (the compiler eliminates the `string(data)` conversion in `strconv.ParseFloat`). By contrast, `float64` with `,string` is ~25% slower and produces 3 extra allocations and 48 extra bytes per decode due to the stdlib reflection path it takes. +**Calling `.Float64()` on a `types.Number` field is optional** — `types.Number` is defined as `type Number float64`, so a direct conversion `float64(n)` or storing it as `types.Number` and passing it where a `float64` is needed are both zero-cost. `.Float64()` is a convenience accessor and may be omitted when the call site already works with `types.Number` directly. * glorious: don't send header down the spot connection, mv it to the futures connection * crank/glorious: nits * thrasher-:nits * glorious: nits in your head * Update exchanges/gateio/gateio_test.go Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * Update exchanges/gateio/gateio_test.go Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * Update exchanges/gateio/gateio_test.go Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * gate f usage --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )