Low-level transport protocol based on TLS+yamux
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- distributed-systems, networking
Hướng nghiên cứu
Không có tệp repository, entry point hoặc test nào được nêu. Hãy bắt đầu bằng cách đọc TLS record và yamux layering được đề xuất, rồi so sánh chúng với devp2p stack hiện tại được mô tả trong issue. Công việc chỉ được xem là hoàn tất khi đã thống nhất một handshake và phạm vi triển khai cụ thể trước khi có thể xây dựng và đánh giá một transport.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The current devp2p stack provides an inefficient interface to protocol applications that end up having to use a fixed message format to communicate. This is due to the fact that the layers that compose the stack are not independent from each other. This document proposes a different modular stack based on the abstraction layers mechanism followed in the OSI network protocol stack.
In the OSI model [1], different protocols are built one under another, each layer designed with a single purpose in mind. This modularization makes design and evaluation easier. Upper layers are unaware about the logic of lower layers and communicate with a specific interface. This transparency makes it possible to build FTP, DNS or TLS under the same TCP interface.
The new proposed stack has two layers. First, the security layer establishes a secure connection with a remote peer, it is based on TLS. Second, once the connection is established the signal is multiplexed in different streams. Both of this layers take as input a batch of binary data without any specific format. Thus, it is possible to change any layer at any time. Application protocols can use this flexible input format to build any type of communication protocol: FTP, SSH, RPC or [2].
Objectives
-
The transport protocol should care exclusively about securing a connection with the other peer and providing different streams for the protocols. It should not introduce any other logic like flow control, congestion avoidance... It should be up to the higher layers to introduce this logic if they require it on their application protocols.
-
The transport protocol should be application protocol independent. Higher-level protocols can layer on top of it transparently.
DevP2P
A small recap on the workings of devp2p. First, both peers start a handshake process to agree on a set of mac and cipher stream keys. Second, a secure transport connection is established with the former keys. Messages are sent with the format (code int, data bytes), each message is compressed, hashed with a mac and encrypted before being written to the insecure channel (RLPX protocol). Third, the peers agree on a set of protocols (i.e. eth64) and for each one start an independent stream on the secure channel (multiplexing). The protocols send messages to the stream also with the format (code, data). The code in the message is used to send the data to the correct stream.
Limitations:
-
Rlpx macs and encrypts all the message at the same time. This may be a burden for big messages.
-
The upper protocols that use the transport (i.e. eth64) end up having to use a fixed message format (code, message). This limits their flexibility and the type of communication they can use.
Proposal
This new transport proposal follows the same methodology as devp2p but applies a different set of protocols for each layer.
Handshake is still TBD. It is assumed that the peers agree on a set of mac and cipher stream keys. Next, the TLS record protocol [3] secures the application data. It behaves similar to RLPX, it macs and encrypts the data and then writes it to the insecure connection. However, the main benefit is that it divides the outgoing message into manageable blocks and reassembles incoming messages. Thus, it consumes less memory. The only input the record protocol takes is a message (bytes) to be transmitted.
We then use the yamux protocol [4] to multiplex the secure signal into different streams. Those streams are the ones exposed to the upper layers (protocols). Again, the created streams only take bytes as input.
Benefits
-
It provides a flexible interface for the protocol backends to implement any type of exchange mechanism (i.e. rpc, pub/sub).
-
It uses well known and production hardened protocols (TLS record and yamux).
-
Encrypting and sending data in blocks makes it more performant in terms of speed and memory. Benchmarks show that TLS is 10x faster than RLPX.
-
Every major language has already optimal implementations of TLS and the record protocol.
-
It would be faster and easier to build new protocols [5].
References
[1]. https://en.wikipedia.org/wiki/OSI_model
[2]. https://github.com/ethereum/devp2p/issues/70
[3]. https://docs.microsoft.com/en-us/windows/desktop/secauthn/tls-record-protocol
[4]. https://github.com/hashicorp/yamux/blob/master/spec.md
[5]. https://github.com/yperbasis/silkworm/blob/master/doc/sync_protocol.pdf
- Ngôn ngữ chính
- JavaScript
- Star
- 1.1k
- Fork
- 301
- Merge trung bình
- 12 giờ 3 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ethereum/devp2p
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Post-quantum ENR/discv5Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Specify the "snap" ENR entry and how it signals snap versionsCó thể đã có người làm @MysticRyuujin đã nhận 47 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
ethereum/devp2p#286 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
ethereum/devp2p#282 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
ethereum/devp2p#279 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ethereum/devp2p
Issue tương tự
-
[External Plugin]: zooopĐang mởexternal-plugin ready-for-review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/awesome-copilot#6655 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
-
type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
c-w-z/commit-decision-record#32 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
perf: the Evaluations leaderboard and the @ model menus download every model image at onceCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug confirmed issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 78/100
open-webui/open-webui#35213 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
exa-studio/ApiVault#338 ·