Skip to content

[Node] Wire: GetLinkOp and BuddyOp event handlers #95

Description

@thep2p

Summary

Wire the process_incoming_event match arms for GetLinkOp and BuddyOp in src/node/base_node.rs. Both funnel into the same try_link-backed link-decision handler (accept-or-forward); BuddyOp first gates on a membership-vector prefix match, then either runs that same decision (on match) or forwards outward / terminates with SetLinkOp{ linked: None } (on no match). Algorithm detail: docs/protocol/concurrent-insert.md, Sections 3.3, 4.1, and 4.3.

Files

  • src/node/base_node.rs — two new match arms.

Acceptance Criteria

  • GetLinkOp: LinkedDirectly → reply SetLinkOp to the originator; Forward → relay the same GetLinkOp to the existing neighbor, unchanged.
  • BuddyOp: on prefix match (predicate from [Node] Add: prefix-match and max-level queries to Core #86), run the identical accept-or-forward decision as GetLinkOp (itself LinkedDirectly or Forward, same as above); on no match, forward outward, or reply SetLinkOp { linked: None } at the end of the line (Section 3.3).
  • A try_link error (invalid level) propagates via .map_err(...)?, matching the other match arms; not unwrapped.
  • Tests cover GetLinkOp both outcomes; BuddyOp match-accept, match-forward, no-match-forward, and end-of-line; and the error path.

Dependencies

Dependency graph (unblocked first):
EPIC #81 -- local search & join protocol
  #67 [DONE] search_by_id            #71 [OPEN] search_by_mem_vec (independent)
  #74 [OPEN] search_by_id timeout fix   #76 [OPEN] delete/leave
  Concurrent join + repair (Algorithm 2 + Algorithm 8; supersedes closed #66, #77):
    L0 (no deps):         #84  #85  #93  #86  #87
    L1:                   #94  #88  #89
    L2:                   #90  #91  #95 <-- YOU ARE HERE  #96
    L3:                   #92
    L4 (acceptance gate): #97

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions