mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
Refactor inbound substream logic with async (#1325)
## Issue Addressed #1112 The logic is slightly different but still valid wrt to error handling. - Inbound state is either Busy with a future that return the subtream (and info about the processing) - The state machine works as follows: - `Idle` with pending responses => `Busy` - `Busy` => finished ? if so and there are new pending responses then `Busy`, if not then `Idle` => not finished remains `Busy` - Add an `InboundInfo` for readability - Other stuff: - Close inbound substreams when all expected responses are sent - Remove the error variants from `RPCCodedResponse` and use the codes instead - Fix various spelling mistakes because I got sloppy last time Sorry for the delay Co-authored-by: Age Manning <Age@AgeManning.com>
This commit is contained in:
@@ -256,11 +256,8 @@ impl<TSpec: EthSpec> Behaviour<TSpec> {
|
||||
error: RPCResponseErrorCode,
|
||||
reason: String,
|
||||
) {
|
||||
self.eth2_rpc.send_response(
|
||||
peer_id,
|
||||
id,
|
||||
RPCCodedResponse::from_error_code(error, reason),
|
||||
)
|
||||
self.eth2_rpc
|
||||
.send_response(peer_id, id, RPCCodedResponse::Error(error, reason.into()))
|
||||
}
|
||||
|
||||
/* Peer management functions */
|
||||
|
||||
Reference in New Issue
Block a user