Skip to content

Conversation

@bgm-malbeclabs
Copy link
Contributor

@bgm-malbeclabs bgm-malbeclabs commented Jan 22, 2026

Summary of Changes

From @ben-malbeclabs 's feedback, this PR removes the requirement to tag an interface, only allows interface-cyoaon a physical interface, and uses the same validation logic on update as for create.

Closes #2664

Testing Verification

  • Used Opus 4.5 to add the e2e tests which look good and follow existing conventions
  • Rust tests were added to validate newly added logic

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 implements validation rules for device interfaces, ensuring CYOA can only be set on physical interfaces and enforcing consistent validation logic between create and update operations. The changes remove the requirement to tag interfaces and add comprehensive test coverage.

Changes:

  • Added validation to restrict interface-cyoa to physical interfaces only
  • Applied the same validation logic to both create and update interface operations
  • Added comprehensive e2e and unit tests for interface validation scenarios

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
smartcontract/programs/doublezero-serviceability/src/state/interface.rs Added CYOA validation logic restricting it to physical interfaces, updated public IP validation for loopback interfaces with user_tunnel_endpoint, and added unit tests
smartcontract/programs/doublezero-serviceability/src/processors/device/interface/update.rs Added validation call to update operation to ensure consistent validation with create operation
smartcontract/programs/doublezero-serviceability/src/error.rs Added new error variant InvalidCyoaOnLoopback for CYOA validation failures
smartcontract/cli/src/device/interface/update.rs Simplified loopback type validation logic in CLI update command
e2e/interface_validation_test.go Added comprehensive e2e tests validating CYOA restrictions and public IP handling across interface lifecycle
e2e/activator_interface_delete_test.go Updated test to use loopback-type instead of interface-cyoa for loopback interface
CHANGELOG.md Documented interface validation changes and new e2e tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Test 4: Public IP on loopback without user_tunnel_endpoint should be rejected
if !t.Run("public_ip_on_loopback_without_ute_rejected", func(t *testing.T) {
testInterfaceName := "Loopback103"
publicIP := "203.0.113.20/32" // TEST-NET-3 public IP
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

Same as previous comment - clarify that 203.0.113.0/24 is the TEST-NET-3 block per RFC 5737.

Copilot uses AI. Check for mistakes.
@bgm-malbeclabs bgm-malbeclabs force-pushed the bgm/ip-net-fix branch 2 times, most recently from 52b3350 to fcc9c27 Compare January 22, 2026 23:03
@bgm-malbeclabs bgm-malbeclabs marked this pull request as ready for review January 22, 2026 23:34
Co-authored-by: Steven Normore <snormore@gmail.com>
Co-authored-by: Steven Normore <snormore@gmail.com>
@bgm-malbeclabs bgm-malbeclabs enabled auto-merge (squash) January 23, 2026 02:31
@bgm-malbeclabs bgm-malbeclabs merged commit 64e291a into main Jan 23, 2026
25 of 26 checks passed
@bgm-malbeclabs bgm-malbeclabs deleted the bgm/ip-net-fix branch January 23, 2026 02:42
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.

Improvements to device interface CLI

3 participants