Parse an inbound envelope: verify MAC, check replay window, decode inner RPC. Self-addressed frames skip the replay-window check. In a single-node test (or when a node genuinely dispatches an RPC to itself over the transport) the client and server share one `AuthContext`, which means one `peer_seq_in` window is updated by *both* the server-side request-accept and the client-side response-accept.
(&self, envelope: &[u8])
| 192 | /// was never replayed, the same window simply saw traffic from both |
| 193 | /// directions for `peer_id == local_node_id`. |
| 194 | fn parse_inbound(&self, envelope: &[u8]) -> Result<RaftRpc> { |
| 195 | let (fields, inner_frame) = auth_envelope::parse_envelope(envelope, &self.auth.mac_key)?; |
| 196 | if fields.from_node_id != self.auth.local_node_id { |
| 197 | self.auth |
| 198 | .peer_seq_in |
| 199 | .accept(fields.from_node_id, fields.seq)?; |
| 200 | } |
| 201 | rpc_codec::decode(inner_frame) |
| 202 | } |
| 203 | } |
no test coverage detected