Commit 37c9bed
Cumulus: Simplify parent search for block-building (#10998)
While reviewing #10973 I found once more that our parent search is
totally overengineered:
- It offers the option to search branches that do not contain the
pending block -> These branches can never be taken
- It returns a list of potential parents -> Nobody uses the list, we
only care about the latest block that we should build on
By eliminating these two annoyances, the code is a lot more simple and
easier to follow. There are still some defensive checks that are not
strictly necessary, but does not hurt to keep them.
In summary, the mental model is: Build on the latest descendant of the
pending block that is still inside the relay parent ancestry. If no
pending block is available, use the included block in its place.
---------
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>1 parent 65cdbb2 commit 37c9bed
File tree
7 files changed
+285
-738
lines changed- cumulus/client/consensus
- aura/src/collators
- slot_based
- common/src
- prdoc
7 files changed
+285
-738
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
314 | 317 | | |
315 | 318 | | |
316 | 319 | | |
317 | | - | |
| 320 | + | |
318 | 321 | | |
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
325 | | - | |
| 328 | + | |
326 | 329 | | |
327 | 330 | | |
328 | 331 | | |
| 332 | + | |
329 | 333 | | |
330 | 334 | | |
331 | 335 | | |
| |||
341 | 345 | | |
342 | 346 | | |
343 | 347 | | |
344 | | - | |
| 348 | + | |
345 | 349 | | |
346 | 350 | | |
347 | 351 | | |
348 | 352 | | |
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
352 | | - | |
353 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
354 | 361 | | |
355 | 362 | | |
356 | 363 | | |
| |||
373 | 380 | | |
374 | 381 | | |
375 | 382 | | |
376 | | - | |
| 383 | + | |
377 | 384 | | |
378 | 385 | | |
379 | 386 | | |
| |||
385 | 392 | | |
386 | 393 | | |
387 | 394 | | |
388 | | - | |
| 395 | + | |
389 | 396 | | |
390 | 397 | | |
391 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
262 | | - | |
| 260 | + | |
| 261 | + | |
263 | 262 | | |
264 | 263 | | |
265 | 264 | | |
266 | 265 | | |
267 | 266 | | |
268 | | - | |
| 267 | + | |
269 | 268 | | |
270 | 269 | | |
271 | 270 | | |
| |||
276 | 275 | | |
277 | 276 | | |
278 | 277 | | |
279 | | - | |
280 | 278 | | |
281 | 279 | | |
282 | | - | |
| 280 | + | |
283 | 281 | | |
284 | 282 | | |
285 | 283 | | |
286 | 284 | | |
287 | | - | |
288 | | - | |
289 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
290 | 288 | | |
291 | 289 | | |
292 | 290 | | |
293 | 291 | | |
294 | 292 | | |
295 | | - | |
| 293 | + | |
296 | 294 | | |
297 | | - | |
298 | | - | |
| 295 | + | |
299 | 296 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
| 297 | + | |
308 | 298 | | |
309 | 299 | | |
310 | 300 | | |
| |||
Lines changed: 14 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
240 | | - | |
| 243 | + | |
241 | 244 | | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
247 | | - | |
248 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
249 | 256 | | |
250 | 257 | | |
251 | 258 | | |
| |||
329 | 336 | | |
330 | 337 | | |
331 | 338 | | |
332 | | - | |
| 339 | + | |
333 | 340 | | |
334 | 341 | | |
335 | 342 | | |
| |||
344 | 351 | | |
345 | 352 | | |
346 | 353 | | |
347 | | - | |
| 354 | + | |
348 | 355 | | |
349 | 356 | | |
350 | 357 | | |
| |||
417 | 424 | | |
418 | 425 | | |
419 | 426 | | |
420 | | - | |
| 427 | + | |
421 | 428 | | |
422 | 429 | | |
423 | 430 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments