Commit c687988
committed
feat(networking): wire gossip→BN pipeline, gossipsub scoring feedback, outbound API
## Gossip → Beacon Node pipeline (issue ChainSafe#9)
- Add on_validated_message callback to EthGossipAdapter
(setMessageHandler(ctx, callback) — called for every ACCEPT-validated message)
- validateDecoded() now delivers accepted messages to the BN processing pipeline
- Beacon node wires this to enqueue blocks/attestations for import
## Gossipsub ACCEPT/REJECT feedback (issue ChainSafe#11)
- handleMessage() now accepts from_peer: ?[]const u8 parameter
- For REJECT outcomes, calls gossipsub.router.recordInvalidMessage(peer, topic)
which increments the P4 (invalid message delivery) score counter
- pollEvents() passes msg.from to handleMessage()
- Gossipsub can now penalize peers who send invalid messages
## Outbound request API (issue ChainSafe#10)
- Add decodeResponseChunks() + freeDecodedResponseChunks() to req_resp_encoding.zig
to parse a complete response wire buffer into []DecodedResponseChunk
- handleOutbound() now decodes the response and calls ctx.on_response callback
if present, passing parsed chunks to the caller (sync service, etc.)
- Export new types from root.zig (DecodedResponseChunk, decodeResponseChunks,
freeDecodedResponseChunks)
🤖 Generated with AI assistance1 parent 0140937 commit c687988
File tree
4 files changed
+163
-7
lines changed- src/networking
4 files changed
+163
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
165 | | - | |
| 171 | + | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
171 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
172 | 203 | | |
173 | 204 | | |
174 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
61 | 72 | | |
62 | 73 | | |
63 | 74 | | |
| |||
73 | 84 | | |
74 | 85 | | |
75 | 86 | | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
| |||
82 | 94 | | |
83 | 95 | | |
84 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
85 | 118 | | |
86 | 119 | | |
87 | 120 | | |
| |||
126 | 159 | | |
127 | 160 | | |
128 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
129 | 165 | | |
130 | 166 | | |
131 | 167 | | |
132 | 168 | | |
133 | 169 | | |
| 170 | + | |
134 | 171 | | |
135 | 172 | | |
136 | 173 | | |
| |||
151 | 188 | | |
152 | 189 | | |
153 | 190 | | |
154 | | - | |
| 191 | + | |
155 | 192 | | |
156 | 193 | | |
157 | 194 | | |
158 | 195 | | |
159 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
160 | 200 | | |
161 | 201 | | |
162 | 202 | | |
163 | 203 | | |
| 204 | + | |
164 | 205 | | |
165 | 206 | | |
166 | 207 | | |
167 | | - | |
| 208 | + | |
168 | 209 | | |
169 | 210 | | |
170 | 211 | | |
171 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
172 | 244 | | |
173 | 245 | | |
174 | 246 | | |
| |||
286 | 358 | | |
287 | 359 | | |
288 | 360 | | |
289 | | - | |
| 361 | + | |
290 | 362 | | |
291 | 363 | | |
292 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
0 commit comments