-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into lexnv/awaitheader-once
Signed-off-by: Alexandru Vasile <[email protected]>
- Loading branch information
Showing
61 changed files
with
3,458 additions
and
2,162 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
# Disable previous runs | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
# ${{ vars.CI_UNIFIED_IMAGE }} is defined in the repository variables | ||
env: | ||
CI_IMAGE: "paritytech/ci-unified:bullseye-1.75.0-2024-01-22-v20240222" | ||
|
||
jobs: | ||
set-image: | ||
# This workaround sets the container image for each job using 'set-image' job output. | ||
# env variables don't work for PR from forks, so we need to use outputs. | ||
runs-on: ubuntu-latest | ||
outputs: | ||
CI_IMAGE: ${{ steps.set_image.outputs.CI_IMAGE }} | ||
steps: | ||
- id: set_image | ||
run: echo "CI_IMAGE=${{ env.CI_IMAGE }}" >> $GITHUB_OUTPUT | ||
fmt: | ||
name: Cargo fmt | ||
runs-on: ubuntu-latest | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.CI_IMAGE }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: Cargo fmt | ||
run: cargo +nightly fmt --all -- --check | ||
|
||
machete: | ||
name: Check unused dependencies | ||
runs-on: ubuntu-latest | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.CI_IMAGE }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: Install cargo-machete | ||
run: cargo install cargo-machete | ||
|
||
- name: Check unused dependencies | ||
run: cargo machete | ||
|
||
check: | ||
name: Cargo check | ||
runs-on: ubuntu-latest | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.CI_IMAGE }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: Cargo check | ||
run: cargo check | ||
|
||
doc: | ||
name: Check documentation | ||
runs-on: ubuntu-latest | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.CI_IMAGE }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
- name: Check documentation | ||
run: RUSTDOCFLAGS="-D warnings -D rustdoc::broken_intra_doc_links" cargo doc --workspace --no-deps --document-private-items | ||
|
||
clippy: | ||
name: Cargo clippy | ||
runs-on: ubuntu-latest | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.CI_IMAGE }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
# TODO: Allow clippy to fail and do not cancel other tasks. | ||
# Clippy is fixed by: https://github.com/paritytech/litep2p/pull/57. | ||
- name: Run clippy | ||
continue-on-error: true | ||
run: cargo clippy | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.CI_IMAGE }} | ||
options: --sysctl net.ipv6.conf.all.disable_ipv6=0 | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: Run tests | ||
run: cargo test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [0.3.0] - 2023-04-05 | ||
|
||
### Added | ||
|
||
- Expose `reuse_port` option for TCP and WebSocket transports ([#69](https://github.com/paritytech/litep2p/pull/69)) | ||
- protocol/mdns: Use `SO_REUSEPORT` for the mDNS socket ([#68](https://github.com/paritytech/litep2p/pull/68)) | ||
- Add support for protocol/agent version ([#64](https://github.com/paritytech/litep2p/pull/64)) | ||
|
||
## [0.2.0] - 2023-09-05 | ||
|
||
This is the second release of litep2p, v0.2.0. The quality of the first release was so bad that this release is a complete rewrite of the library. | ||
|
||
Support is added for the following features: | ||
|
||
* Transport protocols: | ||
* TCP | ||
* QUIC | ||
* WebRTC | ||
* WebSocket | ||
|
||
* Protocols: | ||
* [`/ipfs/identify/1.0.0`](https://github.com/libp2p/specs/tree/master/identify) | ||
* [`/ipfs/ping/1.0.0`](https://github.com/libp2p/specs/blob/master/ping/ping.md) | ||
* [`/ipfs/kad/1.0.0`](https://github.com/libp2p/specs/tree/master/kad-dht) | ||
* [`/ipfs/bitswap/1.2.0`](https://github.com/ipfs/specs/blob/main/BITSWAP.md) | ||
* Request-response protocol | ||
* Notification protocol | ||
* Multicast DNS | ||
* API for creating custom protocols | ||
|
||
This time the architecture has been designed to be extensible and integrating new transport and/or user-level protocols should be easier. Additionally, the test coverage is higher both in terms of unit and integration tests. The project also contains conformance tests which test the behavior of `litep2p` against, [`rust-libp2p`](https://github.com/libp2p/rust-libp2p/), [`go-libp2p`](https://github.com/libp2p/go-libp2p/) and Substrate's [`sc-network`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/client/network). Currently the Substrate conformance tests are not enabled by default as they require unpublished/unaccepted changes to Substrate. | ||
|
||
## [0.1.0] - 2023-04-04 | ||
|
||
This is the first release of `litep2p`, v0.1.0. | ||
|
||
Support is added for the following: | ||
|
||
* TCP + Noise + Yamux (compatibility with `libp2p`) | ||
* [`/ipfs/identify/1.0.0`](https://github.com/libp2p/specs/tree/master/identify) | ||
* [`/ipfs/ping/1.0.0`](https://github.com/libp2p/specs/blob/master/ping/ping.md) | ||
* Request-response protocol | ||
* Notification protocol | ||
|
||
The code quality is atrocious but it works and the second release focuses on providing high test coverage for the library. After that is done and most of the functionality is covered (unit, integration and conformance tests, benchmarks), the focus can be turned to refactoring the code into something clean and efficient. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
# Basic | ||
edition = "2021" | ||
max_width = 100 | ||
|
||
# Imports | ||
imports_granularity = "Crate" | ||
reorder_imports = true | ||
|
||
# Consistency | ||
newline_style = "Unix" | ||
|
||
# Misc | ||
chain_width = 80 | ||
spaces_around_ranges = false | ||
match_arm_blocks = false | ||
trailing_comma = "Vertical" | ||
edition = "2021" | ||
|
||
# Format comments | ||
comment_width = 100 | ||
wrap_comments = true |
Oops, something went wrong.