Skip to content

smartcontract: update device interface IPs on link tunnel_net change#3365

Merged
elitegreg merged 2 commits intomainfrom
gm/issue-3361
Mar 24, 2026
Merged

smartcontract: update device interface IPs on link tunnel_net change#3365
elitegreg merged 2 commits intomainfrom
gm/issue-3361

Conversation

@elitegreg
Copy link
Contributor

Closes #3361

Summary of Changes

  • When UpdateLink changes tunnel_net, the device interface IPs on both sides are now recalculated from the new tunnel_net, matching the existing behavior in ActivateLink
  • The UpdateLink instruction now accepts optional device accounts (side_a, side_z) when tunnel_net is being updated, in both onchain and legacy allocation modes
  • The SDK automatically includes the device accounts when tunnel_net is provided

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 2 +72 / -5 +67
Tests 1 +19 / -0 +19

~80% of the diff is core logic (processor + SDK); the rest is test assertions.

Key files (click to expand)
  • smartcontract/programs/doublezero-serviceability/src/processors/link/update.rs — add optional device account parsing and interface IP update logic after tunnel_net change
  • smartcontract/programs/doublezero-serviceability/tests/link_onchain_allocation_test.rs — pass device accounts in tunnel_net update test, assert interface IPs match new tunnel_net
  • smartcontract/sdk/rs/src/commands/link/update.rs — include link's side_a/side_z device accounts when tunnel_net is being updated

Testing Verification

  • Extended test_update_link_tunnel_reallocation_with_onchain_allocation to pass device accounts and assert that both device interface IPs are updated to match the new tunnel_net (10.100.0.10/31 → side_a gets 10.100.0.10/31, side_z gets 10.100.0.11/31)
  • All 13 link onchain allocation tests pass
  • All link WAN and DZX tests pass (7 total)
  • make rust-fmt and make rust-lint clean

When tunnel_net is updated via UpdateLink, the device interface IPs
derived from it were not being updated. This adds device account
handling to the update processor so interface IPs on both sides are
recalculated from the new tunnel_net, matching the behavior already
present in ActivateLink.

Closes #3361
@elitegreg elitegreg enabled auto-merge (squash) March 24, 2026 04:04
Copy link
Contributor

@juan-malbeclabs juan-malbeclabs left a comment

Choose a reason for hiding this comment

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

LGTM

@elitegreg elitegreg merged commit e2dda3d into main Mar 24, 2026
40 of 41 checks passed
@elitegreg elitegreg deleted the gm/issue-3361 branch March 24, 2026 14:56
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.

doublezero link update for tunnel_net does not update interfaces

2 participants