Commit 70850fe
authored
Drop head tracker for summaries DAG (#6744)
The head tracker is a persisted piece of state that must be kept in sync with the fork-choice. It has been a source of pruning issues in the past, so we want to remove it
- see #1785
When implementing tree-states in the hot DB we have to change the pruning routine (more details below) so we want to do those changes first in isolation.
- see #6580
- If you want to see the full feature of tree-states hot dapplion#39
Closes #1785
**Current DB migration routine**
- Locate abandoned heads with head tracker
- Use a roots iterator to collect the ancestors of those heads can be pruned
- Delete those abandoned blocks / states
- Migrate the newly finalized chain to the freezer
In summary, it computes what it has to delete and keeps the rest. Then it migrates data to the freezer. If the abandoned forks routine has a bug it can break the freezer migration.
**Proposed migration routine (this PR)**
- Migrate the newly finalized chain to the freezer
- Load all state summaries from disk
- From those, just knowing the head and finalized block compute two sets: (1) descendants of finalized (2) newly finalized chain
- Iterate all summaries, if a summary does not belong to set (1) or (2), delete
This strategy is more sound as it just checks what's there in the hot DB, computes what it has to keep and deletes the rest. Because it does not rely and 3rd pieces of data we can drop the head tracker and pruning checkpoint. Since the DB migration happens **first** now, as long as the computation of the sets to keep is correct we won't have pruning issues.1 parent b5d40e3 commit 70850fe
File tree
27 files changed
+1111
-984
lines changed- beacon_node
- beacon_chain
- src
- data_availability_checker
- schema_change
- tests
- store/src
- database
- consensus/proto_array/src
27 files changed
+1111
-984
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
| 59 | + | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
454 | 453 | | |
455 | 454 | | |
456 | 455 | | |
457 | | - | |
458 | | - | |
459 | 456 | | |
460 | 457 | | |
461 | 458 | | |
| |||
607 | 604 | | |
608 | 605 | | |
609 | 606 | | |
610 | | - | |
| 607 | + | |
611 | 608 | | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
661 | 614 | | |
662 | 615 | | |
663 | 616 | | |
| |||
1450 | 1403 | | |
1451 | 1404 | | |
1452 | 1405 | | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1459 | 1413 | | |
1460 | 1414 | | |
1461 | 1415 | | |
| |||
1735 | 1689 | | |
1736 | 1690 | | |
1737 | 1691 | | |
1738 | | - | |
1739 | | - | |
1740 | 1692 | | |
1741 | 1693 | | |
1742 | 1694 | | |
| |||
3762 | 3714 | | |
3763 | 3715 | | |
3764 | 3716 | | |
3765 | | - | |
3766 | 3717 | | |
3767 | 3718 | | |
3768 | 3719 | | |
| |||
3786 | 3737 | | |
3787 | 3738 | | |
3788 | 3739 | | |
3789 | | - | |
3790 | 3740 | | |
3791 | 3741 | | |
3792 | 3742 | | |
| |||
3824 | 3774 | | |
3825 | 3775 | | |
3826 | 3776 | | |
3827 | | - | |
3828 | 3777 | | |
3829 | 3778 | | |
3830 | 3779 | | |
| |||
4012 | 3961 | | |
4013 | 3962 | | |
4014 | 3963 | | |
4015 | | - | |
4016 | | - | |
4017 | | - | |
4018 | | - | |
4019 | | - | |
4020 | 3964 | | |
4021 | 3965 | | |
4022 | 3966 | | |
| |||
4043 | 3987 | | |
4044 | 3988 | | |
4045 | 3989 | | |
4046 | | - | |
4047 | | - | |
4048 | | - | |
4049 | 3990 | | |
4050 | 3991 | | |
4051 | 3992 | | |
| |||
4066 | 4007 | | |
4067 | 4008 | | |
4068 | 4009 | | |
4069 | | - | |
4070 | | - | |
4071 | | - | |
4072 | 4010 | | |
4073 | 4011 | | |
4074 | 4012 | | |
| |||
7208 | 7146 | | |
7209 | 7147 | | |
7210 | 7148 | | |
7211 | | - | |
| 7149 | + | |
7212 | 7150 | | |
7213 | 7151 | | |
7214 | 7152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1453 | 1453 | | |
1454 | 1454 | | |
1455 | 1455 | | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | 1456 | | |
1460 | 1457 | | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
1472 | 1458 | | |
1473 | 1459 | | |
1474 | 1460 | | |
| |||
1515 | 1501 | | |
1516 | 1502 | | |
1517 | 1503 | | |
1518 | | - | |
1519 | | - | |
| 1504 | + | |
1520 | 1505 | | |
1521 | 1506 | | |
1522 | 1507 | | |
1523 | 1508 | | |
1524 | 1509 | | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
| 1510 | + | |
1529 | 1511 | | |
1530 | 1512 | | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | | - | |
1539 | | - | |
1540 | | - | |
1541 | | - | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
1542 | 1521 | | |
1543 | 1522 | | |
1544 | 1523 | | |
1545 | 1524 | | |
1546 | 1525 | | |
1547 | 1526 | | |
1548 | | - | |
1549 | | - | |
1550 | 1527 | | |
1551 | 1528 | | |
1552 | 1529 | | |
| |||
1713 | 1690 | | |
1714 | 1691 | | |
1715 | 1692 | | |
1716 | | - | |
1717 | 1693 | | |
1718 | 1694 | | |
1719 | 1695 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | 361 | | |
363 | 362 | | |
364 | 363 | | |
| |||
376 | 375 | | |
377 | 376 | | |
378 | 377 | | |
379 | | - | |
380 | 378 | | |
381 | 379 | | |
382 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | | - | |
97 | 95 | | |
98 | 96 | | |
99 | 97 | | |
| |||
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
139 | | - | |
140 | 137 | | |
141 | 138 | | |
142 | 139 | | |
| |||
314 | 311 | | |
315 | 312 | | |
316 | 313 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | 314 | | |
322 | 315 | | |
323 | 316 | | |
| |||
729 | 722 | | |
730 | 723 | | |
731 | 724 | | |
732 | | - | |
733 | 725 | | |
734 | 726 | | |
735 | 727 | | |
| |||
769 | 761 | | |
770 | 762 | | |
771 | 763 | | |
772 | | - | |
773 | | - | |
774 | 764 | | |
775 | 765 | | |
776 | 766 | | |
| |||
846 | 836 | | |
847 | 837 | | |
848 | 838 | | |
849 | | - | |
850 | | - | |
| 839 | + | |
851 | 840 | | |
852 | 841 | | |
853 | 842 | | |
| |||
872 | 861 | | |
873 | 862 | | |
874 | 863 | | |
875 | | - | |
876 | 864 | | |
877 | 865 | | |
878 | 866 | | |
879 | | - | |
| 867 | + | |
880 | 868 | | |
881 | 869 | | |
882 | 870 | | |
| |||
887 | 875 | | |
888 | 876 | | |
889 | 877 | | |
890 | | - | |
891 | 878 | | |
892 | 879 | | |
893 | 880 | | |
| |||
968 | 955 | | |
969 | 956 | | |
970 | 957 | | |
971 | | - | |
972 | 958 | | |
973 | 959 | | |
974 | 960 | | |
| |||
0 commit comments