Skip to content

Comments

sdk/rs: add geolocation GeoProbe instruction builders#3023

Draft
ben-dz wants to merge 3 commits intobdz/doublezero-2952from
bdz/doublezero-3013
Draft

sdk/rs: add geolocation GeoProbe instruction builders#3023
ben-dz wants to merge 3 commits intobdz/doublezero-2952from
bdz/doublezero-3013

Conversation

@ben-dz
Copy link
Contributor

@ben-dz ben-dz commented Feb 17, 2026

Requires #2961
Resolves: #3013

Summary of Changes

  • Add new geolocation module to the Rust SDK with instruction builders for GeoProbe management instructions defined in RFC 16
  • Define GeolocationInstruction Borsh-serializable enum with all 13 RFC variants (0-11) plus UpdateProgramConfig (variant 12), preserving correct Borsh variant indices for future GeolocationUser instructions
  • Implement 7 builder functions that produce solana_sdk::instruction::Instruction objects: init_program_config, update_program_config, create_geo_probe, update_geo_probe, delete_geo_probe, add_parent_device, remove_parent_device
  • Add PDA derivation helpers for program config (["doublezero", "programconfig"]), geo probe (["doublezero", "probe", code]), and geolocation user (["doublezero", "geouser", code]) accounts
  • Add borsh as a direct dependency to the SDK crate

Testing Verification

  • Unit tests verify correct Borsh variant indices for all in-scope instruction types (variants 0-5 and 12)
  • Unit tests validate instruction data payload sizes for fixed-size args
  • Builder tests verify correct account counts, writable/signer permissions, pubkey placement, and program ID assignment for all 7 builders
  • PDA determinism and uniqueness-by-code tests verify correct seed derivation
  • Cross-builder PDA consistency test confirms create and update instructions derive the same probe PDA from matching codes
  • make rust-fmt-check passes (nightly rustfmt with imports_granularity=Crate)
  • Note: cargo build/cargo test could not run locally due to disk space constraints preventing Rust 1.90.0 toolchain installation; CI will validate compilation and test execution

@ben-dz ben-dz linked an issue Feb 17, 2026 that may be closed by this pull request
@ben-dz ben-dz added this to the Geo Location milestone Feb 17, 2026
@ben-dz ben-dz force-pushed the bdz/doublezero-3013 branch 2 times, most recently from 74d72ed to 466d41d Compare February 18, 2026 14:45
@ben-dz ben-dz changed the base branch from main to bdz/doublezero-2952 February 18, 2026 14:53
@ben-dz ben-dz force-pushed the bdz/doublezero-3013 branch 4 times, most recently from 34df513 to e5d60cf Compare February 18, 2026 18:03
@ben-dz ben-dz force-pushed the bdz/doublezero-3013 branch from 2ea7a90 to fad100a Compare February 20, 2026 14:19
@ben-dz ben-dz requested a review from nikw9944 February 20, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

geolocation: Rust SDK — GeoProbe instruction builders

1 participant