Errors for all RPC Requests#5867
Conversation
| self.delayed_requests | ||
| .retain(|(map_peer_id, protocol), queue| { | ||
| if map_peer_id == &peer_id { | ||
| // NOTE: Currently cannot remove entries from the DelayQueue, we will just let |
There was a problem hiding this comment.
I was looking and I think we don't need ready_requests as when next_peer_request is ready we can just return it and keep returning as long as it's ready SelfRateLimiter will keep being polled. I can submit a subsequent PR removing it if you agree.
There was a problem hiding this comment.
I had an initial version of this that removed the delalyQueue and used a HashMapDelay. The problem I ran into was that typically there is a queue or backlog per (peer_id, protocol). When we insert them, the delay time is for the first in the queue. When I was using a HashMapDelay, they all expired really quickly which meant we had to keep requeuing them.
The current version just expires the first element in the queue then we check for the next element and queue that, rather than all elements in the queue, if this makes sense.
Squashed commit of the following: commit a3c8e01 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:38:35 2024 +1000 Downgrade to 1.77 commit dbfde08 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:34:11 2024 +1000 Bump rust version to 1.78 commit 2e4fe3f Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:26:50 2024 +1000 Code improvement commit 70e5326 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:05:00 2024 +1000 Report errors for rate limited requests commit 7b0e346 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 13:25:22 2024 +1000 Return and error if peer has disconnected
Co-authored-by: João Oliveira <hello@jxs.pt>
Squashed commit of the following: commit a3c8e01 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:38:35 2024 +1000 Downgrade to 1.77 commit dbfde08 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:34:11 2024 +1000 Bump rust version to 1.78 commit 2e4fe3f Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:26:50 2024 +1000 Code improvement commit 70e5326 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:05:00 2024 +1000 Report errors for rate limited requests commit 7b0e346 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 13:25:22 2024 +1000 Return and error if peer has disconnected
Squashed commit of the following: commit 9699902 Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Sun Jun 2 20:07:07 2024 +0200 fix fmt commit 05bddb9 Author: Age Manning <Age@AgeManning.com> Date: Sun Jun 2 15:04:02 2024 +1000 Update beacon_node/lighthouse_network/src/service/mod.rs Co-authored-by: João Oliveira <hello@jxs.pt> commit a3c8e01 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:38:35 2024 +1000 Downgrade to 1.77 commit dbfde08 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:34:11 2024 +1000 Bump rust version to 1.78 commit 2e4fe3f Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:26:50 2024 +1000 Code improvement commit 70e5326 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:05:00 2024 +1000 Report errors for rate limited requests commit 7b0e346 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 13:25:22 2024 +1000 Return and error if peer has disconnected
Squashed commit of the following: commit 9699902 Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Sun Jun 2 20:07:07 2024 +0200 fix fmt commit 05bddb9 Author: Age Manning <Age@AgeManning.com> Date: Sun Jun 2 15:04:02 2024 +1000 Update beacon_node/lighthouse_network/src/service/mod.rs Co-authored-by: João Oliveira <hello@jxs.pt> commit a3c8e01 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:38:35 2024 +1000 Downgrade to 1.77 commit dbfde08 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:34:11 2024 +1000 Bump rust version to 1.78 commit 2e4fe3f Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:26:50 2024 +1000 Code improvement commit 70e5326 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:05:00 2024 +1000 Report errors for rate limited requests commit 7b0e346 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 13:25:22 2024 +1000 Return and error if peer has disconnected
…c-peer-disconnect-error
Squashed commit of the following: commit 638a9bb Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Jun 5 18:11:20 2024 -0400 update lockfile commit 7b2cc6c Merge: 9699902 7a7fc82 Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Jun 5 18:11:03 2024 -0400 Merge branch 'unstable' of https://github.com/sigp/lighthouse into rpc-peer-disconnect-error commit 9699902 Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Sun Jun 2 20:07:07 2024 +0200 fix fmt commit 05bddb9 Author: Age Manning <Age@AgeManning.com> Date: Sun Jun 2 15:04:02 2024 +1000 Update beacon_node/lighthouse_network/src/service/mod.rs Co-authored-by: João Oliveira <hello@jxs.pt> commit a3c8e01 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:38:35 2024 +1000 Downgrade to 1.77 commit dbfde08 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:34:11 2024 +1000 Bump rust version to 1.78 commit 2e4fe3f Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:26:50 2024 +1000 Code improvement commit 70e5326 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 17:05:00 2024 +1000 Report errors for rate limited requests commit 7b0e346 Author: Age Manning <Age@AgeManning.com> Date: Thu May 30 13:25:22 2024 +1000 Return and error if peer has disconnected
|
@Mergifyio queue |
✅ The pull request has been merged automaticallyDetailsThe pull request has been merged automatically at 7b48b0b |
Sync now requires all RPC messages to either return a success or a failure. A disconnection doesn't count as a failure.
Prior to this PR, there were two known cases where an RPC request can get "lost", i.e no error response. These are:
This PR should remedy these cases. In the first case, we instantly send an error response when the peer has disconnected. In the second case, we now watch for disconnection messages and then report an error for all messages that we are currently holding due to self rate limiting.
In the process of doing this PR, I thought I needed an updated version of tokio-util in order to make the code cleaner. It turned out that wasn't the case, but I had already done the work to upgrade it. So I have left these changes in, which imo improve the code by removing a match case in most cases.