Skip to content

Releases: paritytech/jsonrpsee

v0.20.3

24 Oct 16:28
v0.20.3
Compare
Choose a tag to compare

[v0.20.3] - 2023-10-24

This release fixes a cancel-safety issue in the server's graceful shutdown which could lead to high CPU usage.

[Fixed]

  • server: graceful shutdown distinguish between stopped and conn closed (#1220)
  • server: graceful shutdown fix cancel-safety issue (#1218)
  • server: graceful shutdown check Incoming::Closed (#1216)

v0.20.2

13 Oct 17:52
v0.20.2
83fd6b1
Compare
Choose a tag to compare

[v0.20.2] - 2023-10-13

This release removes the bounded buffer check which was intended to provide
backpressure all the way down to the TCP layer but it didn't work well.

For subscriptions the backpressure will be handled by implementation itself
and just rely on that.

[Changed]

  • server: remove bounded channel check (#1209)

v0.20.1

15 Sep 16:38
v0.20.1
0baddfd
Compare
Choose a tag to compare

[v0.20.1] - 2023-09-15

This release adds support for synchronous subscriptions and fixes a leak in WebSocket server
where FuturesUnordered was not getting polled until shutdown, so it was accumulating tasks forever.

[Changed]

  • client: downgrade log for unknown subscription to DEBUG (#1185)
  • refactor(http client): use HTTP connector on http URLs (#1187)
  • refactor(server): less alloc per method call (#1188)

[Fixed]

  • fix: remove needless clone in ws background task (#1203)
  • async client: save latest Waker (#1198)
  • chore(deps): bump actions/checkout from 3.6.0 to 4.0.0 (#1197)
  • fix(server): fix leak in FuturesUnordered (#1204)

[Added]

  • feat(server): add sync subscription API register_subscription_raw (#1182)

v0.16.3

23 Aug 14:51
v0.16.3
9e7ed27
Compare
Choose a tag to compare

[v0.16.3] - 2023-08-23

This release fixes https://rustsec.org/advisories/RUSTSEC-2023-0052.

v0.20.0

11 Aug 15:19
v0.20.0
f329540
Compare
Choose a tag to compare

[v0.20.0] - 2023-08-11

Another breaking release where the major changes are:

  • host filtering has been moved to tower middleware instead of the server API.
  • the clients now supports default port number such wss://my.server.com
  • the background task for the async client has been refactored to multiplex send and read operations.

Regarding host filtering prior to this release one had to do:

let acl = AllowHosts::Only(vec!["http://localhost:*".into(), "http://127.0.0.1:*".into()]);
let server = ServerBuilder::default().set_host_filtering(acl).build("127.0.0.1:0").await.unwrap();

After this release then one have to do:

let middleware = tower::ServiceBuilder::new().layer(HostFilterLayer::new(["example.com"]).unwrap());
let server = Server::builder().set_middleware(middleware).build("127.0.0.1:0".parse::<SocketAddr>()?).await?;

Thanks to the external contributors @polachok, @bobs4462 and @aj3n that contributed to this release.

[Added]

  • feat(server): add SubscriptionMessage::new (#1176)
  • feat(server): add SubscriptionSink::connection_id (#1175)
  • feat(server): add Params::get (#1173)
  • feat(server): add PendingSubscriptionSink::connection_id (#1163)

[Fixed]

  • fix(server): host filtering URI read authority (#1178)

[Changed]

  • refactor: make ErrorObject::borrowed accept &str (#1160)
  • refactor(client): support default port number (#1172)
  • refactor(server): server host filtering (#1174)
  • refactor(client): refactor background task (#1145)
  • refactor: use RootCertStore::add_trust_anchors (#1165)
  • chore(deps): update criterion v0.5 and pprof 0.12 (#1161)
  • chore(deps): update webpki-roots requirement from 0.24 to 0.25 (#1158)
  • refactor(server): move host filtering to tower middleware (#1179)

V0.19.0

24 Jul 10:45
v0.19.0
96c035c
Compare
Choose a tag to compare

Fixed

  • Fixed connections processing await on server shutdown (#1153)
  • fix: include error code in RpcLogger (#1135)
  • fix: downgrade more logs to debug (#1127)
  • fix(server): remove MethodSinkPermit to fix backpressure issue on concurrent subscriptions (#1126)
  • fix readme links (#1152)

Changed

  • server: downgrade connection logs to debug (#1123)
  • refactor(server): make Server::start infallible and add fn builder() (#1137)

v0.18.2

11 May 14:34
819ed90
Compare
Choose a tag to compare

This release improves error message for too big batch response and exposes the BatchRequestConfig type in order to make it possible to use ServerBuilder::set_batch_request_config

Fixed

  • server: export BatchRequestConfig (#1112)
  • fix(server): improve too big batch response msg (#1107)

v0.18.1

27 Apr 15:09
v0.18.1
8b0058d
Compare
Choose a tag to compare

This release fixes a couple bugs and improves the ergonomics for the HTTP client
when no tower middleware is enabled.

Changed

  • http client: add default generic param for the backend (#1099)

Fixed

  • rpc module: fix race in subscription close callback (#1098)
  • client: add missing batch request tracing span (#1097)
  • ws server: don't wait for graceful shutdown when connection already closed (#1103)

v0.18.0

24 Apr 15:22
v0.18.0
1f8c8c5
Compare
Choose a tag to compare

[v0.18.0] - 2023-04-21

This is a breaking release that removes the CallError which was used to represent a JSON-RPC error object that
could happen during JSON-RPC method call and one could assign application specific error code, message and data in a
specific implementation.

Previously jsonrpsee provided CallError that could be converted to/from jsonrpsee::core::Error
and in some scenarios the error code was automatically assigned by jsonrpsee. After jsonrpsee
added support for custom error types the CallError doesn't provide any benefit because one has to implement Into<ErrorObjectOwned>
on the error type anyway.

Thus, jsonrpsee::core::Error can't be used in the proc macro API anymore and the type alias
RpcResult has been modified to Result<(), ErrorObjectOwned> instead.

Before it was possible to do:

#[derive(thiserror::Error)]
enum Error {
	A,
	B,
}

#[rpc(server, client)]
pub trait Rpc
{
	#[method(name = "getKeys")]
	async fn keys(&self) -> Result<String, jsonrpsee::core::Error> {
		Err(jsonrpsee::core::Error::to_call_error(Error::A))
		// or jsonrpsee::core::Error::Call(CallError::Custom(ErrorObject::owned(1, "a", None::<()>)))
	}
}

After this change one has to do:

pub enum Error {
	A,
	B,
}

impl From<Error> for ErrorObjectOwned {
	fn from(e: Error) -> Self {
		match e {
			Error::A => ErrorObject::owned(1, "a", None::<()>),
			Error::B => ErrorObject::owned(2, "b", None::<()>),
		}
	}
}

#[rpc(server, client)]
pub trait Rpc {
	// Use a custom error type that implements `Into<ErrorObject>`
	#[method(name = "custom_err_ty")]
	async fn custom_err_type(&self) -> Result<String, Error> {
		Err(Error::A)
	}

	// Use `ErrorObject` as error type directly.
	#[method(name = "err_obj")]
	async fn error_obj(&self) -> RpcResult<String> {
		Err(ErrorObjectOwned::owned(1, "c", None::<()>))
	}
}

[Changed]

  • remove CallError (#1087)

[Fixed]

  • fix(proc macros): support parsing params !Result (#1094)

v0.17.1

21 Apr 14:38
v0.17.1
5466279
Compare
Choose a tag to compare

[v0.17.1] - 2023-04-21

This release fixes HTTP graceful shutdown for the server.

[Fixed]

  • server: fix http graceful shutdown (#1090)