Skip to content

Commit c96387c

Browse files
authored
Prep to release 0.39.0 (#1918)
* Pre pto release 0.39.0 * Actually save updates in Cargo.toml * Tweak changelog text
1 parent d924ece commit c96387c

File tree

8 files changed

+127
-60
lines changed

8 files changed

+127
-60
lines changed

CHANGELOG.md

+67
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,73 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.39.0] - 2025-02-04
8+
9+
This release is mostly bug fixes and changes. The only change that should be a breaking change is removing the `substrate-compat` feature flag (see [#1850](https://github.com/paritytech/subxt/pull/1850)), which we'll go into more detail about.
10+
11+
### The `substrate-compat` feature flag has been removed.
12+
13+
The `substrate-compat` feature flag essentially provided:
14+
1. An implementation of the `subxt::config::Header` trait for anything implementing `sp_runtime::traits::Header` ([here](https://github.com/paritytech/subxt/pull/1850/files#diff-26ab583bc154fdb10c63d7cc90045a6026ad6497efe790fe257b60ceb1a15ea7L137)).
15+
2. Same for `subxt::config::Hasher` and anything implementing `sp_runtime::traits::Hasher` ([here](https://github.com/paritytech/subxt/pull/1850/files#diff-26ab583bc154fdb10c63d7cc90045a6026ad6497efe790fe257b60ceb1a15ea7L149)).
16+
3. A `subxt_core::tx::PairSigner` type which could be given something implementing `sp_core::Pair` and then be used to sign transactions ([here](https://github.com/paritytech/subxt/pull/1850/files#diff-fe5469ea5a4788ffac7607c8d25f9d17c232c703f2d38ffe593cb6e87662a0afL46)).
17+
4. From impls for `sp_runtime::AccountId32` and related for `subxt::utils::AccountId32` ([here](https://github.com/paritytech/subxt/pull/1850/files#diff-61f12204f1b6828f829ea82da72826674e8f6c35943795258860b25ce59fc692L169)).
18+
5. Likewise for `sp_runtime::MultiAddress` and `subxt::utils::MultiAddress` ([here](https://github.com/paritytech/subxt/pull/1850/files#diff-956118f361c3e5fbdd6974d6f23f40fd0050714cd6bfdfe0f6624d883a2d0c7cL53)).
19+
6. Likewise for `sp_runtime::MultiSignature` and `subxt::utils::MultiSignature` ([here](https://github.com/paritytech/subxt/pull/1850/files#diff-590233f1bae2f8031dfb010e9c35ba04bb700539d8b067daa7477a0a3f14e38dL29)).
20+
21+
While useful, providing these features in Subxt is almost impossible to maintain: we can only support a single version of `sp_runtime`/`sp_core` at a time, but many versions are in use in the wild. This led to various issues regarding the mismatch between `sp_*` crates in use and a given version of Subxt. More generally, the goal of Subxt is to be independent from any specific version of Substrate, and communicate via the exposed RPC APIs in order to work across any compatible Substrate version (or indeed, alternative implementations that follow things like [the RPC spec](https://github.com/paritytech/json-rpc-interface-spec)).
22+
23+
As a result, we've taken the decision to remove this compatibility layer from Subxt itself. To migrate away from this feature, we suggest:
24+
1. Using the example [here](https://github.com/paritytech/subxt/blob/d924ece39a5cb369ba5ccde3dc160b5ee006271b/subxt/examples/substrate_compat_signer.rs) to see how to use a Substrate signer to sign Subxt transactions.
25+
2. Looking at `subxt_signer` instead, if it's a viable alternative in your case.
26+
3. Following the "here" links above to see what impls were removed. Impls can generally be recreated as needed using wrapper types which allow converting between Substrate and Subxt types/traits, for instance:
27+
28+
```rust
29+
// Wrap a substrate header type in this to impl the subxt Header trait:
30+
struct SubxtHeader<T>(pub T);
31+
32+
// This basically copies the code removed from Subxt, but on a wrapper type:
33+
impl <T> subxt::config::Header for SubxtHeader<T>
34+
where
35+
T: sp_runtime::traits::Header,
36+
<T as sp_runtime::traits::Header>::Number: Into<u64>,
37+
{
38+
type Number = T::Number;
39+
type Hasher = T::Hashing;
40+
41+
fn number(&self) -> Self::Number {
42+
*self.0.number()
43+
}
44+
}
45+
```
46+
47+
The hope is that this pattern is applicable to any such types that you find useful to share between Substrate and Subxt code. Please raise an issue if you can't find a solution in your case, and we'll endeavour to help!
48+
49+
The result of this is that your code will work against whichever Substrate crate versions you are using, at the cost of this code no longer being included behind the `substrate-compat` feature flag.
50+
51+
A full list of relevant changes and fixes (nothing was added in this release) is as follows:
52+
53+
### Changed
54+
55+
- remove substrate compat ([#1850](https://github.com/paritytech/subxt/pull/1850))
56+
- migrate custom error trait impls to `thiserror` ([#1856](https://github.com/paritytech/subxt/pull/1856))
57+
- re-export `jsonrpsee` in `subxt::ext` ([#1843](https://github.com/paritytech/subxt/pull/1843))
58+
59+
### Fixed
60+
61+
- don't double hash: use the same hash in ExtrinsicDetails and ExtrinsicDetails ([#1917](https://github.com/paritytech/subxt/pull/1917))
62+
- fix and test sr25519 signing in nostd ([#1872](https://github.com/paritytech/subxt/pull/1872))
63+
- preserve custom metadata when converting between Subxt metadata and frame_metadata ([#1914](https://github.com/paritytech/subxt/pull/1914))
64+
- fix: don't wrap rpc error in DisconnectedWillReconnect in reconnecting rpc client ([#1904](https://github.com/paritytech/subxt/pull/1904))
65+
- fix: substrate runner, support new libp2p addr log ([#1892](https://github.com/paritytech/subxt/pull/1892))
66+
- update Artifacts (auto-generated) ([#1874](https://github.com/paritytech/subxt/pull/1874))
67+
- bump frame-decode and frame-metadata to latest ([#1870](https://github.com/paritytech/subxt/pull/1870))
68+
- fix unstable-light-client + ChainHeadBackend tx events ([#1865](https://github.com/paritytech/subxt/pull/1865))
69+
- when native feature is enabled, we need polkadot-sdk/std for eg examples to work ([#1864](https://github.com/paritytech/subxt/pull/1864))
70+
- load latest metadata version from Wasm blobs. ([#1859](https://github.com/paritytech/subxt/pull/1859))
71+
- minor fix - Yew example ([#1852](https://github.com/paritytech/subxt/pull/1852))
72+
- update the release notes to work for current releases ([#1842](https://github.com/paritytech/subxt/pull/1842))
73+
774
## [0.38.0] - 2024-10-24
875

976
This release doesn't introduce any substantial breaking changes and focuses primarily on incremental improvements, testing and bug fixes. A few of the highlights include:

Cargo.lock

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ resolver = "2"
3434
[workspace.package]
3535
authors = ["Parity Technologies <[email protected]>"]
3636
edition = "2021"
37-
version = "0.38.0"
37+
version = "0.39.0"
3838
rust-version = "1.81.0"
3939
license = "Apache-2.0 OR GPL-3.0"
4040
repository = "https://github.com/paritytech/subxt"
@@ -139,14 +139,14 @@ tokio-util = "0.7.12"
139139
polkadot-sdk = { version = "0.7", default-features = false }
140140

141141
# Subxt workspace crates:
142-
subxt = { version = "0.38.0", path = "subxt", default-features = false }
143-
subxt-core = { version = "0.38.0", path = "core", default-features = false }
144-
subxt-macro = { version = "0.38.0", path = "macro" }
145-
subxt-metadata = { version = "0.38.0", path = "metadata", default-features = false }
146-
subxt-codegen = { version = "0.38.0", path = "codegen" }
147-
subxt-signer = { version = "0.38.0", path = "signer", default-features = false }
148-
subxt-lightclient = { version = "0.38.0", path = "lightclient", default-features = false }
149-
subxt-utils-fetchmetadata = { version = "0.38.0", path = "utils/fetch-metadata", default-features = false }
142+
subxt = { version = "0.39.0", path = "subxt", default-features = false }
143+
subxt-core = { version = "0.39.0", path = "core", default-features = false }
144+
subxt-macro = { version = "0.39.0", path = "macro" }
145+
subxt-metadata = { version = "0.39.0", path = "metadata", default-features = false }
146+
subxt-codegen = { version = "0.39.0", path = "codegen" }
147+
subxt-signer = { version = "0.39.0", path = "signer", default-features = false }
148+
subxt-lightclient = { version = "0.39.0", path = "lightclient", default-features = false }
149+
subxt-utils-fetchmetadata = { version = "0.39.0", path = "utils/fetch-metadata", default-features = false }
150150
test-runtime = { path = "testing/test-runtime" }
151151
substrate-runner = { path = "testing/substrate-runner" }
152152

examples/parachain-example/Cargo.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/wasm-example/Cargo.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)