Commit Graph

551 Commits

Author SHA1 Message Date
Alexandru Vasile e754e2d562 working: Reintroduce Platform impl + instant crash fix
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-06 22:27:54 +03:00
Alexandru Vasile 9be09e8daa Export light-client functionality for WASM
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-06 21:08:05 +03:00
Alexandru Vasile 600a5cd14c Update platform code to use smoldot-wasm for testing
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-05 19:03:31 +03:00
Alexandru Vasile 853a71ec24 Compile Platform impl
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-05 15:52:28 +03:00
Alexandru Vasile b70beaf7a4 Backup platform impl
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-02 19:16:52 +03:00
Alexandru Vasile ede1094be3 Use opt-level 3 for smoldot and local target build
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-01 17:58:42 +03:00
Alexandru Vasile 77cfeb7113 Update sp-crates from crates.io
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-31 17:58:50 +03:00
Alexandru Vasile c03a93e62e Merge remote-tracking branch 'origin/master' into lexnv/light_client_support 2023-05-31 17:57:04 +03:00
Andrew Jones 011a4bd42f Add topics to EventDetails (#989)
* Add topics to `EventDetails`

* Update comment

* Fmt

* Clippy
2023-05-31 13:10:06 +01:00
Tadeo Hepperle 1ddae684d5 restrict sign_with_address_and_signature interface (#988) 2023-05-30 18:18:40 +02:00
dependabot[bot] 80d69abcec Bump proc-macro2 from 1.0.58 to 1.0.59 (#985)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.58 to 1.0.59.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.58...1.0.59)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 15:15:57 +02:00
dependabot[bot] 437ff43667 Bump quote from 1.0.27 to 1.0.28 (#983)
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.27 to 1.0.28.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.27...1.0.28)

---
updated-dependencies:
- dependency-name: quote
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 15:35:14 +03:00
dependabot[bot] b88cd0a3fc Bump regex from 1.8.2 to 1.8.3 (#986)
Bumps [regex](https://github.com/rust-lang/regex) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.8.2...1.8.3)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 11:50:11 +02:00
dependabot[bot] b874315767 Bump tokio from 1.28.1 to 1.28.2 (#984)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.1 to 1.28.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.1...tokio-1.28.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 11:28:50 +02:00
James Wilson ae0ab3e8f3 Tidy up some metadata accessing (#978)
* Reduce some repetition when obtaining metadata pallets/runtime_traits

* make them pub

* fix docs and clippy
2023-05-26 13:51:10 +01:00
James Wilson 870d4df2ed Skip call variants if there aren't any (#980)
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2023-05-26 13:40:35 +01:00
Tadeo Hepperle e8612ddae0 Yew Subxt WASM examples (#968)
* add wasm examples

* cargo fmt

* change crate name

* resolve workspace conflicts
2023-05-26 11:14:49 +02:00
Alexandru Vasile df1214663d Update light client to point to crates.io
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-26 11:57:17 +03:00
Alexandru Vasile 8e46da77ee Remove support for chainHead_storage for light client
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 17:47:52 +03:00
Alexandru Vasile f405c897dc testing: Keep lightclient variant
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 16:40:27 +03:00
Alexandru Vasile d6f69ef1aa Adjust tests for light-clients and normal clients
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 15:21:14 +03:00
Alexandru Vasile 5aa0ac880a lightclient: Ignore validated events
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 14:48:55 +03:00
Alexandru Vasile 8624d7256a testing: Fix clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 14:44:12 +03:00
Alexandru Vasile 8600842f69 book: Add light client section
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 14:25:33 +03:00
Alexandru Vasile b4c818c27a Merge remote-tracking branch 'origin/master' into lexnv/light_client_support
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 14:11:15 +03:00
Alexandru Vasile f33d4cf0da feature: Rename experimental to unstable
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 14:05:33 +03:00
Alexandru Vasile e470006fac examples: Remove prior light client example
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 14:01:43 +03:00
Alexandru Vasile 1ba4b8205d example: Light client coprehensive example for live chains
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 14:01:13 +03:00
Alexandru Vasile 973c4233fe examples: Tx basic with light client for local nodes
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 14:00:38 +03:00
Alexandru Vasile c241506dba lightclient: Handle RPC error responses
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 13:59:49 +03:00
Alexandru Vasile 14b6013b33 artifacts: Add polkadot spec
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 13:59:28 +03:00
Alexandru Vasile 922e19a3f3 types: Handle storage replies from chainHead_storage
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 13:59:12 +03:00
Alexandru Vasile 01549d06c4 artifacts: Update dev chain spec
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-25 13:58:42 +03:00
James Wilson b9f5419095 Introduce Metadata type (#974)
* WIP new Metadata type

* Finish basic Metadata impl inc hashing and validation

* remove caching from metadata; can add that higher up

* remove caches

* update retain to use Metadata

* clippy fixes

* update codegen to use Metadata

* clippy

* WIP fixing subxt lib

* WIP fixing tests, rebuild artifacts, fix OrderedMap::retain

* get --all-targets compiling

* move DispatchError type lookup back to being optional

* cargo clippy

* fix docs

* re-use VariantIndex to get variants

* add docs and enforce docs on metadata crate

* fix docs

* add test and fix docs

* cargo fmt

* address review comments

* update lockfiles

* ExactSizeIter so we can ask for len() of things (and hopefully soon is_empty()
2023-05-25 10:35:21 +01:00
Tadeo Hepperle f344d0dd4d CLI subxt explore commands (#950)
* add cli command to explore metadata

* fmt and clippy

* Bump serde from 1.0.160 to 1.0.162 (#948)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.160 to 1.0.162.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.160...1.0.162)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* extrinsics: Decode extrinsics from blocks (#929)

* Update polkadot.scale

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics: Add extrinsics client

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics: Decode extrinsics

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Add extrinsic error

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* blocks: Expose extrinsics

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* examples: Fetch and decode block extrinsics

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix clippy

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics: Fetch pallet and variant index

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Move extrinsics on the subxt::blocks

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* example: Adjust example

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* metadata: Collect ExtrinsicMetadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Implement StaticExtrinsic for the calls

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Adjust examples

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* codegen: Add root level Call enum

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Adjust testing

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Add new decode interface

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Merge ExtrinsicError with BlockError

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* examples: Find first extrinsic

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Move code to extrinsic_types

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Add Extrinsic struct

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Adjust examples

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* test: Decode extinsics

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics/test: Add fake metadata for static decoding

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics/test: Decode from insufficient bytes

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics/test: Check unsupported versions

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics/test: Statically decode to root and pallet enums

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics/tests: Remove clones

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* blocks: Fetch block body inline

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* blocks: Rename ExtrinsicIds to ExtrinsicPartTypeIds

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics/test: Check decode as_extrinsic

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* blocks: Remove InsufficientData error

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* blocks: Return error from extrinsic_metadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* extrinsics: Postpone decoding of call bytes

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* metadata_type: Rename variables

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Adjust calls path for example and tests

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* examples: Remove traces

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* book: Add extrinsics documentation

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* book: Improve extrinsics docs

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>

* change doc comments

* add constants exploration

* add storage access interface but not done yet

* add storage exploration

* formatting

* remove dbg

* some small tweaks

* fix formatting and scale value for storage

* split up files, sort entries, change formatting

* fmt and clippy fix

* fix minor formatting issue

* implement suggestions

* implement other suggestion, fix bug

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
2023-05-23 13:33:07 +02:00
James Wilson 5960cd2ac8 Ensure unique types in codegen (#967)
* Ensure unique types in codegen

* tweak comment

* Test the duplicate type codegen stuff

* appease clippy

* fix import

* add another test for generics being de-duplicated

* cargo fmt

---------

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2023-05-23 11:54:52 +01:00
Alexandru Vasile 5b15e2d33d Fix typo
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-22 18:48:29 +03:00
Alexandru Vasile 890a0e104e Update subxt/src/rpc/lightclient/background.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2023-05-22 18:47:40 +03:00
Alexandru Vasile c6668f6c27 lightclient: Fetch spec only if jsonrpsee feature is enabled
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-22 18:43:56 +03:00
Alexandru Vasile 414061591a Import hashmap entry
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-22 17:49:06 +03:00
Alexandru Vasile 5a04b21f7a Fix clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-22 17:42:53 +03:00
Alexandru Vasile 96b428c8b4 Apply cargo fmt
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-22 17:36:23 +03:00
Alexandru Vasile d25c1338b7 Update sp-* crates and smoldot to use git with branch / rev
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-22 17:31:54 +03:00
dependabot[bot] 4444bed627 Bump clap from 4.2.7 to 4.3.0 (#972)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.7 to 4.3.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.2.7...clap_complete-v4.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2023-05-22 10:45:25 +01:00
dependabot[bot] ef1bab97c7 Bump proc-macro2 from 1.0.56 to 1.0.58 (#970)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.56 to 1.0.58.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.56...1.0.58)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
2023-05-22 10:26:47 +01:00
Tadeo Hepperle e63d618b28 Retain specific runtime APIs (#961)
* retain runtime apis

* fix ui test

* use boxed closures
2023-05-22 11:02:36 +02:00
dependabot[bot] 9980e9db72 Bump scale-info from 2.6.0 to 2.7.0 (#973)
Bumps [scale-info](https://github.com/paritytech/scale-info) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/paritytech/scale-info/releases)
- [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paritytech/scale-info/commits/v2.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
2023-05-22 09:59:33 +01:00
dependabot[bot] a61359d914 Bump Swatinem/rust-cache from 2.3.0 to 2.4.0 (#971)
Bumps [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/Swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Swatinem/rust-cache/compare/060bda31e0be4f453bb6ed2d7e5427b31734ad01...988c164c3d0e93c4dbab36aaf5bbeb77425b2894)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-22 11:00:12 +03:00
Alexandru Vasile d59a33156f examples: Add light client example
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-18 20:14:14 +03:00
Alexandru Vasile 0dc47f2060 Update cargo lock
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-18 20:07:10 +03:00