Commit 8c89755
committed
feat: Implement dynamic weighted RPC load balancing for enhanced resilience
This commit introduces dynamic weight adjustment for RPC providers, improving failover and resilience by adapting to real-time provider health.
Key changes include:
- Introduced a `Health` module (`chain/ethereum/src/health.rs`) to monitor RPC provider latency, error rates, and consecutive failures.
- Integrated health metrics into the RPC provider selection logic in `chain/ethereum/src/network.rs`.
- Dynamically adjusts provider weights based on their health scores, ensuring traffic is steered away from underperforming endpoints.
- Updated `node/src/network_setup.rs` to initialize and manage health checkers for Ethereum RPC adapters.
- Added `tokio` dependency to `chain/ethereum/Cargo.toml` and `node/Cargo.toml` for asynchronous health checks.
- Refactored test cases in `chain/ethereum/src/network.rs` to accommodate dynamic weighting.
This enhancement builds upon the existing static weighted RPC steering, allowing for more adaptive and robust RPC management.
Fixes #61261 parent 1962635 commit 8c89755
File tree
7 files changed
+118
-8
lines changed- chain/ethereum
- src
- node
- src
7 files changed
+118
-8
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
133 | | - | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
| |||
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| 146 | + | |
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
| |||
151 | 156 | | |
152 | 157 | | |
153 | 158 | | |
| 159 | + | |
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| |||
267 | 273 | | |
268 | 274 | | |
269 | 275 | | |
270 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
271 | 286 | | |
272 | 287 | | |
273 | 288 | | |
| |||
382 | 397 | | |
383 | 398 | | |
384 | 399 | | |
| 400 | + | |
385 | 401 | | |
386 | 402 | | |
387 | 403 | | |
| |||
842 | 858 | | |
843 | 859 | | |
844 | 860 | | |
| 861 | + | |
845 | 862 | | |
846 | 863 | | |
847 | 864 | | |
848 | | - | |
| 865 | + | |
849 | 866 | | |
850 | 867 | | |
851 | 868 | | |
| |||
937 | 954 | | |
938 | 955 | | |
939 | 956 | | |
| 957 | + | |
940 | 958 | | |
941 | 959 | | |
942 | 960 | | |
| |||
961 | 979 | | |
962 | 980 | | |
963 | 981 | | |
964 | | - | |
| 982 | + | |
965 | 983 | | |
966 | 984 | | |
967 | 985 | | |
| |||
1003 | 1021 | | |
1004 | 1022 | | |
1005 | 1023 | | |
1006 | | - | |
| 1024 | + | |
1007 | 1025 | | |
1008 | 1026 | | |
1009 | 1027 | | |
| |||
1077 | 1095 | | |
1078 | 1096 | | |
1079 | 1097 | | |
1080 | | - | |
| 1098 | + | |
1081 | 1099 | | |
1082 | 1100 | | |
1083 | 1101 | | |
| |||
1104 | 1122 | | |
1105 | 1123 | | |
1106 | 1124 | | |
1107 | | - | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1108 | 1129 | | |
1109 | 1130 | | |
1110 | 1131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
| |||
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
296 | 305 | | |
297 | 306 | | |
298 | 307 | | |
| |||
341 | 350 | | |
342 | 351 | | |
343 | 352 | | |
| 353 | + | |
344 | 354 | | |
345 | 355 | | |
346 | 356 | | |
| |||
455 | 465 | | |
456 | 466 | | |
457 | 467 | | |
| 468 | + | |
458 | 469 | | |
459 | 470 | | |
460 | 471 | | |
0 commit comments