Skip to content

e2e: add multicast settlement QA test#3300

Draft
packethog wants to merge 9 commits intomainfrom
ss/multicast-settlement-qa-test
Draft

e2e: add multicast settlement QA test#3300
packethog wants to merge 9 commits intomainfrom
ss/multicast-settlement-qa-test

Conversation

@packethog
Copy link
Contributor

@packethog packethog commented Mar 17, 2026

Summary

  • Add QA test for the multicast seat settlement workflow: pay for an instant seat, validate tunnel comes up, instant withdraw, validate tunnel tears down
  • Add Enable, SeatPay, SeatWithdraw RPCs to qaagent proto and handlers (doublezero enable, doublezero-solana shreds pay, doublezero-solana shreds withdraw --unsafe-now)
  • Add ClosestDevice helper that picks the lowest-latency reachable device
  • Pass Solana RPC URL (--url) and reservation program ID (RESERVATION_PROGRAM_ID env var) through to doublezero-solana per environment
  • Add testnet reservation program ID (dzshrr3yL57SB13sJPYHYo3TV8Bo1i1FxkyrZr3bKNE) to config constants
  • Gate behind -enable-settlement-tests flag so existing CI pipelines are unaffected
  • Support -settlement-host to target a specific client (defaults to random)
  • Default seat amount is 100 USDC, overridable with -seat-amount
  • Cleanup withdraws seat on test exit to avoid orphaned reservations

Usage

# Random host, default amount
go test -tags qa -run TestQA_MulticastSettlement -enable-settlement-tests -env testnet -hosts <host> ./e2e/...

# Specific host, custom amount
go test -tags qa -run TestQA_MulticastSettlement -enable-settlement-tests -env testnet -hosts <host> -settlement-host 10.0.1.5 -seat-amount 200 ./e2e/...

Testing Verification

  • go build ./e2e/... ./config/... and go vet pass cleanly
  • Test skips by default when -enable-settlement-tests is not set
  • Reservation program ID validated at config load time (bad base58 caught early)
  • Cleanup always attempts seat withdrawal to prevent orphaned reservations with real USDC

@packethog packethog force-pushed the ss/multicast-settlement-qa-test branch from ce19925 to b5cd6a2 Compare March 17, 2026 20:46
Comment on lines +25 to +27
// Use a single client for the settlement test.
client := test.RandomClient()
log.Info("Selected client", "host", client.Host)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Starting with a random client but we can expand once this is running

Comment on lines +37 to +40
// Step 1: Enable the reconciler.
log.Info("Enabling reconciler")
err = client.Enable(ctx)
require.NoError(t, err, "failed to enable reconciler")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a no-op on the QA hosts but trying to capture the user workflow.

@packethog packethog self-assigned this Mar 17, 2026
default seat amount to 100 USDC so only the flag is needed to run.
- add cleanup to withdraw seat if test fails after payment
- validate reservation program id at config load time
- avoid context shadowing in agent handlers
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.

1 participant