Commit ca68d9a
authored
feat: override libp2p handler when registering protocol for new fork (#7755)
**Motivation**
Right now, we do [not register a handler if it already is already
registered](https://github.com/ChainSafe/lodestar/blob/78a5e72989d10426b77bd408673fe191bbf33f8a/packages/reqresp/src/ReqResp.ts#L102-L105)
but even though we update some parts now such as rate limit at the hard
fork, we do not update all of them like `requestSizes`, we can either
pass the fork down in all the code paths where it is needed and use
getter functions or we override the handler once during the hard fork
transition. This PR proposes the later solution as it's much simpler and
seems cleaner as well.
**Description**
Override libp2p handler when registering protocol for new fork, this is
possible now due to libp2p/js-libp2p#2945 since
we updated to libp2p 2.0 in
#7359.
More context libp2p/js-libp2p#2928
Closes #75571 parent 2f79f78 commit ca68d9a
File tree
3 files changed
+17
-24
lines changed- packages
- beacon-node/src/network/reqresp
- reqresp
- src
- test/unit
3 files changed
+17
-24
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
| |||
87 | 83 | | |
88 | 84 | | |
89 | 85 | | |
90 | | - | |
| 86 | + | |
91 | 87 | | |
92 | 88 | | |
93 | | - | |
| 89 | + | |
94 | 90 | | |
95 | 91 | | |
96 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
97 | 96 | | |
98 | | - | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 100 | + | |
111 | 101 | | |
112 | 102 | | |
113 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
| 69 | + | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
81 | | - | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
95 | | - | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
0 commit comments