-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Problem
The geolocation Go SDK tests only verify round-trip consistency within Go itself. They do not prove the Go Borsh deserialization matches the actual Rust Borsh output. If there's a subtle encoding difference (e.g., Ipv4Addr serialization, String length prefix handling, enum discriminant encoding), the Go tests would pass but deserialization of real onchain data would fail.
The serviceability and telemetry SDKs both have fixture-based cross-language tests that catch this class of bug. The geolocation SDK should follow the same pattern.
What to do
Add a Rust fixture generator and Go fixture tests following the established pattern:
-
Rust generator (
sdk/geolocation/testdata/fixtures/generate-fixtures/src/main.rs):- Serialize
GeolocationProgramConfig,GeoProbe, andGeolocationUser(with targets) using Borsh - Write paired
.bin+.jsonfiles (binary data + field metadata)
- Serialize
-
Go fixture test (
sdk/geolocation/go/fixture_test.go):- Load
.bin/.jsonpairs - Deserialize binary using Go SDK
- Validate each field against the JSON metadata
- Load
-
Wire into
make generate-fixturesandmake sdk-test
Reference implementations
sdk/serviceability/testdata/fixtures/generate-fixtures/src/main.rssdk/serviceability/go/fixture_test.go
Context
Identified during architecture review of #3305. Tracked separately so the read SDK can merge without blocking on this.