Commit 5f208bb
authored
Implement basic validator custody framework (no backfill) (#7578)
Resolves #6767
This PR implements a basic version of validator custody.
- It introduces a new `CustodyContext` object which contains info regarding number of validators attached to a node and the custody count they contribute to the cgc.
- The `CustodyContext` is added in the da_checker and has methods for returning the current cgc and the number of columns to sample at head. Note that the logic for returning the cgc existed previously in the network globals.
- To estimate the number of validators attached, we use the `beacon_committee_subscriptions` endpoint. This might overestimate the number of validators actually publishing attestations from the node in the case of multi BN setups. We could also potentially use the `publish_attestations` endpoint to get a more conservative estimate at a later point.
- Anytime there's a change in the `custody_group_count` due to addition/removal of validators, the custody context should send an event on a broadcast channnel. The only subscriber for the channel exists in the network service which simply subscribes to more subnets. There can be additional subscribers in sync that will start a backfill once the cgc changes.
TODO
- [ ] **NOT REQUIRED:** Currently, the logic only handles an increase in validator count and does not handle a decrease. We should ideally unsubscribe from subnets when the cgc has decreased.
- [ ] **NOT REQUIRED:** Add a service in the `CustodyContext` that emits an event once `MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS ` passes after updating the current cgc. This event should be picked up by a subscriber which updates the enr and metadata.
- [x] Add more tests1 parent 076a1c3 commit 5f208bb
File tree
38 files changed
+928
-350
lines changed- beacon_node
- beacon_chain
- src
- data_availability_checker
- tests
- http_api
- src
- tests
- lighthouse_network
- src
- discovery
- service
- types
- tests
- network/src
- network_beacon_processor
- sync
- range_sync
- tests
- store/src
- consensus/types/src
- scripts
- local_testnet
- tests
- testing/ef_tests/src/cases
38 files changed
+928
-350
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| |||
670 | 672 | | |
671 | 673 | | |
672 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
673 | 692 | | |
674 | 693 | | |
675 | 694 | | |
| |||
2990 | 3009 | | |
2991 | 3010 | | |
2992 | 3011 | | |
2993 | | - | |
2994 | 3012 | | |
2995 | 3013 | | |
2996 | 3014 | | |
| |||
3000 | 3018 | | |
3001 | 3019 | | |
3002 | 3020 | | |
3003 | | - | |
| 3021 | + | |
3004 | 3022 | | |
3005 | 3023 | | |
3006 | 3024 | | |
| |||
7232 | 7250 | | |
7233 | 7251 | | |
7234 | 7252 | | |
7235 | | - | |
| 7253 | + | |
| 7254 | + | |
7236 | 7255 | | |
7237 | 7256 | | |
7238 | 7257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
688 | | - | |
689 | 688 | | |
690 | 689 | | |
691 | 690 | | |
| |||
721 | 720 | | |
722 | 721 | | |
723 | 722 | | |
724 | | - | |
725 | 723 | | |
726 | 724 | | |
727 | 725 | | |
| |||
730 | 728 | | |
731 | 729 | | |
732 | 730 | | |
733 | | - | |
734 | 731 | | |
735 | 732 | | |
736 | 733 | | |
| |||
743 | 740 | | |
744 | 741 | | |
745 | 742 | | |
746 | | - | |
747 | 743 | | |
748 | | - | |
| 744 | + | |
749 | 745 | | |
750 | 746 | | |
751 | 747 | | |
| |||
821 | 817 | | |
822 | 818 | | |
823 | 819 | | |
824 | | - | |
825 | 820 | | |
826 | 821 | | |
827 | 822 | | |
| |||
831 | 826 | | |
832 | 827 | | |
833 | 828 | | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
842 | 835 | | |
843 | 836 | | |
844 | 837 | | |
845 | 838 | | |
846 | 839 | | |
847 | 840 | | |
848 | 841 | | |
849 | | - | |
850 | 842 | | |
851 | 843 | | |
852 | 844 | | |
| |||
1054 | 1046 | | |
1055 | 1047 | | |
1056 | 1048 | | |
1057 | | - | |
1058 | 1049 | | |
1059 | 1050 | | |
1060 | 1051 | | |
| |||
1202 | 1193 | | |
1203 | 1194 | | |
1204 | 1195 | | |
1205 | | - | |
1206 | 1196 | | |
1207 | 1197 | | |
1208 | 1198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 47 | | |
53 | 48 | | |
54 | 49 | | |
| |||
103 | 98 | | |
104 | 99 | | |
105 | 100 | | |
106 | | - | |
107 | 101 | | |
108 | 102 | | |
109 | 103 | | |
110 | 104 | | |
111 | 105 | | |
112 | 106 | | |
113 | | - | |
114 | 107 | | |
115 | 108 | | |
116 | 109 | | |
| |||
152 | 145 | | |
153 | 146 | | |
154 | 147 | | |
155 | | - | |
156 | | - | |
157 | 148 | | |
158 | 149 | | |
159 | 150 | | |
160 | 151 | | |
161 | 152 | | |
162 | 153 | | |
163 | 154 | | |
164 | | - | |
165 | 155 | | |
166 | 156 | | |
167 | 157 | | |
| |||
182 | 172 | | |
183 | 173 | | |
184 | 174 | | |
185 | | - | |
186 | 175 | | |
187 | 176 | | |
188 | 177 | | |
| |||
250 | 239 | | |
251 | 240 | | |
252 | 241 | | |
253 | | - | |
254 | 242 | | |
255 | 243 | | |
256 | 244 | | |
257 | 245 | | |
258 | | - | |
259 | 246 | | |
260 | 247 | | |
261 | 248 | | |
| |||
321 | 308 | | |
322 | 309 | | |
323 | 310 | | |
324 | | - | |
325 | 311 | | |
326 | 312 | | |
327 | 313 | | |
328 | 314 | | |
329 | 315 | | |
330 | 316 | | |
331 | 317 | | |
332 | | - | |
333 | 318 | | |
334 | 319 | | |
335 | 320 | | |
336 | 321 | | |
337 | 322 | | |
338 | | - | |
339 | 323 | | |
340 | 324 | | |
341 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
926 | 928 | | |
927 | 929 | | |
928 | 930 | | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
929 | 945 | | |
930 | 946 | | |
931 | 947 | | |
| |||
999 | 1015 | | |
1000 | 1016 | | |
1001 | 1017 | | |
1002 | | - | |
1003 | | - | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1004 | 1026 | | |
1005 | 1027 | | |
1006 | 1028 | | |
| |||
0 commit comments