geolocation: onchain portion of alternate offset-destinations#3501
Merged
geolocation: onchain portion of alternate offset-destinations#3501
Conversation
karl-dz
reviewed
Apr 9, 2026
smartcontract/programs/doublezero-geolocation/src/state/geolocation_user.rs
Outdated
Show resolved
Hide resolved
karl-dz
reviewed
Apr 9, 2026
...ct/programs/doublezero-geolocation/src/processors/geolocation_user/set_result_destination.rs
Outdated
Show resolved
Hide resolved
karl-dz
reviewed
Apr 9, 2026
...ct/programs/doublezero-geolocation/src/processors/geolocation_user/set_result_destination.rs
Outdated
Show resolved
Hide resolved
karl-dz
reviewed
Apr 9, 2026
...ct/programs/doublezero-geolocation/src/processors/geolocation_user/set_result_destination.rs
Outdated
Show resolved
Hide resolved
karl-dz
reviewed
Apr 9, 2026
...ct/programs/doublezero-geolocation/src/processors/geolocation_user/set_result_destination.rs
Outdated
Show resolved
Hide resolved
karl-dz
reviewed
Apr 9, 2026
...ct/programs/doublezero-geolocation/src/processors/geolocation_user/set_result_destination.rs
Show resolved
Hide resolved
b620d03 to
84e4f3b
Compare
…ion field Add optional result_destination string field to GeolocationUser (backwards- compatible via BorshDeserializeIncremental). New SetResultDestination instruction sets/clears the destination in host:port format (IP or domain), validates publicly routable IPs and domain format, and bumps target_update_count on all referenced probes.
84e4f3b to
569f815
Compare
karl-dz
approved these changes
Apr 10, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of Changes
result_destinationfield to theGeolocationUseronchain account, allowing users to specify an IP:port or domain:port where geoprobe results should be sentSetResultDestinationinstruction that validates the destination (public IP or valid domain + port), updates the user account, and bumpstarget_update_counton all referenced probe accounts so they pick up the changeBorshDeserializeIncrementalfor backward-compatible deserialization of existing accounts that lack the new fieldDiff Breakdown
~60% tests, ~37% core logic — well-covered new instruction.
Key files (click to expand)
smartcontract/programs/doublezero-geolocation/tests/geolocation_user_test.rs— integration tests for set/clear/unauthorized/invalid-IP/missing-probe/domain scenariossmartcontract/programs/doublezero-geolocation/src/processors/geolocation_user/set_result_destination.rs— new processor: validates destination, updates user, bumps probe target_update_countsmartcontract/programs/doublezero-geolocation/src/state/geolocation_user.rs— addresult_destinationfield with incremental deserialization, refactor TryFrom implssmartcontract/programs/doublezero-geolocation/src/instructions.rs— register SetResultDestination variant and argssmartcontract/programs/doublezero-geolocation/src/entrypoint.rs— route new instruction to processorsmartcontract/cli/src/geolocation/user/get.rs— display result_destination in CLI get outputsmartcontract/programs/doublezero-geolocation/src/error.rs— add TooManyReferencedProbes error variantTesting Verification