Skip to content

feat(kad): service discovery - #2055

Closed
SionoiS wants to merge 60 commits into
masterfrom
feat--logos-capability-discovery
Closed

SionoiS wants to merge 60 commits into
masterfrom
feat--logos-capability-discovery

Conversation

@SionoiS

@SionoiS SionoiS commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

Implementation of logos-service-discovery

Note to reviewers:

  • Libp2p folks should focus on architecture and code organisation.
  • Research folks should focus on spec compliance and sound logic.
    🙏

@github-actions

github-actions Bot commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

🏁 Performance Summary

Commit: a3046fa57197880e6e384c4c9bc9906fbe2a4461

Scenario Nodes Total messages sent Total messages received Latency min (ms) Latency max (ms) Latency avg (ms)
❌ Base Test (QUIC) 10 100 621 93.012 13404.407 5597.907
✅ Base Test (TCP) 10 100 900 0.404 41.257 1.558

📊 View Container Resources in the Workflow Summary

Latency History

🔵 Min • 🟢 Avg • 🔴 Max

%%{init: {"xyChart": {"width": 500, "height": 200}}}%%
xychart-beta
    title "TCP"
    x-axis "PR Number" 1599 --> 2147
    y-axis "Latency (ms)"
    line "Min" [0.315, 0.429, 0.308, 0.349, 0.397, 0.259, 0.317, 0.333, 0.266, 0.278, 0.322, 0.300, 0.301, 0.302, 0.263, 0.338, 0.288, 0.308, 0.318, 0.313, 0.358, 0.317, 0.274, 0.293, 0.278, 0.312, 0.308, 0.280, 0.296, 0.292, 0.296, 0.296, 0.437, 0.265, 0.444, 0.396, 0.323, 0.305, 0.305, 0.293, 0.333, 0.322, 0.370, 0.273, 0.338, 0.275, 0.318, 0.322, 0.405, 0.278, 0.325, 0.297, 0.275, 0.297, 0.280, 0.277, 0.407, 0.304, 0.329, 0.319, 0.372, 0.289, 0.317, 0.262, 0.298, 0.376, 0.331, 0.257, 0.286, 0.299, 0.267, 0.530, 0.277, 0.240, 0.266, 0.424, 0.235, 0.261, 0.364, 0.422, 0.274, 0.297, 0.313, 0.291, 0.317, 0.356, 0.274, 0.222, 0.290, 0.253, 0.319, 0.268, 0.303, 0.246, 0.304, 0.316, 0.217, 0.252, 0.431, 0.247, 0.291, 0.267, 0.297, 0.392, 0.267, 0.335, 0.447, 0.289, 0.251, 0.361, 0.400, 0.393, 0.323, 0.267, 0.357, 0.284, 0.266, 0.319, 0.284, 0.299, 0.340, 0.323, 0.239, 0.300, 0.323, 0.339, 0.274, 0.272, 0.342, 0.594, 0.341, 0.254, 0.492, 0.404, 0.499, 0.418, 0.565, 0.343, 0.537, 0.486, 0.487, 0.497, 0.532, 0.582, 0.544, 0.482, 0.502, 0.464, 0.463, 0.510, 0.496, 0.424, 0.363, 0.437, 0.505, 0.484, 0.449, 0.453, 0.648, 0.572, 0.494, 0.498, 0.466, 0.528, 0.407, 0.503, 0.424, 0.473, 0.380, 0.535, 0.423, 0.493, 0.465, 0.439, 0.428, 0.467, 0.492, 0.461, 0.458, 0.469, 0.513, 0.532, 0.414, 0.379, 0.462, 0.462, 0.458, 0.466, 0.450, 0.432, 0.457, 0.424, 0.502, 0.446, 0.420, 0.515, 0.448, 0.438, 0.503, 0.542, 0.392, 0.516, 0.465, 0.457, 0.470, 0.529, 0.444, 0.409, 0.485, 0.377, 0.392, 0.555, 0.369, 0.320, 0.528, 0.448, 0.465, 0.487, 0.433, 0.549, 0.351, 0.323, 0.373, 0.471, 0.519, 0.493, 0.372, 0.420, 0.389, 0.426, 0.399, 0.365, 0.425, 0.463, 0.602, 0.492, 0.569, 0.500, 0.536, 0.525, 0.456, 0.422, 0.360, 0.535, 0.403, 0.563, 0.531, 0.537, 0.435, 0.512, 0.585, 0.474, 0.447, 0.370, 0.540, 0.501, 0.404, 0.560, 0.401, 0.477, 0.394, 0.326, 0.393, 0.410, 0.505, 0.383, 0.278, 0.479, 0.377, 0.467, 0.497, 0.320, 0.440, 0.434, 0.500, 0.346, 0.477, 0.456, 0.394, 0.353, 0.445, 0.492, 0.365, 0.485, 0.377, 0.450, 0.395, 0.355, 0.281, 0.344, 0.502, 0.459, 0.445, 0.422, 0.502, 0.405, 0.487, 0.499, 0.393, 0.469, 0.352, 0.395, 0.590, 0.332, 0.374, 0.490, 0.379, 0.536, 0.428, 0.484, 0.342, 0.562, 0.390, 0.488, 0.374, 0.404, 0.485, 0.355, 0.446, 0.503, 0.357, 0.499, 0.355, 0.435, 0.345, 0.441, 0.462, 0.429, 0.449, 0.495, 0.464, 0.372, 0.426, 0.437, 0.430, 0.510, 0.405, 0.466, 0.463, 0.455, 0.450, 0.325, 0.557, 0.317, 0.463, 0.442, 0.491, 0.596, 0.459, 0.499, 0.516, 0.422, 0.349, 0.399, 0.422, 0.499, 0.425, 0.462, 0.561, 0.391, 0.565, 0.448, 0.410, 0.524, 0.438, 0.473, 0.471, 0.396, 0.484, 0.314, 0.392, 0.489, 0.431, 0.616, 0.371, 0.451, 0.476, 0.364, 0.308, 0.474, 0.452, 0.546, 0.382, 0.507, 0.425, 0.495, 0.543, 0.428, 0.405, 0.320, 0.471, 0.382]
    line "Avg" [1.042, 1.134, 1.015, 1.035, 1.177, 0.899, 1.040, 1.085, 0.860, 1.015, 1.020, 0.945, 0.986, 1.074, 0.899, 0.975, 0.958, 1.027, 0.959, 1.047, 1.103, 1.046, 0.908, 0.882, 0.896, 1.064, 1.011, 0.957, 0.991, 0.923, 0.867, 0.959, 1.126, 0.910, 1.125, 1.085, 0.983, 1.049, 1.053, 1.056, 1.080, 0.989, 1.137, 1.007, 1.062, 0.874, 1.065, 1.137, 1.321, 0.852, 1.080, 0.991, 1.003, 1.017, 0.971, 1.068, 1.026, 1.054, 1.100, 1.054, 1.087, 0.961, 0.886, 0.878, 1.028, 1.247, 1.023, 0.887, 1.015, 0.952, 0.875, 1.716, 1.003, 0.997, 0.982, 1.178, 0.804, 0.839, 1.092, 1.110, 0.850, 1.026, 0.996, 0.959, 1.046, 1.083, 0.907, 0.852, 0.933, 0.953, 1.103, 0.932, 1.033, 0.974, 0.901, 1.042, 0.807, 0.838, 1.146, 1.110, 0.967, 0.981, 0.902, 1.065, 0.980, 1.053, 1.187, 0.955, 0.857, 1.106, 1.137, 1.130, 1.215, 1.003, 1.135, 0.933, 0.939, 0.997, 0.910, 0.949, 1.081, 1.009, 0.860, 1.047, 0.958, 0.999, 1.007, 0.870, 1.585, 1.622, 1.666, 0.923, 1.652, 1.383, 1.573, 1.415, 1.903, 1.399, 1.464, 1.422, 1.637, 1.594, 1.636, 1.531, 1.644, 1.674, 1.504, 1.422, 1.780, 1.681, 1.519, 1.252, 1.365, 1.539, 1.592, 1.591, 1.708, 1.391, 1.909, 1.760, 1.483, 1.432, 1.549, 1.699, 1.448, 1.533, 1.597, 1.353, 1.221, 1.833, 1.523, 1.475, 1.355, 1.485, 1.827, 1.522, 1.602, 1.429, 1.607, 1.528, 1.480, 1.731, 1.834, 1.308, 1.853, 1.399, 1.696, 1.611, 1.365, 1.297, 1.469, 1.585, 1.775, 1.350, 1.401, 1.732, 1.582, 1.506, 1.410, 1.592, 1.339, 1.465, 1.328, 1.384, 1.545, 1.439, 1.414, 1.779, 1.433, 1.428, 2.023, 1.749, 1.435, 1.495, 1.427, 1.421, 1.487, 1.588, 1.243, 1.510, 1.339, 1.793, 1.222, 1.716, 1.607, 1.468, 1.575, 1.487, 1.583, 1.543, 1.501, 1.412, 1.390, 1.738, 1.691, 1.521, 1.740, 1.568, 1.656, 1.458, 1.405, 1.646, 1.517, 1.491, 1.850, 1.591, 1.589, 1.408, 1.450, 1.703, 1.954, 1.537, 1.484, 1.333, 1.528, 1.374, 1.373, 1.805, 1.378, 1.464, 1.718, 1.326, 1.463, 1.337, 1.369, 1.274, 1.123, 1.551, 1.448, 1.544, 1.470, 1.385, 1.926, 1.644, 1.432, 1.374, 1.504, 1.464, 1.349, 1.259, 1.651, 1.696, 1.151, 1.539, 1.349, 1.415, 1.364, 1.295, 1.175, 1.138, 1.470, 1.367, 1.442, 1.517, 1.372, 1.355, 1.417, 1.693, 1.279, 1.427, 1.301, 1.172, 1.544, 1.477, 1.315, 1.379, 1.451, 1.667, 1.350, 1.548, 1.139, 1.400, 1.363, 1.374, 1.158, 1.558, 1.527, 1.349, 1.797, 1.471, 1.375, 1.423, 1.392, 1.411, 1.483, 1.376, 1.355, 1.596, 1.375, 1.967, 1.475, 1.325, 1.726, 1.541, 1.395, 1.403, 1.313, 1.639, 1.507, 1.370, 1.333, 1.365, 1.460, 1.150, 1.388, 1.408, 1.400, 1.548, 1.334, 1.526, 1.709, 1.490, 1.490, 1.344, 1.483, 1.903, 1.401, 1.300, 1.467, 1.414, 1.506, 1.581, 1.306, 1.628, 1.658, 1.391, 1.459, 1.342, 1.422, 1.272, 1.057, 1.416, 1.315, 1.525, 1.426, 1.592, 1.870, 1.278, 1.374, 1.464, 1.383, 1.468, 1.166, 1.589, 1.389, 1.277, 1.681, 1.367, 1.373, 1.450, 1.526, 1.486]
    line "Max" [2.298, 2.513, 2.647, 2.370, 2.486, 2.258, 2.316, 2.407, 2.065, 3.120, 2.328, 2.193, 2.359, 2.398, 2.082, 2.241, 2.339, 2.187, 2.267, 2.268, 2.480, 2.591, 2.231, 1.950, 2.493, 2.596, 2.270, 2.198, 2.587, 2.539, 1.811, 2.355, 2.373, 2.516, 2.368, 2.412, 2.166, 2.482, 2.401, 2.505, 2.396, 2.211, 2.686, 2.876, 2.527, 2.543, 2.441, 2.495, 3.568, 2.073, 2.354, 2.257, 2.217, 2.562, 2.383, 3.300, 2.337, 2.394, 2.521, 2.316, 2.490, 2.352, 2.218, 2.233, 2.267, 2.836, 2.352, 2.316, 2.371, 2.306, 1.972, 3.568, 2.457, 2.517, 2.295, 2.685, 1.995, 1.988, 2.495, 2.309, 2.154, 2.482, 2.433, 2.387, 2.387, 2.335, 2.411, 2.018, 2.145, 2.515, 2.441, 2.129, 2.243, 2.354, 2.225, 2.359, 2.232, 2.120, 3.212, 3.323, 2.256, 2.348, 2.230, 2.484, 2.177, 2.245, 2.542, 2.492, 2.067, 2.443, 2.400, 2.524, 2.732, 2.678, 2.575, 2.320, 2.945, 2.775, 2.175, 2.225, 2.827, 2.412, 2.462, 2.354, 2.303, 2.117, 2.404, 2.228, 3.568, 3.422, 3.568, 2.286, 3.568, 3.568, 3.568, 3.112, 3.568, 3.568, 3.349, 3.582, 3.568, 3.568, 3.568, 3.211, 3.568, 3.568, 3.401, 3.568, 3.568, 3.568, 3.568, 2.844, 3.133, 3.568, 3.568, 3.568, 3.568, 3.568, 3.568, 6.031, 3.568, 3.255, 3.568, 3.568, 3.540, 3.694, 3.568, 3.391, 2.740, 3.568, 3.568, 3.568, 3.214, 3.373, 3.568, 3.568, 3.568, 3.161, 3.568, 3.568, 4.087, 3.568, 3.568, 3.568, 3.568, 3.399, 3.569, 3.568, 3.367, 2.849, 3.604, 3.568, 3.568, 2.639, 3.568, 3.286, 3.568, 3.366, 2.914, 3.014, 2.823, 3.114, 2.886, 3.056, 3.270, 3.034, 2.635, 3.230, 3.017, 2.801, 3.696, 3.013, 2.960, 2.848, 3.011, 3.047, 2.859, 41.554, 2.632, 3.259, 2.632, 41.585, 2.622, 41.150, 3.285, 3.016, 2.941, 2.964, 40.959, 2.960, 2.646, 2.909, 2.977, 10.590, 3.118, 3.117, 3.290, 2.948, 3.358, 2.931, 3.021, 41.389, 40.819, 2.907, 41.096, 3.057, 3.185, 2.936, 2.973, 3.208, 3.826, 3.120, 2.892, 2.581, 2.909, 2.755, 2.648, 41.810, 2.699, 2.980, 41.762, 2.849, 28.067, 2.728, 2.818, 2.749, 2.245, 41.012, 2.469, 3.055, 2.727, 2.740, 41.972, 2.812, 2.924, 41.058, 2.867, 2.866, 2.629, 2.511, 2.901, 4.619, 2.468, 2.867, 2.877, 2.844, 2.668, 2.698, 2.348, 2.418, 2.910, 2.699, 2.977, 3.035, 2.878, 2.490, 2.788, 41.808, 2.797, 2.623, 2.652, 2.326, 2.857, 41.055, 2.864, 2.787, 2.488, 41.659, 2.683, 12.924, 2.281, 2.740, 2.709, 2.731, 2.458, 41.257, 2.845, 2.687, 41.508, 2.856, 2.561, 2.853, 2.500, 2.925, 2.747, 2.823, 2.707, 2.930, 2.692, 41.449, 2.989, 2.725, 41.781, 2.712, 2.906, 3.026, 2.867, 40.920, 2.739, 2.785, 2.806, 2.728, 2.911, 2.230, 2.821, 2.778, 2.712, 3.053, 2.752, 2.822, 32.429, 2.801, 2.840, 2.612, 2.840, 41.311, 2.640, 2.743, 2.946, 2.751, 2.840, 41.343, 2.706, 41.052, 41.738, 2.730, 2.881, 2.734, 2.994, 2.451, 2.205, 2.844, 2.841, 3.065, 2.789, 41.010, 41.706, 2.685, 41.299, 2.809, 2.790, 3.111, 2.428, 3.160, 2.738, 2.708, 3.037, 2.685, 2.699, 41.210, 2.866, 2.814]
Loading
%%{init: {"xyChart": {"width": 500, "height": 200}}}%%
xychart-beta
    title "QUIC"
    x-axis "PR Number" 1685 --> 2147
    y-axis "Latency (ms)"
    line "Min" [0.000, 0.659, 0.000, 0.325, 0.229, 0.000, 0.000, 0.208, 0.223, 0.000, 0.000, 0.000, 0.000, 0.271, 0.203, 0.186, 0.000, 0.219, 0.254, 0.000, 0.000, 0.338, 0.000, 0.000, 0.207, 0.000, 0.221, 0.229, 0.000, 0.322, 0.000, 0.205, 0.000, 0.368, 0.213, 0.000, 0.187, 0.263, 0.179, 0.000, 0.323, 0.000, 0.000, 0.000, 0.000, 0.169, 0.197, 0.000, 0.306, 0.000, 0.000, 0.000, 0.448, 0.000, 0.242, 0.423, 0.000, 0.357, 0.392, 0.000, 0.000, 0.404, 0.364, 0.000, 0.000, 0.424, 0.000, 0.000, 0.000, 0.359, 0.449, 0.296, 0.364, 0.286, 0.000, 0.396, 0.000, 0.336, 0.369, 0.381, 0.370, 0.420, 0.451, 0.407, 0.000, 0.483, 0.583, 0.000, 0.588, 0.528, 0.572, 0.220, 0.368, 0.507, 0.549, 0.387, 0.559, 0.571, 0.609, 0.637, 0.441, 0.491, 0.609, 0.636, 0.586, 0.512, 0.412, 0.535, 0.548, 0.582, 0.592, 0.390, 0.571, 0.660, 0.582, 0.497, 97.063, 0.401, 0.621, 0.589, 0.441, 0.651, 0.563, 0.471, 0.596, 0.600, 0.622, 0.537, 0.688, 0.634, 0.526, 0.646, 0.470, 0.518, 0.477, 0.515, 0.418, 0.571, 0.555, 0.634, 0.629, 0.537, 0.596, 24.886, 0.446, 0.398, 0.643, 0.691, 0.521, 0.565, 0.563, 0.487, 0.550, 95.956, 0.487, 0.473, 0.452, 0.608, 0.468, 0.649, 0.561, 0.663, 0.551, 0.587, 0.623, 0.466, 0.511, 93.744, 0.506, 0.635, 0.581, 0.578, 0.593, 0.651, 0.454, 0.550, 86.830, 12.139, 89.769, 96.799, 41.076, 5.759, 0.306, 76.843, 2.206, 126.818, 99.158, 39.857, 3.384, 71.646, 168.890, 82.693, 0.375, 20.074, 97.045, 20.776, 84.214, 65.765, 73.293, 116.189, 92.954, 1.383, 154.767, 107.357, 28.077, 88.728, 193.222, 0.383, 141.824, 117.469, 0.860, 169.979, 23.653, 64.484, 93.692, 0.616, 80.456, 192.951, 150.355, 27.799, 147.856, 93.766, 88.856, 0.386, 19.143, 114.477, 5.949, 167.471, 45.499, 126.135, 0.702, 25.416, 91.120, 88.201, 67.542, 69.725, 147.273, 138.266, 93.012, 93.623, 9.571, 38.081, 114.306, 1.397, 54.333, 81.533, 122.593, 0.274, 157.109, 90.043, 123.942, 8.337, 165.674, 94.715, 108.998, 8.385, 30.756, 176.358, 106.054, 107.042, 22.650, 34.868, 97.778, 85.581, 96.825, 90.433, 75.663, 17.515, 49.752, 95.417, 107.597, 107.803, 6.139, 36.556, 88.208, 82.175, 122.844, 55.987, 109.452, 8.372, 9.192, 128.043, 167.667, 90.672, 44.656, 66.971, 26.830, 103.097, 141.421, 3.294, 87.297, 30.692, 126.271, 129.127, 15.626, 164.425, 71.549, 94.452, 156.036, 157.754, 56.373, 84.177, 18.709, 45.252, 13.205, 128.197, 114.662, 13.574, 24.198, 53.753, 80.091, 140.118, 0.324, 109.395, 104.636]
    line "Avg" [1.069, 1.707, 0.259, 1.020, 0.856, 0.725, 0.602, 0.893, 0.875, 0.661, 0.557, 0.731, 0.796, 0.949, 0.726, 0.849, 0.761, 0.718, 0.939, 0.550, 0.561, 0.943, 0.832, 0.807, 0.867, 0.633, 1.098, 0.735, 0.608, 1.008, 0.530, 0.823, 0.822, 1.001, 0.919, 0.789, 0.785, 0.862, 0.741, 0.384, 0.935, 0.539, 0.664, 0.689, 0.829, 0.677, 0.918, 0.625, 0.880, 0.554, 0.506, 0.520, 1.456, 0.838, 0.873, 1.195, 0.824, 1.267, 1.176, 0.885, 0.661, 1.160, 1.118, 0.990, 1.148, 1.215, 1.187, 1.033, 1.098, 1.268, 1.200, 1.277, 1.181, 1.244, 0.863, 1.411, 0.948, 1.204, 1.203, 1.323, 1.341, 1.366, 1.242, 1.218, 1.116, 1.650, 1.700, 1.018, 1.666, 1.618, 1.699, 1.034, 1.254, 1.552, 1.605, 1.509, 1.613, 1.720, 1.646, 1.781, 1.639, 1.600, 1.780, 1.830, 1.749, 1.636, 1.531, 1.607, 1.667, 1.720, 1.716, 1.414, 1.555, 1.760, 1.690, 1.590, 5390.257, 1.385, 1.644, 1.727, 1.561, 1.827, 1.725, 1.688, 1.626, 1.608, 1.643, 1.608, 1.725, 5154.749, 1.668, 1.690, 1.509, 1.661, 1.564, 1.614, 1.552, 1.697, 1.667, 1.601, 1.579, 1.525, 1.757, 3851.139, 1.481, 1.363, 1.692, 1.828, 1.650, 1.622, 1.623, 1.513, 1.718, 5627.192, 1.584, 1.535, 1.474, 1.740, 1.603, 1.708, 1.601, 1.831, 1.668, 1.727, 1.713, 1.390, 1.629, 5590.477, 1.616, 1.757, 1.645, 1.725, 1.835, 1.888, 1.515, 1.779, 5409.980, 3848.162, 5399.785, 5416.218, 4998.964, 3322.711, 5350.006, 3161.317, 4327.767, 5401.011, 5632.122, 4332.595, 3855.381, 5381.677, 5410.850, 5379.698, 5325.159, 3264.026, 5406.406, 2877.535, 5619.791, 4868.868, 4351.924, 5379.625, 5390.526, 4185.356, 4339.007, 5423.830, 5158.805, 3283.025, 5413.886, 3890.990, 5411.251, 5405.579, 4852.987, 5409.863, 4351.513, 5390.920, 5396.125, 4335.383, 4855.550, 5408.860, 5390.895, 3888.237, 5621.775, 5625.948, 5417.174, 3896.849, 4344.756, 5413.523, 3900.135, 5623.754, 3335.108, 5617.380, 3850.418, 4665.434, 5595.328, 5384.307, 4889.007, 3721.125, 5620.378, 5407.198, 5597.907, 4342.471, 5140.244, 3718.243, 5412.590, 5144.053, 4344.548, 5412.891, 3924.338, 2931.478, 5415.198, 5402.052, 5395.892, 3854.647, 5398.117, 5391.637, 5392.571, 4348.617, 3325.866, 5400.059, 5408.404, 5397.747, 4176.113, 2925.300, 5404.648, 5394.377, 5378.834, 5390.525, 5392.560, 4860.619, 3262.850, 5402.160, 5410.038, 5635.350, 5127.366, 4683.742, 5404.889, 4199.567, 5417.110, 5160.625, 5616.142, 4178.387, 3702.273, 5391.620, 5405.152, 5402.813, 3272.403, 5396.641, 4847.051, 5400.038, 5606.169, 3277.114, 5396.479, 3896.048, 5616.611, 5406.428, 5356.652, 5409.433, 4329.298, 5383.590, 5424.065, 3851.661, 5140.022, 5428.513, 3677.528, 3837.267, 4328.047, 5405.144, 5399.423, 4846.652, 4324.658, 5175.113, 3852.315, 5612.386, 4953.886, 5403.060, 5397.540]
    line "Max" [2.783, 6.605, 0.821, 1.944, 1.917, 1.681, 1.573, 1.837, 1.857, 1.782, 1.274, 1.783, 2.676, 2.006, 1.943, 2.179, 1.918, 1.755, 1.959, 1.371, 1.455, 1.958, 2.546, 1.978, 1.997, 1.535, 2.434, 1.934, 1.541, 2.256, 1.587, 1.879, 1.830, 2.144, 1.966, 1.840, 1.831, 1.849, 1.714, 1.796, 2.375, 1.343, 1.580, 1.815, 2.349, 1.672, 1.771, 1.586, 1.984, 1.678, 1.404, 1.476, 3.783, 2.333, 2.056, 2.873, 2.073, 2.809, 2.498, 2.435, 1.792, 2.426, 2.214, 2.181, 2.954, 2.497, 2.517, 2.223, 2.517, 2.560, 2.569, 2.510, 2.509, 2.615, 2.074, 4.512, 2.230, 2.542, 2.512, 3.394, 2.811, 3.227, 2.571, 2.708, 2.375, 3.946, 4.238, 2.346, 4.349, 4.111, 4.722, 2.563, 2.672, 3.922, 4.296, 3.873, 4.155, 4.365, 4.428, 4.471, 4.182, 4.108, 4.544, 4.572, 4.385, 3.944, 4.006, 4.238, 4.119, 4.910, 4.201, 4.154, 3.851, 4.208, 3.972, 4.180, 13384.537, 4.207, 3.611, 4.619, 5.194, 3.998, 3.792, 3.652, 3.594, 3.831, 3.703, 3.748, 3.740, 13416.452, 3.663, 3.740, 3.650, 3.712, 3.473, 3.397, 3.419, 3.935, 3.699, 3.564, 3.483, 3.390, 3.787, 10398.524, 3.437, 3.336, 3.927, 4.142, 3.729, 3.732, 3.619, 3.601, 3.910, 13413.982, 3.649, 3.510, 3.413, 3.825, 3.712, 3.789, 3.649, 4.046, 3.611, 3.966, 3.815, 3.280, 3.618, 13381.920, 3.538, 3.962, 3.473, 3.777, 3.957, 4.089, 3.567, 4.077, 13395.075, 10316.321, 13388.816, 13407.508, 13068.430, 9127.792, 13455.592, 9110.132, 11291.441, 13406.686, 13432.372, 11216.341, 10333.153, 13386.977, 13368.189, 13365.586, 13317.707, 9119.843, 13377.546, 8206.068, 13420.816, 12170.939, 11271.672, 13299.660, 13372.469, 11316.780, 11197.172, 13430.586, 13368.628, 9133.650, 13394.729, 10371.381, 13333.998, 13413.718, 12122.762, 13388.967, 11314.912, 13381.298, 13380.953, 11303.295, 12172.637, 13386.055, 13342.309, 10396.609, 13361.184, 13406.790, 13418.642, 10355.296, 11244.748, 13422.216, 10384.493, 13388.579, 9133.782, 13414.969, 10354.003, 12120.612, 13393.044, 13370.389, 12226.992, 10353.385, 13337.638, 13371.809, 13404.407, 11287.794, 13379.994, 10416.619, 13445.469, 13384.055, 11263.687, 13394.134, 10434.232, 8329.041, 13370.360, 13404.236, 13320.180, 10374.649, 13394.285, 13397.861, 13395.704, 11334.562, 9148.790, 13375.391, 13426.623, 13418.468, 11240.738, 8227.104, 13415.422, 13389.147, 13368.432, 13385.742, 13404.497, 12117.572, 9138.054, 13384.511, 13403.151, 13430.320, 13351.265, 12139.128, 13408.578, 11257.159, 13443.678, 13426.519, 13392.232, 11211.733, 10398.645, 13404.985, 13379.235, 13424.553, 9139.013, 13387.393, 12129.018, 13370.942, 13414.895, 9167.108, 13374.179, 10404.610, 13339.964, 13358.265, 13373.246, 13405.109, 11280.195, 13391.002, 13390.589, 10343.072, 13347.111, 13447.927, 10416.257, 10306.587, 11231.894, 13321.266, 13437.182, 12129.822, 11239.215, 13375.077, 10371.342, 13316.231, 13016.615, 13405.257, 13407.069]
Loading

@SionoiS SionoiS moved this from new to In progress (not by P2P team) in nim-libp2p Jan 29, 2026
@SionoiS
SionoiS force-pushed the feat--signed-random-walk branch from 67ee35c to 98f11f6 Compare January 30, 2026 13:12
@SionoiS SionoiS changed the title feat(kad): logos capability discovery feat(kad): capability discovery Feb 2, 2026
@SionoiS
SionoiS force-pushed the feat--logos-capability-discovery branch from 7d42db2 to a7f1e62 Compare February 2, 2026 16:49
@SionoiS
SionoiS force-pushed the feat--signed-random-walk branch from 78512df to 6dde3e8 Compare February 3, 2026 12:20
Base automatically changed from feat--signed-random-walk to master February 3, 2026 13:31
@SionoiS
SionoiS force-pushed the feat--logos-capability-discovery branch from a7f1e62 to 8fc9be3 Compare February 3, 2026 14:26
@codecov-commenter

codecov-commenter commented Feb 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.53013% with 583 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.80%. Comparing base (550fe7f) to head (41d9d54).

Files with missing lines Patch % Lines
libp2p/protocols/service_discovery/registrar.nim 44.00% 299 Missing ⚠️
libp2p/protocols/service_discovery/discoverer.nim 20.61% 77 Missing ⚠️
libp2p/protocols/service_discovery/advertiser.nim 58.43% 69 Missing ⚠️
libp2p/protocols/kademlia/protobuf.nim 28.72% 67 Missing ⚠️
...otocols/service_discovery/serviceroutingtables.nim 78.98% 29 Missing ⚠️
libp2p/protocols/kad_disco.nim 82.79% 16 Missing ⚠️
libp2p/protocols/service_discovery/types.nim 82.92% 7 Missing ⚠️
libp2p/protocols/kademlia/routingtable.nim 14.28% 6 Missing ⚠️
libp2p/protocols/kademlia_discovery/types.nim 64.70% 6 Missing ⚠️
libp2p/protocols/service_discovery/iptree.nim 95.19% 5 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2055      +/-   ##
==========================================
- Coverage   72.57%   70.80%   -1.77%     
==========================================
  Files         156      162       +6     
  Lines       19429    21029    +1600     
  Branches       18       21       +3     
==========================================
+ Hits        14100    14890     +790     
- Misses       5329     6139     +810     
Files with missing lines Coverage Δ
libp2p/multiaddress.nim 30.55% <ø> (ø)
libp2p/peerstore.nim 94.69% <ø> (ø)
libp2p/protobuf/minprotobuf.nim 29.80% <ø> (+0.28%) ⬆️
libp2p/protocols/kademlia_discovery/randomfind.nim 84.61% <ø> (ø)
libp2p/utils/heartbeat.nim 91.66% <100.00%> (-2.78%) ⬇️
libp2p/protocols/kademlia.nim 77.77% <87.50%> (-13.63%) ⬇️
libp2p/protocols/service_discovery/iptree.nim 95.28% <95.19%> (ø)
libp2p/protocols/kademlia/routingtable.nim 85.45% <14.28%> (-10.51%) ⬇️
libp2p/protocols/kademlia_discovery/types.nim 42.85% <64.70%> (+25.07%) ⬆️
libp2p/protocols/service_discovery/types.nim 83.33% <82.92%> (ø)
... and 6 more

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SionoiS
SionoiS force-pushed the feat--logos-capability-discovery branch from 8b0d2f3 to 4bcde09 Compare February 4, 2026 20:36
@SionoiS
SionoiS marked this pull request as ready for review February 13, 2026 14:04
@SionoiS
SionoiS requested a review from a team February 13, 2026 14:04
@SionoiS
SionoiS force-pushed the feat--logos-capability-discovery branch from 47841af to 978a54c Compare February 13, 2026 15:06
@jm-clius

Copy link
Copy Markdown
Collaborator

@SionoiS since this PR is not (necessarily) meant to be merged directly but adapted, perhaps it makes sense to keep it as a draft?

@SionoiS
SionoiS marked this pull request as draft February 16, 2026 16:51

var init = now
if regMsg.ticket.isSome:
init = regMsg.ticket.get().tInit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would be necessary to validate the value of tInit? What would happen if the value of tInit here is really old?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be fine since we check the other timestamps.

@tinniaru3005 WDYT?

Comment thread libp2p/protocols/kademlia/protobuf.nim Resolved
Comment on lines +25 to +37
proc scheduleAction*(
disco: KademliaDiscovery,
serviceId: ServiceId,
registrar: PeerId,
bucketIdx: int,
scheduledTime: Moment,
ticket: Opt[Ticket] = Opt.none(Ticket),
) =
## Schedule an action at the given time

let action: PendingAction = (scheduledTime, serviceId, registrar, bucketIdx, ticket)
let idx = disco.advertiser.actionQueue.lowerBound(action, actionCmp)
disco.advertiser.actionQueue.insert(action, idx)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the idea of the action queue, but I think it should contain all of the interface i.e.

Suggested change
proc scheduleAction*(
disco: KademliaDiscovery,
serviceId: ServiceId,
registrar: PeerId,
bucketIdx: int,
scheduledTime: Moment,
ticket: Opt[Ticket] = Opt.none(Ticket),
) =
## Schedule an action at the given time
let action: PendingAction = (scheduledTime, serviceId, registrar, bucketIdx, ticket)
let idx = disco.advertiser.actionQueue.lowerBound(action, actionCmp)
disco.advertiser.actionQueue.insert(action, idx)
proc schedule*(
queue: ActionScheduler,
serviceId: ServiceId,
registrar: PeerId,
bucketIdx: int,
scheduledTime: Moment,
ticket: Opt[Ticket] = Opt.none(Ticket),
) =
## Schedule an action at the given time
let action: PendingAction = (scheduledTime, serviceId, registrar, bucketIdx, ticket)
let idx = queue.lowerBound(action, actionCmp)
queue.insert(action, idx)

I think this could be generalized further:
-1. nit: change ActionQueue to Scheduler (scheduler is such a cool name, looks like a very shiny and durable german kitchen instrument)
0. Implement the < operator for the Action type and use nim's [heapqueue](https://nim-lang.org/docs/heapqueue.html) instead of the sequence.

  1. make schedule (former scheduleAction) take only scheduler and action, in this case the action needs to be constructed outside of the schedule function
  2. from (1), further generalize an action to be just a closure (any closure) like:
scheduler.schedule(1.seconds, proc () =
  sendMessage("peerA", "hello")
)

scheduler.schedule(2.seconds, proc () =
  reconnect("peerB", 3)
)

# ----------------- schedule implementation
proc schedule(delay: Duration, fn: proc() {.async.}) =
  asyncSpawn internalSchedule(delay, fn())  


proc internalSchedule(delay: Duration, fn: proc() {.async.}) {.async.} =
  await sleepAsync(delay)
  await fn()
  1. move the scheduler out to utils.nim and add an unschedule function
  2. ensure that no task is scheduled exactly at the same time (for most cases this won't be an issue, but it's a nice property to ensure)
  3. replace heartbeats by the single scheduler (requires adding a repetition argument to the scheduler to allow a task to repeat indefinitely, or for a specific number of times too!)

Doing steps -1, 0, 1, 2 and 3 would be enough to remove a lot of the complexity from this file

Comment on lines +39 to +56
proc processAction*(disco: KademliaDiscovery) =
## Start processing scheduled actions

if (disco.advertiseLoop.isNil or disco.advertiseLoop.finished()) and
disco.advertiser.actionQueue.len > 0:
disco.advertiseLoop = disco.runAdvertiseLoop()

proc scheduleAndProcessAction*(
disco: KademliaDiscovery,
serviceId: ServiceId,
registrar: PeerId,
bucketIdx: int,
scheduledTime: Moment,
ticket: Opt[Ticket] = Opt.none(Ticket),
) =
disco.scheduleAction(serviceId, registrar, bucketIdx, scheduledTime, ticket)

disco.processAction()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't be required with the scheduler approach

Suggested change
proc processAction*(disco: KademliaDiscovery) =
## Start processing scheduled actions
if (disco.advertiseLoop.isNil or disco.advertiseLoop.finished()) and
disco.advertiser.actionQueue.len > 0:
disco.advertiseLoop = disco.runAdvertiseLoop()
proc scheduleAndProcessAction*(
disco: KademliaDiscovery,
serviceId: ServiceId,
registrar: PeerId,
bucketIdx: int,
scheduledTime: Moment,
ticket: Opt[Ticket] = Opt.none(Ticket),
) =
disco.scheduleAction(serviceId, registrar, bucketIdx, scheduledTime, ticket)
disco.processAction()

Comment on lines +161 to +163
let newTicket = newTicketOpt.valueOr:
error "no ticket to retry with"
return

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only retry once?

Comment on lines +179 to +188
disco.serviceRoutingTables.addService(
serviceId, disco.rtable, disco.config.replication, disco.discoConf.bucketsCount,
Provided,
)

cd_advertiser_services_added.inc()

let advTable = disco.serviceRoutingTables.getTable(serviceId).valueOr:
error "service not found", serviceId
return

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addservice could return the table

Comment on lines +87 to +97
proc getTable*(
manager: ServiceRoutingTableManager, serviceId: ServiceId
): Opt[RoutingTable] {.raises: [].} =
## Get routing table for a service (immutable view)

let res = catch:
manager.tables[serviceId]
let table = res.valueOr:
return Opt.none(RoutingTable)

return Opt.some(table)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just do manager.tables.get(serviceId) directly to get an Opt I think

Comment on lines +21 to +23
ServiceRoutingTableManager* = ref object
tables*: Table[ServiceId, RoutingTable]
serviceStatus*: Table[ServiceId, ServiceStatus]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is overcomplicating things. Using one table with a pair of values would reduce the code a bit (i.e. ServiceRoutingTableManager = TableRef[ServiceId, (RoutingTable, ServiceStatus)]).

@gmelodie
gmelodie force-pushed the feat--logos-capability-discovery branch 2 times, most recently from d5ae54f to 4d1088a Compare March 9, 2026 17:06
@gmelodie
gmelodie force-pushed the feat--logos-capability-discovery branch from a32d66b to a4578ea Compare April 2, 2026 13:18
@gmelodie
gmelodie force-pushed the feat--logos-capability-discovery branch from e787000 to cb7c2b9 Compare April 2, 2026 14:51
@gmelodie
gmelodie force-pushed the feat--logos-capability-discovery branch 3 times, most recently from 7e53cca to 1e183a9 Compare April 2, 2026 23:08
@gmelodie
gmelodie force-pushed the feat--logos-capability-discovery branch from 1e183a9 to 41d9d54 Compare April 2, 2026 23:12
…articipation (#2200)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@SionoiS

SionoiS commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

The POC served us well. RIP

@SionoiS SionoiS closed this Apr 23, 2026
@github-project-automation github-project-automation Bot moved this from In progress (not by P2P team) to done in nim-libp2p Apr 23, 2026
@richard-ramos
richard-ramos deleted the feat--logos-capability-discovery branch October 9, 2026 16:13
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.

6 participants