Skip to content

[Node] Add: link/relink-decision handlers to Core #94

Description

@thep2p

Summary

Add two pure-local Core methods on BaseCore (src/node/core.rs) that wrap the lookup-table primitives for message handling: a link-decision method wrapping try_link (backs GetLinkOp and BuddyOp-match handling) and a relink-decision method wrapping try_relink (backs CheckNeighborOp handling). Network-agnostic, mirroring search_by_id. See docs/protocol/concurrent-insert.md, Section 9 (Core surface) and Section 4.3 (the wrapped primitives' outcome types).

Files

  • src/node/core.rs — two new Core trait methods on BaseCore.
  • src/node/core_test.rs — pure-local unit tests (no mock network).

Acceptance Criteria

  • The link-decision method returns the same LinkOutcome try_link would produce for the given (level, direction, candidate).
  • The relink-decision method returns the same RelinkOutcome try_relink would produce for the given (level, direction, claimant).
  • Both are thin wrappers — no lock logic duplicated; try_link/try_relink remain the only place a table entry is written.

Depends on

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 <-- YOU ARE HERE  #88  #89
    L2:                   #90  #91  #95  #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