Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump subxt from 0.37.0 to 0.39.0 #3107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 10, 2025

Bumps subxt from 0.37.0 to 0.39.0.

Release notes

Sourced from subxt's releases.

v0.39.0

[0.39.0] - 2025-02-04

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), which we'll go into more detail about.

The substrate-compat feature flag has been removed.

The substrate-compat feature flag essentially provided:

  1. An implementation of the subxt::config::Header trait for anything implementing sp_runtime::traits::Header (here).
  2. Same for subxt::config::Hasher and anything implementing sp_runtime::traits::Hasher (here).
  3. A subxt_core::tx::PairSigner type which could be given something implementing sp_core::Pair and then be used to sign transactions (here).
  4. From impls for sp_runtime::AccountId32 and related for subxt::utils::AccountId32 (here).
  5. Likewise for sp_runtime::MultiAddress and subxt::utils::MultiAddress (here).
  6. Likewise for sp_runtime::MultiSignature and subxt::utils::MultiSignature (here).

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).

As a result, we've taken the decision to remove this compatibility layer from Subxt itself. To migrate away from this feature, we suggest:

  1. Using the example here to see how to use a Substrate signer to sign Subxt transactions.
  2. Looking at subxt_signer instead, if it's a viable alternative in your case.
  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:
// Wrap a substrate header type in this to impl the subxt Header trait:
struct SubxtHeader<T>(pub T);
// This basically copies the code removed from Subxt, but on a wrapper type:
impl <T> subxt::config::Header for SubxtHeader<T>
where
T: sp_runtime::traits::Header,
<T as sp_runtime::traits::Header>::Number: Into<u64>,
{
type Number = T::Number;
type Hasher = T::Hashing;
fn number(&amp;self) -&gt; Self::Number {
    *self.0.number()
}

}

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!

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.

A full list of relevant changes and fixes (nothing was added in this release) is as follows:

Changed

  • remove substrate compat (#1850)

... (truncated)

Changelog

Sourced from subxt's changelog.

[0.39.0] - 2025-02-04

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), which we'll go into more detail about.

The substrate-compat feature flag has been removed.

The substrate-compat feature flag essentially provided:

  1. An implementation of the subxt::config::Header trait for anything implementing sp_runtime::traits::Header (here).
  2. Same for subxt::config::Hasher and anything implementing sp_runtime::traits::Hasher (here).
  3. A subxt_core::tx::PairSigner type which could be given something implementing sp_core::Pair and then be used to sign transactions (here).
  4. From impls for sp_runtime::AccountId32 and related for subxt::utils::AccountId32 (here).
  5. Likewise for sp_runtime::MultiAddress and subxt::utils::MultiAddress (here).
  6. Likewise for sp_runtime::MultiSignature and subxt::utils::MultiSignature (here).

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).

As a result, we've taken the decision to remove this compatibility layer from Subxt itself. To migrate away from this feature, we suggest:

  1. Using the example here to see how to use a Substrate signer to sign Subxt transactions.
  2. Looking at subxt_signer instead, if it's a viable alternative in your case.
  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:
// Wrap a substrate header type in this to impl the subxt Header trait:
struct SubxtHeader<T>(pub T);
// This basically copies the code removed from Subxt, but on a wrapper type:
impl <T> subxt::config::Header for SubxtHeader<T>
where
T: sp_runtime::traits::Header,
<T as sp_runtime::traits::Header>::Number: Into<u64>,
{
type Number = T::Number;
type Hasher = T::Hashing;
fn number(&amp;self) -&gt; Self::Number {
    *self.0.number()
}

}

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!

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.

A full list of relevant changes and fixes (nothing was added in this release) is as follows:

Changed

  • remove substrate compat (#1850)
  • migrate custom error trait impls to thiserror (#1856)

... (truncated)

Commits
  • c96387c Prep to release 0.39.0 (#1918)
  • d924ece Don't double hash: use the same hash in ExtrinsicDetails and ExtrinsicDetails...
  • 29bf00e Fix and test sr25519 signing in nostd (#1872)
  • 94f4e7f preserve custom metadata when converting between Subxt metadata and frame_met...
  • a5a1733 build(deps): bump dawidd6/action-download-artifact (#1909)
  • 56c410c Update Artifacts (auto-generated) (#1908)
  • 43a1623 build(deps): bump rustls in /examples/parachain-example (#1907)
  • 7fa25a7 build(deps): bump curve25519-dalek in /examples/wasm-example (#1905)
  • 39507c7 fix: don't wrap rpc error in DisconnectedWillReconnect in reconnecting rpc cl...
  • dff4dab Tweak test to look at holds, not locks after polkadot-sdk@f5673cf (#1896)
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Feb 10, 2025
@bkontur
Copy link
Contributor

bkontur commented Feb 18, 2025

@dependabot recreate

Bumps [subxt](https://github.com/paritytech/subxt) from 0.37.0 to 0.39.0.
- [Release notes](https://github.com/paritytech/subxt/releases)
- [Changelog](https://github.com/paritytech/subxt/blob/master/CHANGELOG.md)
- [Commits](paritytech/subxt@v0.37.0...v0.39.0)

---
updated-dependencies:
- dependency-name: subxt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/cargo/subxt-0.39.0 branch from 2cfd3dc to 5aed3e6 Compare February 18, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant