-
Notifications
You must be signed in to change notification settings - Fork 261
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
codegen: Fetch and decode metadata version then fallback #1092
Merged
Conversation
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
Signed-off-by: Alexandru Vasile <[email protected]>
jsdw
reviewed
Jul 24, 2023
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
jsdw
reviewed
Jul 25, 2023
jsdw
reviewed
Jul 25, 2023
jsdw
reviewed
Jul 25, 2023
Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: James Wilson <[email protected]>
Co-authored-by: James Wilson <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
jsdw
approved these changes
Jul 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me; the builder pattern cleans things up a bit too :)
tadeohepperle
approved these changes
Jul 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
tadeohepperle
pushed a commit
that referenced
this pull request
Aug 2, 2023
* codegen: Fetch and decode metadata version then fallback Signed-off-by: Alexandru Vasile <[email protected]> * cli: Add `unstable-metadata` attribute to the subxt macro Signed-off-by: Alexandru Vasile <[email protected]> * docs: Add missing comma Signed-off-by: Alexandru Vasile <[email protected]> * macro: Add `GenerateRuntimeApi` Signed-off-by: Alexandru Vasile <[email protected]> * Update subxt/src/lib.rs Co-authored-by: James Wilson <[email protected]> * Update macro/src/lib.rs Co-authored-by: James Wilson <[email protected]> * subxt: Adjust docs Signed-off-by: Alexandru Vasile <[email protected]> * cli: Import `GenerateRuntimeApi` Signed-off-by: Alexandru Vasile <[email protected]> --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: James Wilson <[email protected]>
tadeohepperle
added a commit
that referenced
this pull request
Aug 11, 2023
* implement partial key iters * format * make tests compile * fix docs and try example * codegen: Fetch and decode metadata version then fallback (#1092) * codegen: Fetch and decode metadata version then fallback Signed-off-by: Alexandru Vasile <[email protected]> * cli: Add `unstable-metadata` attribute to the subxt macro Signed-off-by: Alexandru Vasile <[email protected]> * docs: Add missing comma Signed-off-by: Alexandru Vasile <[email protected]> * macro: Add `GenerateRuntimeApi` Signed-off-by: Alexandru Vasile <[email protected]> * Update subxt/src/lib.rs Co-authored-by: James Wilson <[email protected]> * Update macro/src/lib.rs Co-authored-by: James Wilson <[email protected]> * subxt: Adjust docs Signed-off-by: Alexandru Vasile <[email protected]> * cli: Import `GenerateRuntimeApi` Signed-off-by: Alexandru Vasile <[email protected]> --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: James Wilson <[email protected]> * Bump darling from 0.20.1 to 0.20.3 (#1085) Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.1 to 0.20.3. - [Release notes](https://github.com/TedDriggs/darling/releases) - [Changelog](https://github.com/TedDriggs/darling/blob/master/CHANGELOG.md) - [Commits](TedDriggs/darling@v0.20.1...v0.20.3) --- updated-dependencies: - dependency-name: darling dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Wilson <[email protected]> * Bump either from 1.8.1 to 1.9.0 (#1084) Bumps [either](https://github.com/bluss/either) from 1.8.1 to 1.9.0. - [Commits](rayon-rs/either@1.8.1...1.9.0) --- updated-dependencies: - dependency-name: either dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Wilson <[email protected]> * Bump clap from 4.3.11 to 4.3.19 (#1083) Bumps [clap](https://github.com/clap-rs/clap) from 4.3.11 to 4.3.19. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@v4.3.11...v4.3.19) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Wilson <[email protected]> Co-authored-by: Tadeo Hepperle <[email protected]> * Bump trybuild from 1.0.81 to 1.0.82 (#1082) Bumps [trybuild](https://github.com/dtolnay/trybuild) from 1.0.81 to 1.0.82. - [Release notes](https://github.com/dtolnay/trybuild/releases) - [Commits](dtolnay/trybuild@1.0.81...1.0.82) --- updated-dependencies: - dependency-name: trybuild dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Wilson <[email protected]> * Prep for 0.30.1 release (#1094) * Set minimum supported `rust-version` to `1.70` (#1097) * Bump serde_json from 1.0.103 to 1.0.104 (#1100) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.103 to 1.0.104. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](serde-rs/json@v1.0.103...v1.0.104) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump serde from 1.0.175 to 1.0.179 (#1101) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.175 to 1.0.179. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.175...v1.0.179) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Tests: support 'substrate-node' too and allow multiple binary paths (#1102) * Support 'substrate-node' too and allow multiple binary paths * fmt * clippy * fix path * adjust book * remove the partial iteration example. there was nothing good to show * revert spaces in changelog * Support more types in Storage entry constructors (#1105) * implement test for type alias being used * Bump serde from 1.0.179 to 1.0.183 (#1112) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.179 to 1.0.183. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.179...v1.0.183) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump regex from 1.9.1 to 1.9.3 (#1110) Bumps [regex](https://github.com/rust-lang/regex) from 1.9.1 to 1.9.3. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](rust-lang/regex@1.9.1...1.9.3) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * revert yaml changes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update subxt/src/book/usage/storage.rs Co-authored-by: James Wilson <[email protected]> * remove dynamic_iter * fix example * format * add example, adjust book * Update subxt/src/book/usage/storage.rs Co-authored-by: Alexandru Vasile <[email protected]> --------- Signed-off-by: Alexandru Vasile <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Alexandru Vasile <[email protected]> Co-authored-by: James Wilson <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Jones <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The #1091 exposed an error on out-of-date chains in terms of metadata with the latest substrate.
The code could fetch the latest unstable metadata, but that metadata version would fail to decode.
Failing to decode the metadata is a terminal error in our codegen.
To mitigate this behavior, the codegen would fetch and decode the metadata, the fallback on fetching older versions if that fails.
The order of fetching operations:
unstable-metadata
attribute is providedThis is a bit overkill but hopefully would continue to work fine with fallbacks always on stable v15 and v14.
Closes: #1091