serviceability: add reservation account for connection pre-reservation#3086
Merged
martinsander00 merged 1 commit intomainfrom Mar 2, 2026
Merged
serviceability: add reservation account for connection pre-reservation#3086martinsander00 merged 1 commit intomainfrom
martinsander00 merged 1 commit intomainfrom
Conversation
snormore
reviewed
Feb 24, 2026
smartcontract/programs/doublezero-serviceability/src/processors/globalstate/setauthority.rs
Outdated
Show resolved
Hide resolved
smartcontract/programs/doublezero-serviceability/src/processors/reservation/reserve.rs
Outdated
Show resolved
Hide resolved
smartcontract/programs/doublezero-serviceability/src/processors/reservation/reserve.rs
Outdated
Show resolved
Hide resolved
b0616e8 to
764386e
Compare
snormore
approved these changes
Mar 2, 2026
- Add Reservation onchain account (PDA: [prefix, reservation, device_pk, client_ip]) that allows a reservation authority to pre-reserve connection seats on devices before the Activator creates User accounts - Introduce ReserveConnection and CloseReservation instructions — account existence represents a reserved seat, closing the account releases it - Add reserved_seats to Device, factored into capacity checks on both reservation and user creation (users_count + reserved_seats >= max_users) - Add reservation_authority_pk to GlobalState for access control - Update Go, Python, and TypeScript SDKs with new fields
7969ff1 to
aeb9573
Compare
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
Reservationonchain account that allows an offchain reservation authority to pre-reserve connection seats on devices before the Activator creates User accountsReserveConnectionandCloseReservationinstructions — account existence represents a reserved seat, closing the account releases itreserved_seatsto Device, factored into capacity checks (users_count + reserved_seats >= max_users)reservation_authority_pkto GlobalState for access controlKey files
state/reservation.rs— new Reservation account struct and serializationstate/device.rs—reserved_seatsfield, capacity check updateprocessors/reservation/reserve.rs— ReserveConnection processorprocessors/reservation/close.rs— CloseReservation processor (closes account, decrements seats)processors/globalstate/setauthority.rs— support for settingreservation_authority_pkDetails
The Reservation account is a lightweight PDA (
[prefix, reservation, device_pk, client_ip]) that tracks which device and client IP a seat is held for. There is no status enum — the account existing means "reserved", and closing it means "done".CloseReservationcloses the account, returns rent to the payer, and decrementsreserved_seatson the device.Authority is checked against
reservation_authority_pkin GlobalState, with a fallback to the foundation allowlist.Testing Verification
make rust-lintclean