-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(l1): peers negotiated capabilities (#1887)
**Motivation** As mentioned in #1885 the logic of storing peers capabilities wasn't entirely right. **Description** This update improves the negotiation of capabilities during the `Hello` message exchange when establishing a connection. The main issue previously was that we were not correctly handling capability matching and so we were initiating connections with incompatible peers. Changes: - Verifies compatibility by matching supported versions and storing the highest available version: currently, we only support `eth/68`, so there isn’t a higher version, but keeping this check aligns with the protocol specification and we avoid having repeated hardcoded values. - Sends and validates that the eth version in the `Status` message matches the one negotiated in the `Hello` exchange. - Adds a check to confirm that peers support at least one of our `eth` versions. Previously, we encountered a case where a node supported `snap` and `eth` but not an `eth` version we support. Despite this, the connection was established because `snap` was shared. However, since `snap` requires `eth` as well, this led to connections with incompatible peers. Closes None
- Loading branch information
1 parent
090e6ab
commit 08cf8f4
Showing
2 changed files
with
67 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters