Skip to content

[test][node] Cover join stage-1 becoming the new leftmost node - #142

Open
TheP2P (thep2p) wants to merge 1 commit into
thep2p/90-join-stage1-no-right-neighbor-testfrom
thep2p/90-join-stage1-new-leftmost-node-test
Open

TheP2P (thep2p) wants to merge 1 commit into
thep2p/90-join-stage1-no-right-neighbor-testfrom
thep2p/90-join-stage1-new-leftmost-node-test

Conversation

@thep2p

Copy link
Copy Markdown
Collaborator

Summary

  • Add test_join_stage1_link_level0_new_leftmost_node_sends_single_link_request: the mirror of the no-right-neighbor test, covering introducer.id() > u.id(), where u becomes the new leftmost node reachable from introducer. This is the scenario the direction-selection fix (in the orchestration PR earlier in this stack) exists to handle correctly, so it's the test that actually proves that fix.
  • Two small carried-over fixes caught during final verification against the reference implementation, both one-line: BaseNode::search_by_id's own span was missing its parent: &self.span (the pre-existing synchronous search method, missed when the span-parentage PR was split out earlier in this stack), and Core::search_by_id's doc comment was missing the paragraph explaining why the relay chain's self-terminating fallback is only sound when the caller picks the search direction so the first hop already satisfies it, the doc-side explanation of the same invariant the orchestration PR's direction-selection logic depends on.

This completes #90's required test coverage: normal two-sided link, one-node-graph edge case, and no-known-neighbor (both sides) are now all covered.

Test plan

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

@thep2p
TheP2P (thep2p) added this pull request to stack #143 September 14, 2026 20:23
@thep2p
TheP2P (thep2p) force-pushed the thep2p/90-join-stage1-new-leftmost-node-test branch from fe11b97 to f26479b Compare September 15, 2026 17:27
@thep2p
TheP2P (thep2p) force-pushed the thep2p/90-join-stage1-new-leftmost-node-test branch from f26479b to 14e3226 Compare September 15, 2026 17:50
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