Skip to content

sdk: serviceability go executor CreateUser/DeleteUser#3774

Open
elitegreg wants to merge 3 commits into
mainfrom
gm/sdk-user-crud-reconcile
Open

sdk: serviceability go executor CreateUser/DeleteUser#3774
elitegreg wants to merge 3 commits into
mainfrom
gm/sdk-user-crud-reconcile

Conversation

@elitegreg
Copy link
Copy Markdown
Contributor

@elitegreg elitegreg commented May 27, 2026

Summary

Adds the Solana-side primitives the device-stress orchestrator (#3746) needs as a library-only change — no new binary.

  • CreateUser (variant 36) and DeleteUser (variant 42) executor methods on smartcontract/sdk/go/serviceability, with account-list construction mirroring the Rust SDK; both wait for post-confirmation visible state so callers get a meaningful t_activate to record.
  • PDA helpers GetUserPDA, GetAccessPassPDA, GetTunnelIdsPDA, GetDzPrefixBlockPDA — seeds mirrored from smartcontract/programs/doublezero-serviceability/src/pda.rs.
  • Rust fixture generator extended to emit user_create_args.{bin,json} and user_delete_args.{bin,json}; Go tests load them as the cross-language wire-format contract.

Part 1 of #3746. Closes #3770.

PlanReconcile / ReconcilePlan were originally scoped here but are orchestrator policy, not an SDK primitive, so they now land alongside the orchestrator binary in part 2 of #3746.

Testing Verification

  • Golden-byte parity: Go buildCreateUserInstruction / buildDeleteUserInstruction produce the same borsh body as the Rust-generated fixtures (user_create_args.bin, user_delete_args.bin).
  • Account ordering verified against the Rust SDK's expected AccountMeta lists (smartcontract/sdk/rs/src/commands/user/create.rs:209 and delete.rs:363).
  • New PDA helpers cross-checked against an independent recomputation of the seed bytes; GetTunnelIdsPDA / GetDzPrefixBlockPDA verified to use 8-byte little-endian index.
  • make go-build go-lint go-test all green.

@elitegreg elitegreg changed the title sdk: serviceability go executor CreateUser/DeleteUser + reconcile planner sdk: serviceability go executor CreateUser/DeleteUser May 27, 2026
elitegreg added 3 commits May 27, 2026 15:13
… planner

Adds the Solana-side primitives the device-stress orchestrator (#3746) needs:

- CreateUser / DeleteUser methods on the Go serviceability executor (variants
  36 / 42), with account-list construction mirroring the Rust SDK and a
  post-confirmation visibility wait so callers can record t_activate against
  the user PDA.
- PDA helpers: GetUserPDA, GetAccessPassPDA, GetTunnelIdsPDA,
  GetDzPrefixBlockPDA — seed bytes mirrored from
  smartcontract/programs/doublezero-serviceability/src/pda.rs.
- Pure PlanReconcile function and ReconcilePlan type for sweep delta planning,
  deterministic via ClientIp-ascending sort.
- Rust fixture generator extended to emit user_create_args.{bin,json} and
  user_delete_args.{bin,json}; Go tests load them as the cross-language wire
  format contract.

Part 1 of #3746 — library-only, no new binary.

Closes #3770.
PlanReconcile is orchestrator policy ("how many users do we want") rather
than an SDK primitive ("how do I submit a CreateUser/DeleteUser"). Move it
out of the serviceability SDK and land it alongside the device-stress
orchestrator binary in part 2 of #3746.
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.

stress: serviceability SDK user CRUD + reconcile-to-target (part 1 of #3746)

1 participant