Skip to content

[Node] Add: prefix-match and max-level queries to Core #86

Description

@thep2p

Summary

Add two pure-local Core methods with no network awareness: a membership-vector prefix-match predicate (used by BuddyOp handling) and a highest-populated-level query (used by join bootstrap). Both wrap existing lookup/vector logic only.

Details

See docs/protocol/concurrent-insert.md, Sections 3.1 and 3.3.

Scope

  • src/node/core.rsCore trait gains both methods on BaseCore, wrapping existing MembershipVector::common_prefix_bit and LookupTable::left_neighbors/right_neighbors.
  • src/node/core_test.rs — tests for both.

Acceptance Criteria

  • Max-level query returns the highest level with any populated entry, 0 if the table is empty.
  • Prefix-match predicate matches spec 3.3's common_prefix_bit(candidate) >= level check exactly.

Dependencies

None.

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 <-- YOU ARE HERE  #87
    L1:                   #94  #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