Skip to content

[feat][node] Add link request round trip for join stage 1 - #138

Open
TheP2P (thep2p) wants to merge 1 commit into
thep2p/90-neighbor-query-roundtripfrom
thep2p/90-link-request-roundtrip
Open

TheP2P (thep2p) wants to merge 1 commit into
thep2p/90-neighbor-query-roundtripfrom
thep2p/90-link-request-roundtrip

Conversation

@thep2p

Copy link
Copy Markdown
Collaborator

Summary

  • Add send_link_request, an async round trip that sends GetLinkOp to a destination, asking it to adopt this node as its neighbor on a given side and level, correlating the reply via a fresh Waiter::Link oneshot channel under a timeout.
  • Add the SetLinkOp match arm: the one and only write path for a lookup-table entry from a SetLinkOp, applying Core::try_link unconditionally whenever linked is present and level is in range (independent of whether a matching waiter exists), and separately resolving any pending Waiter::Link. An out-of-range level (peer-controlled) is rejected as RECOVERABLE, PEER-SAFE rather than propagated as a hard error.
  • New dedicated test (test_send_link_request_resolves) plus the existing out-of-range-level regression test, both exercising the arm's write path against a real lookup table.

Part of #90's join stage-1 linking, split into a PR stack: this is the fourth and last round-trip primitive (link request), after the address refactor, span-parentage cleanup, predecessor search, and neighbor query. The orchestration that composes all four follows in a later PR.

Test plan

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test

@thep2p
TheP2P (thep2p) added this pull request to stack #143 September 14, 2026 20:23
@thep2p
TheP2P (thep2p) force-pushed the thep2p/90-link-request-roundtrip branch from 8847bb6 to cd7bf77 Compare September 15, 2026 17:27
@thep2p
TheP2P (thep2p) force-pushed the thep2p/90-link-request-roundtrip branch from cd7bf77 to 94248fd Compare September 15, 2026 17:50
@thep2p
TheP2P (thep2p) force-pushed the thep2p/90-link-request-roundtrip branch from 94248fd to 70b9848 Compare September 15, 2026 21:09
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.

1 participant