Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into na-make-logging-les…
Browse files Browse the repository at this point in the history
…s-verbose
  • Loading branch information
niklasad1 committed May 26, 2022
2 parents 2ad319a + 47d36b9 commit 6d5d04d
Show file tree
Hide file tree
Showing 88 changed files with 2,735 additions and 1,070 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Benchmarks

on:
schedule:
- cron: "0 0 * * *"

jobs:
bench:
name: Run benchmarks daily
runs-on: ubuntu-latest
steps:

- name: Checkout Sources
uses: actions/checkout@v3.0.2

- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: nightly
override: true

- name: Rust Cache
uses: Swatinem/rust-cache@v1.4.0

- name: Run benchmark
run: cargo bench -p jsonrpsee-benchmarks -- --output-format bencher | tee output.txt

- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
tool: 'cargo'
output-file-path: output.txt
benchmark-data-dir-path: "bench/dev"
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
alert-comment-cc-users: '@niklasad1'
auto-push: true
67 changes: 55 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ on:
branches:
- master

env:
CARGO_TERM_COLOR: always
# Download a RPC server to run wasm tests against.
SUBSTRATE_URL: https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate

jobs:
check-style:
name: Check style
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v3.0.2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1.0.7
Expand All @@ -29,7 +34,7 @@ jobs:
components: clippy, rustfmt

- name: Rust Cache
uses: Swatinem/rust-cache@v1.3.0
uses: Swatinem/rust-cache@v1.4.0

- name: Cargo fmt
uses: actions-rs/cargo@v1.0.3
Expand All @@ -43,15 +48,29 @@ jobs:
command: clippy
args: --all-targets

- name: Check rustdoc links
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items
check-docs:
name: Check rustdoc
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3.0.2

- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: nightly
override: true

- name: Check rustdoc
run: RUSTDOCFLAGS="--cfg docsrs --deny rustdoc::broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items --all-features

check-code:
name: Check
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v3.0.2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1.0.7
Expand All @@ -67,7 +86,7 @@ jobs:
version: 0.5

- name: Rust Cache
uses: Swatinem/rust-cache@v1.3.0
uses: Swatinem/rust-cache@v1.4.0

- name: Cargo check all targets and features
run: cargo hack check --workspace --each-feature --all-targets
Expand All @@ -77,7 +96,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v3.0.2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1.0.7
Expand All @@ -93,7 +112,7 @@ jobs:
version: 0.9

- name: Rust Cache
uses: Swatinem/rust-cache@v1.3.0
uses: Swatinem/rust-cache@v1.4.0

- name: Cargo nextest
run: cargo nextest run --workspace
Expand All @@ -103,7 +122,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v3.0.2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1.0.7
Expand All @@ -119,7 +138,7 @@ jobs:
version: 0.9

- name: Rust Cache
uses: Swatinem/rust-cache@v1.3.0
uses: Swatinem/rust-cache@v1.4.0

- name: Cargo nextest
run: cargo nextest run --workspace
Expand All @@ -129,7 +148,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v3.0.2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1.0.7
Expand All @@ -145,7 +164,31 @@ jobs:
version: 0.9

- name: Rust Cache
uses: Swatinem/rust-cache@v1.3.0
uses: Swatinem/rust-cache@v1.4.0

- name: Cargo nextest
run: cargo nextest run --workspace

wasm_tests:
name: Test wasm
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3.0.2

- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Download Substrate
run: |
curl $SUBSTRATE_URL --output substrate --location
chmod +x substrate
mkdir -p ~/.local/bin
mv substrate ~/.local/bin
- name: Run WASM tests
run: |
substrate --dev --tmp > /dev/null 2>&1 &
wasm-pack test --headless --firefox
wasm-pack test --headless --chrome
pkill substrate
working-directory: wasm-tests
17 changes: 0 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@ variables: &default-vars
CARGO_INCREMENTAL: 0
CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
CI_IMAGE: "paritytech/ci-linux:production"
VAULT_SERVER_URL: "https://vault.parity-mgmt-vault.parity.io"
VAULT_AUTH_PATH: "gitlab-parity-io-jwt"
VAULT_AUTH_ROLE: "cicd_gitlab_parity_${CI_PROJECT_NAME}"

.vault-secrets: &vault-secrets
secrets:
GITHUB_SSH_PRIV_KEY:
vault: cicd/gitlab/parity/${CI_PROJECT_NAME}/GITHUB_SSH_PRIV_KEY@kv
file: false
GITHUB_TOKEN:
vault: cicd/gitlab/parity/GITHUB_TOKEN@kv
file: false
GITHUB_USER:
vault: cicd/gitlab/parity/GITHUB_USER@kv
file: false

.common-refs: &common-refs
rules:
Expand Down Expand Up @@ -142,7 +127,6 @@ check_bench:
CI_IMAGE: "paritytech/benchmarks:latest"
<<: *kubernetes-env
<<: *schedule-refs
<<: *vault-secrets
script:
- check_bench_result artifacts/output.txt

Expand All @@ -152,7 +136,6 @@ publish-ghpages:
CI_IMAGE: "paritytech/tools:latest"
<<: *kubernetes-env
<<: *schedule-refs
<<: *vault-secrets
script:
# setup ssh
- eval $(ssh-agent)
Expand Down
97 changes: 97 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,103 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [v0.13.1] - 2022-05-13

v0.13.1 is a release that fixes the documentation for feature-gated items on `docs.rs`.

### [Fixed]
- fix: generate docs for all features on docs.rs [#767](https://github.com/paritytech/jsonrpsee/pull/767)

### [Changed]
- chore(deps): update pprof requirement from 0.8 to 0.9 [#761](https://github.com/paritytech/jsonrpsee/pull/761)

## [v0.13.0] - 2022-05-11

v0.13.0 is release that adds health API support for the HTTP server and a few bug fixes.

### [Added]
feat: add http health API [#763](https://github.com/paritytech/jsonrpsee/pull/763)

### [Fixed]
- hide internal macros from public interface [#755](https://github.com/paritytech/jsonrpsee/pull/755)
- fix: add `core` behind `http-server` feature [#760](https://github.com/paritytech/jsonrpsee/pull/760)


## [v0.12.0] - 2022-05-06

v0.12.0 is mainly a patch release with some minor features added.

### [Added]
- Make it possible to disable batch requests support [#744](https://github.com/paritytech/jsonrpsee/pull/744)
- feat: add a way to limit the number of subscriptions per connection [#739](https://github.com/paritytech/jsonrpsee/pull/739)

### [Fixed]
- fix(http client): use https connector for https [#750](https://github.com/paritytech/jsonrpsee/pull/750)
- fix(rpc module): close subscription task when a subscription is `unsubscribed` via the `unsubscribe call` [#743](https://github.com/paritytech/jsonrpsee/pull/743)
- fix(jsonrpsee): generate docs behind features [#741](https://github.com/paritytech/jsonrpsee/pull/741)

### [Changed]
- remove vault from ci [#745](https://github.com/paritytech/jsonrpsee/pull/745)
- chore(deps): update pprof requirement from 0.7 to 0.8 [#732](https://github.com/paritytech/jsonrpsee/pull/732)
- chore(deps): update gloo-net requirement from 0.1.0 to 0.2.0 [#733](https://github.com/paritytech/jsonrpsee/pull/733)

## [v0.11.0] - 2022-04-21

v0.11.0 is a breaking release that reworks how subscriptions are handled by the servers where the users have to explicitly reject or accept each subscription.
The reason for this is that the actual params in the subscription is passed to the callback and if the application decides the params are invalid and the server can't know if the call is going to fail or pass when dispatching the call.
Thus, the actual subscription method call is only answered when the subscription is accepted or rejected.

Additionally, the servers before sent a `SubscriptionClosed message` which is now disabled by default because it might break other implementations.
It is still possible to respond with a `SubscriptionClosed message` but one has to match on the result from `SubscriptionSink::pipe_from_stream`.

This release also adds support for `JSON-RPC WASM client` using web-sys bindings.

### [Added]
- feat: WASM client via web-sys transport [#648](https://github.com/paritytech/jsonrpsee/pull/648)

### [Changed]
- CI: bump Swatinem/rust-cache from 1.3.0 to 1.4.0 [#730](https://github.com/paritytech/jsonrpsee/pull/730)

### [Fixed]
- fix(rpc module): fail subscription calls with bad params [#728](https://github.com/paritytech/jsonrpsee/pull/728)


## [v0.10.1] - 2022-04-05

v0.10.1 is a release that fixes a regression in the HTTP server where the backlog was hardcoded to 128 (this is now set to 1024 by default but also configurable), introduces a couple of new APIs and a few minor bug fixes.

If your usage expects a high rate of new HTTP connections you are encouraged to update or manually configure the socket based on the traffic characteristics.

### [Changed]
- [proc macros]: only generate unsub method if not provided (#702)
- [examples]: update pubsub examples [#705](https://github.com/paritytech/jsonrpsee/pull/705)
- core: remove `Error::Request` variant [#717](https://github.com/paritytech/jsonrpsee/pull/717)
- Replace async-channel [#708](https://github.com/paritytech/jsonrpsee/pull/708)
- chore(deps): bump actions/checkout from 2.4.0 to 3 [#710](https://github.com/paritytech/jsonrpsee/pull/710)
- CI: cache cargo hack installation [#706](https://github.com/paritytech/jsonrpsee/pull/706)
- CI: try nextest [#701](https://github.com/paritytech/jsonrpsee/pull/701)
- chore(deps): update tokio-util requirement from 0.6 to 0.7 [#695](https://github.com/paritytech/jsonrpsee/pull/695)
- CI: Move CI script to new location [#694](https://github.com/paritytech/jsonrpsee/pull/694)
- refactor(log): downgrade send errors to warn [#726](https://github.com/paritytech/jsonrpsee/pull/726)

### [Fixed]
- fix(client): close subscription when server sent `SubscriptionClosed` notification [#721](https://github.com/paritytech/jsonrpsee/pull/721)
- fix(http client): set reuseaddr and nodelay. [#687](https://github.com/paritytech/jsonrpsee/pull/687)
- fix(rpc module): unsubscribe according ethereum pubsub spec [#693](https://github.com/paritytech/jsonrpsee/pull/693)
- http server: fix regression set backlog to 1024 [#718](https://github.com/paritytech/jsonrpsee/pull/718)
- README.MD: fix link to `ws server` [#703](https://github.com/paritytech/jsonrpsee/pull/703)
- fix(ws server): close all subscription when the connection is closed [#725](https://github.com/paritytech/jsonrpsee/pull/725)
- perf: don't send messages when client is gone [#724](https://github.com/paritytech/jsonrpsee/pull/724)

### [Added]
- feat(http server): add new builder APIs `build_from_tcp` and `build_from_hyper` [#719](https://github.com/paritytech/jsonrpsee/pull/719)
- feat(servers): add `SubscriptionSink::pipe_from_try_stream` to support streams that returns `Result` [#720](https://github.com/paritytech/jsonrpsee/pull/720)
- feat(servers): add max_response_size [#711](https://github.com/paritytech/jsonrpsee/pull/711)

## [v0.10.0] - 2022-04-04 [YANKED]

Yanked due to a leak when closing subscriptions in WebSocket server.

## [v0.9.0] - 2022-02-03

v0.9.0 is technically a breaking release because of the `Debug` bound of the `IdProvider` trait changed which is used by WebSocket server. In practise it should be a non-breaking upgrade for most users.
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ members = [
"client/ws-client",
"client/http-client",
"client/transport",
"client/wasm-client",
"proc-macros",
"wasm-tests",
]
resolver = "2"
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Support `WebSocket` and `HTTP` transports for both client and server.

## Examples

- [HTTP](./examples/http.rs)
- [WebSocket](./examples/ws.rs)
- [WebSocket pubsub](./examples/ws_subscription.rs)
- [API generation with proc macro](./examples/proc_macro.rs)
- [Middleware](./examples/multi_middleware.rs)
- [CORS server](./examples/cors_server.rs)
- [Core client](.examples/core_client.rs)
- [HTTP](./examples/examples/http.rs)
- [WebSocket](./examples/examples/ws.rs)
- [WebSocket pubsub](./examples/examples/ws_pubsub_broadcast.rs)
- [API generation with proc macro](./examples/examples/proc_macro.rs)
- [Middleware](./examples/examples/multi_middleware.rs)
- [CORS server](./examples/examples/cors_server.rs)
- [Core client](./examples/examples/core_client.rs)

## Roadmap

Expand Down
5 changes: 3 additions & 2 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[package]
name = "jsonrpsee-benchmarks"
version = "0.9.0"
version = "0.13.1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Benchmarks for jsonrpsee"
edition = "2021"
license = "MIT"
publish = false

[dependencies]
pprof = { version = "0.9", features = ["flamegraph", "criterion"] }
criterion = { version = "0.3", features = ["async_tokio", "html_reports"] }
futures-channel = "0.3.15"
futures-util = "0.3.15"
Expand All @@ -17,7 +18,7 @@ jsonrpc-http-server = { version = "18.0.0", optional = true }
jsonrpc-pubsub = { version = "18.0.0", optional = true }
num_cpus = "1"
serde_json = "1"
tokio = { version = "1.8", features = ["rt-multi-thread"] }
tokio = { version = "1.16", features = ["rt-multi-thread"] }

[[bench]]
name = "bench"
Expand Down
Loading

0 comments on commit 6d5d04d

Please sign in to comment.