Skip to content

sdk/geolocation: add Go write SDK for add/remove target operations#3558

Merged
ben-dz merged 2 commits intomainfrom
bdz/doublezero-3557
Apr 23, 2026
Merged

sdk/geolocation: add Go write SDK for add/remove target operations#3558
ben-dz merged 2 commits intomainfrom
bdz/doublezero-3557

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented Apr 21, 2026

Resolves: #3557

Summary of Changes

  • New Go write SDK for the geolocation program focused on target management: instruction builders for AddTarget and RemoveTarget, plus a transaction executor.
  • Instruction builders follow the telemetry write SDK pattern: *InstructionConfig struct + Validate() + Build*Instruction() returning a self-contained solana.Instruction, using near/borsh-go to match the Rust program's Borsh layout.
  • User lifecycle (CreateGeolocationUser, UpdateGeolocationUser, DeleteGeolocationUser) and SetResultDestination are deferred to a follow-on PR (sdk/geolocation: add Go write SDK for user lifecycle and result destination #3567) to keep this reviewable — my immediate consumer only needs add/remove targets.

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 5 +475 / -0 +475
Tests 4 +389 / -0 +389

Pure-additive new package; ~45% of the diff is tests.

Testing Verification

  • Borsh serialization tests pin discriminator bytes, field ordering, and IP/port/target-pk layout against the Rust program's expected layout for Add/Remove.
  • Private-IP validation covers all reserved ranges (10/8, 172.16/12, 192.168/16, 127/8, 0.0.0.0) for outbound target types.
  • Account-meta ordering verified against the Rust SDK command builders.
  • Executor error paths covered: missing signer, missing program ID.

@ben-dz ben-dz marked this pull request as ready for review April 22, 2026 17:43
@ben-dz ben-dz force-pushed the bdz/doublezero-3557 branch from 16974cb to 4ccf129 Compare April 22, 2026 17:51
@ben-dz ben-dz marked this pull request as draft April 22, 2026 18:40
@ben-dz ben-dz force-pushed the bdz/doublezero-3557 branch from 4ccf129 to f546aff Compare April 22, 2026 18:49
@ben-dz ben-dz changed the title sdk/geolocation: add Go write SDK for user-facing operations sdk/geolocation: add Go write SDK for add/remove target operations Apr 22, 2026
@ben-dz ben-dz marked this pull request as ready for review April 22, 2026 18:56
Comment thread sdk/geolocation/go/add_target.go Outdated
Comment thread sdk/geolocation/go/remove_target.go
Comment thread sdk/geolocation/go/executor.go
Comment thread sdk/geolocation/go/executor_test.go
Copy link
Copy Markdown
Contributor

@vihu vihu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ben-dz ben-dz merged commit 5d7a866 into main Apr 23, 2026
36 checks passed
@ben-dz ben-dz deleted the bdz/doublezero-3557 branch April 23, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Geolocation: Complete Go Write SDK

2 participants