Skip to content

Conversation

@juan-malbeclabs
Copy link
Contributor

Summary of Changes

  • The owner parameter is added to the contributor creation instruction.
  • The SDK and CLI are updated accordingly.
  • Validation checks are added to ensure that both the device and the link belong to the same contributor.

Testing Verification

  • Show evidence of testing the change

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an owner field to both Create and Update Contributor commands, enabling explicit ownership assignment instead of defaulting to the payer. The change affects the entire stack from smart contract processors to CLI interfaces.

Key changes:

  • Add owner field to ContributorCreateArgs and ContributorUpdateArgs structs
  • Update validation logic to ensure devices and links belong to the same contributor owner
  • Modify CLI commands to accept owner parameter

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
smartcontract/programs/doublezero-serviceability/src/processors/contributor/create.rs Adds owner field to creation args and uses it instead of payer key
smartcontract/programs/doublezero-serviceability/src/processors/contributor/update.rs Adds owner field to update args with optional update capability
smartcontract/programs/doublezero-serviceability/src/processors/link/create.rs Adds validation to ensure link devices belong to same contributor owner
smartcontract/programs/doublezero-serviceability/src/processors/device/create.rs Refactors validation to use assertions instead of if statements
smartcontract/sdk/rs/src/commands/contributor/create.rs Updates SDK command to include owner field
smartcontract/sdk/rs/src/commands/contributor/update.rs Updates SDK command to include optional owner field
smartcontract/cli/src/contributor/create.rs Adds owner CLI parameter for creation
smartcontract/cli/src/contributor/update.rs Adds owner CLI parameter for updates
Comments suppressed due to low confidence (1)

smartcontract/programs/doublezero-serviceability/src/processors/link/create.rs:84

  • [nitpick] Unnecessary blank line removal. This change doesn't add functional value and may reduce code readability by removing logical separation.
    if !globalstate.device_allowlist.contains(payer_account.key) {

@juan-malbeclabs juan-malbeclabs requested a review from a team July 30, 2025 13:55
@juan-malbeclabs juan-malbeclabs merged commit 7a1690f into main Jul 30, 2025
15 checks passed
@juan-malbeclabs juan-malbeclabs deleted the jo/986 branch July 30, 2025 19:14
@juan-malbeclabs juan-malbeclabs linked an issue Aug 4, 2025 that may be closed by this pull request
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.

Add owner Pubkey to Contributor creation and enforce ownership rules Add owner Pubkey to Contributor Account

4 participants