smartcontract: update device interface IPs on link tunnel_net change#3365
Merged
smartcontract: update device interface IPs on link tunnel_net change#3365
Conversation
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
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.
Closes #3361
Summary of Changes
UpdateLinkchangestunnel_net, the device interface IPs on both sides are now recalculated from the new tunnel_net, matching the existing behavior inActivateLinkUpdateLinkinstruction now accepts optional device accounts (side_a, side_z) whentunnel_netis being updated, in both onchain and legacy allocation modestunnel_netis providedDiff Breakdown
~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 changesmartcontract/programs/doublezero-serviceability/tests/link_onchain_allocation_test.rs— pass device accounts in tunnel_net update test, assert interface IPs match new tunnel_netsmartcontract/sdk/rs/src/commands/link/update.rs— include link's side_a/side_z device accounts when tunnel_net is being updatedTesting Verification
test_update_link_tunnel_reallocation_with_onchain_allocationto 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 gets10.100.0.10/31, side_z gets10.100.0.11/31)make rust-fmtandmake rust-lintclean