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

cli: Command to fetch chainSpec and optimise its size #1278

Merged
merged 19 commits into from
Nov 29, 2023

Conversation

lexnv
Copy link
Collaborator

@lexnv lexnv commented Nov 21, 2023

This PR adds a new CLI chain-spec command.

cargo run -- chain-spec --url wss://rpc.polkadot.io:443 \
  --output-file artifacts/demo_chain_specs/polkadot.json \
  --state-root-hash \
  --remove-substitutes

Parameters

URL

The spec is fetched from the address specified as --url by making a raw RPC call to the method sync_state_genSyncSpec with parameters true (obtains the raw entry).

Output File

The --output-file is optional and represents the path at which the chainSpec is written, by default stdout is used.

State Root Hash

The --state-root-hash replaces genesis.raw with genesis.stateRootHash, by decoding the provided chainSpec and computing the Blake2 hash of the entries. Smoldot helpers are used for simplicity, given that our main goal is to have a compatible chainSpec with the light-client.

This should be used for optimization purposes, both in terms of reducing the size of the chainSpec, as well as improving the synchronization time of the light-client with the target chain. When a genesis.raw entry is provided to the light client, the light client would need to compute the stateRootHash internally.

Remove Substitutes

This option removes the codeSubstitutes entry of the chainSpec. At this moment, the light client does not utilize this entry. Enabling this option would lead to a smaller size chainSpec, which is desirable to generate a minimal working chainSpec, especially for resource constraint environments.

Testing Done

The --state-root-hash command is tested against the output of the smoldot client.

Limitations

Fetching the chainSpec relies on the legacy RPC method sync_state_genSyncSpec, which is not exposed by all substrate-based chains. Such is the case of the parachain PolkadotAssetHub.

Ideally, we would need a chainSpec_getSpec that provides this information for all substrate chains. Initial spec issue that is an extension of this:

Closes: #1263

@lexnv lexnv requested a review from a team as a code owner November 21, 2023 12:14
@lexnv lexnv changed the title cli: Command to fetch chainSpec and optimise its size #1263 cli: Command to fetch chainSpec and optimise its size Nov 21, 2023
Copy link
Contributor

@tadeohepperle tadeohepperle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all a great addition to the CLI :) Just not really sure about the use of the feature flag.

/// Replaced the genesis raw entry with a stateRootHash to optimize
/// the spec size and avoid the need to calculate the genesis storage.
///
/// This option is enabled with the `chain-spec-root-hash` feature.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Here I think the feature mentioned in the docs should be "chain-spec" instead of "chain-spec-root-hash".

None => Box::new(output),
};

#[cfg(feature = "chain-spec")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit torn about the chain-spec feature. It is the first feature flag introduced to the subxt CLI tool and having feature flags on the CLI tool means that people can have different experiences using the subxt CLI tool, depending on which features they installed it with. However I understand that smoldot is quite a big dependency that we do not want to expose unnecessarily for all users.
We could also guard the entire chainspec subcommand behind the "chain-spec" feature flag, then we do not need so many #[cfg(feature = "chain-spec")] instances throughout the code. But if we keep it like this, I would probably rename it to something more clear like chain-spec-pruning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to get rid of the feature completely :)


/// Returns the node's chainSpec from the provided URL.
pub async fn fetch_chain_spec(url: Url) -> Result<serde_json::Value, FetchSpecError> {
async fn fetch_ws(url: Url) -> Result<serde_json::Value, Error> {
Copy link
Member

@niklasad1 niklasad1 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clean but my hunch is that we have duplicated this in a few places now, a util/helper crate for this would be neat.

No need to address it in this PR but just a thought, worth filing an issue IMO :)

/// This option is enabled with the `chain-spec-root-hash` feature.
///
/// Defaults to `false`.
#[cfg(feature = "chain-spec")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we concerned by the number of dependencies that smoldot brings in or why is this feature needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, since we are using only smoldot::trie we might bring in other dependencies that slow down the build. Will do a comparison between build times and the number of dependencies to have a better picture of it, thanks!

Ok(spec)
}

/// Error attempting to fetch chainSpec.
Copy link
Member

@niklasad1 niklasad1 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this error is specific for the JSON-RPC connection and I would be super happy with some util crate for that instead :)

Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but I agree with Tadeo that it would be nice to get rid of the chain-spec feature flag if the number of dependencies are "reasonable"

@lexnv
Copy link
Collaborator Author

lexnv commented Nov 28, 2023

With Feature Flag chain-spec No Feature Flag
Dependencies 520 707
Build Time 29.26s 35.41s

I believe having a feature-flag here might be worth the effort, but would love to hear your thoughts on this 🙏

Other revenues to avoid the feature-flag:

I do like the third option, although it might take some time until we properly prioritize that

Methodology

For dependencies, I've used cargo tree. And for build time, I did a cargo clean, followed by running the CLI command for chainSpec.

Util-crate

While at it, have raised an issue about the util-crate for the chain-spec: #1293

@niklasad1
Copy link
Member

Ok, I think you made right choice with a feature flag all good from myside

Signed-off-by: Alexandru Vasile <[email protected]>
@lexnv lexnv merged commit 06cfb21 into master Nov 29, 2023
10 checks passed
@lexnv lexnv deleted the lexnv/cli-chain-spec branch November 29, 2023 12:38
tadeohepperle pushed a commit that referenced this pull request Nov 29, 2023
* cli: Add chainSpec command

Signed-off-by: Alexandru Vasile <[email protected]>

* cli/chainSpec: Move to dedicated module

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Compute the state root hash

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove code substitutes

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Update polkadot.json

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Generate the chain spec

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove testing artifacts

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Fix clippy

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Apply rustfmt

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Introduce feature flag for smoldot dependency

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Rename chain-spec to chain-spec-pruning

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Update chain-spec command

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
tadeohepperle pushed a commit that referenced this pull request Nov 29, 2023
* cli: Add chainSpec command

Signed-off-by: Alexandru Vasile <[email protected]>

* cli/chainSpec: Move to dedicated module

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Compute the state root hash

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove code substitutes

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Update polkadot.json

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Generate the chain spec

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove testing artifacts

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Fix clippy

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Apply rustfmt

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Introduce feature flag for smoldot dependency

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Rename chain-spec to chain-spec-pruning

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Update chain-spec command

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
tadeohepperle added a commit that referenced this pull request Jan 11, 2024
* integrate scale-typegen, remove types mod

* reintroduce default substitutes and derives

* support runtime_types only again

* generating polkadot.rs ok

* update scale-typegen to discrete error types

* scale-typegen-api-changes

* add note about UncheckedExtrinsic in default substitutes

* add resursive attributes and derives

* adjust example where Clone bound recursive

* move scale-typegen dependency to workspace

* expose default typegen settings

* lightclient: Fix wasm socket closure called after being dropped (#1289)

* lightclient: Close wasm socket while dropping from connecting state

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Construct one time only closures

Signed-off-by: Alexandru Vasile <[email protected]>

* testing: Enable console logs for lightclient WASM testing

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Separate wakes and check connectivity on poll_read

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket depending on internal state

Signed-off-by: Alexandru Vasile <[email protected]>

* Revert "lightclient: Separate wakes and check connectivity on poll_read"

This reverts commit 8660940.

* lightclient: Return pending if socket is opening from poll_read

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket on `poll_close`

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reset closures on Drop to avoid recursive invokation

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket if not already closing

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* workflows: Install rustup component for building substrate (#1295)

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Command to fetch chainSpec and optimise its size (#1278)

* cli: Add chainSpec command

Signed-off-by: Alexandru Vasile <[email protected]>

* cli/chainSpec: Move to dedicated module

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Compute the state root hash

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove code substitutes

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Update polkadot.json

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Generate the chain spec

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove testing artifacts

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Fix clippy

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Apply rustfmt

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Introduce feature flag for smoldot dependency

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Rename chain-spec to chain-spec-pruning

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Update chain-spec command

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* remove comments and unused args

* Update substrate- and signer-related dependencies (#1297)

* update crypto dependencies, adjust keypair

* add scale_info::TypeInfo derive in some places

* add multi signature derive

* fix lock file

* fix lock file again :|

* adjust to new interface in scale-typegen

* use released scale typegen

* reintroduce type aliases

* introduce type aliases again using scale-typegen

* cargo fmt and clippy

* reconcile changes with master branch

* update polkadot.rs

* bump scale-typgen to fix substitution

* implemented Alex suggestions, regenerated polkadot.rs (did not change)

* resolve conflicts in Cargo.lock

* make expect messages more clear

* correct typos

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: Alexandru Vasile <[email protected]>
tadeohepperle added a commit that referenced this pull request Jan 19, 2024
…ale-typegen integration (#1290)

* restructure cli commands

* config: Add `SkipCheckIfFeeless` signed extension (#1264)

* config: Add `SkipCheckIfFeeless` signed extension

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Add extra extension to the default params

Signed-off-by: Alexandru Vasile <[email protected]>

* examples: Adjust signed extension example

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Extend SkipCheckIfFeeless with inner signed extension

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Configure SkipCheck with inner signed extension params

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Implement Deafult for SkipCheckIfFeelessParams with Option

Signed-off-by: Alexandru Vasile <[email protected]>

* examples: Fix example with proper extension

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Extend <T as Config>::AssetId with EncodeAsType and Clone

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Add SkipCheck with AssetTx

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Encode as type from metadata the inner signed extensions

Signed-off-by: Alexandru Vasile <[email protected]>

* Adjust examples

Signed-off-by: Alexandru Vasile <[email protected]>

* blocks: Use `SkipCheckIfFeeless` for decoding the tip of extensions

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Decode `SkipCheckIfFeeless` with `Self`

Signed-off-by: Alexandru Vasile <[email protected]>

* tests: Adjust testing

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Descriptive errors for building `SkipCheckIfFeeless`

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Add docs for extra error types

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Add extra derives to signed extensions

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Use `Default::default` to simplify type init

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Replace removed lint (#1270)

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Add support for multi-chain usecase (#1238)

* lightclient: Make `smoldot::chainID` part of the RPC requests

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Make `BackgroundTask` generic over `PlatformRef` and chain

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Construct from raw smoldot and target different chains

Signed-off-by: Alexandru Vasile <[email protected]>

* testing: Update cargo lock for wasm tests

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reuse `new_from_client` method and removed unused imports

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reexport smoldot client and RPC objects used in pub
interface

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Adjust `new_from_client` interface

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Extend background to poll over multiple RPC objects

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Build light client from raw and target different chains

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Add demo chain specs

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Move artifacts to dedicated folder

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Use SelectAll to drive all streams

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Fetch initial data from the target chain

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reexport other smoldot objects

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Target chain with potentially different config

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt/rpc: Log chainID for debugging

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt/examples: Add smoldot client with parachain example

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Propagate chain ID together with rpc responses object

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Multiplex responses by request ID and chain ID

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Add raw light client builder

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Add cargo feature flag for parachains example

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Derive default for internal structure

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Guard reexports by std feature flag

Signed-off-by: Alexandru Vasile <[email protected]>

* Update subxt/src/client/light_client/mod.rs

Co-authored-by: James Wilson <[email protected]>

* lightclient: Update the builder pattern and chain targetting

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Fix documentation

Signed-off-by: Alexandru Vasile <[email protected]>

* Provide more insightful docs wrt native/wasm panics

Signed-off-by: Alexandru Vasile <[email protected]>

* examples: Adjust comment location

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Refactor UniqueChainId into the background task

Signed-off-by: Alexandru Vasile <[email protected]>

* Update lightclient/src/background.rs

Co-authored-by: Niklas Adolfsson <[email protected]>

* Update subxt/src/client/light_client/builder.rs

Co-authored-by: James Wilson <[email protected]>

* lightclient: Update docs wrt panics

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Update docs wrt to smoldot instance -> client

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Use IntoIter instead of Iterator

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Adjsut docs wrt [`Self::new_from_client`]

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Remove RawRpc from LightClient in favor of chainID

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reexport everything under smoldot module

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Use stateRootHash instead of genesis.raw

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: James Wilson <[email protected]>
Co-authored-by: Niklas Adolfsson <[email protected]>

* Bump futures from 0.3.28 to 0.3.29 (#1272)

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.28 to 0.3.29.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](rust-lang/futures-rs@0.3.28...0.3.29)

---
updated-dependencies:
- dependency-name: futures
  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 zeroize from 1.6.0 to 1.7.0 (#1274)

Bumps [zeroize](https://github.com/RustCrypto/utils) from 1.6.0 to 1.7.0.
- [Commits](https://github.com/RustCrypto/utils/commits)

---
updated-dependencies:
- dependency-name: zeroize
  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>

* Bump tracing-subscriber from 0.3.17 to 0.3.18 (#1275)

Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](tokio-rs/tracing@tracing-subscriber-0.3.17...tracing-subscriber-0.3.18)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  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 tracing-subscriber from 0.3.17 to 0.3.18 (#1275)

Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](tokio-rs/tracing@tracing-subscriber-0.3.17...tracing-subscriber-0.3.18)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  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 getrandom from 0.2.10 to 0.2.11 (#1273)

Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.10 to 0.2.11.
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](rust-random/getrandom@v0.2.10...v0.2.11)

---
updated-dependencies:
- dependency-name: getrandom
  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>

* impl RpcClientT for Arc<T> and Box<T> (#1277)

* impl RpcClientT for Arc<WsClient>

* fix grumbles: impl for Box<T> and Arc<T>

* grumbles: move RpcClientT impls

* first iteration of using scale_typegen

* introduce indoc for formatting

* calls, constants and home are cleaner now

* added event subcommand

* show runtime apis working

* add better code formatting

* fix style

* adjust tests, use owo_colorize to not add extra dependency

* fmt

* adjust docs

* move scale-typegen-description dependency to workspace

* improve `substrate-compat` (#1265)

* improve `substrate-compat`

* From => Into

---------

Co-authored-by: James Wilson <[email protected]>

* Bump proc-macro2 from 1.0.69 to 1.0.70 (#1292)

Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.69 to 1.0.70.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](dtolnay/proc-macro2@1.0.69...1.0.70)

---
updated-dependencies:
- dependency-name: proc-macro2
  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.192 to 1.0.193 (#1291)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.192 to 1.0.193.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.192...v1.0.193)

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

* lightclient: Fix wasm socket closure called after being dropped (#1289)

* lightclient: Close wasm socket while dropping from connecting state

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Construct one time only closures

Signed-off-by: Alexandru Vasile <[email protected]>

* testing: Enable console logs for lightclient WASM testing

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Separate wakes and check connectivity on poll_read

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket depending on internal state

Signed-off-by: Alexandru Vasile <[email protected]>

* Revert "lightclient: Separate wakes and check connectivity on poll_read"

This reverts commit 8660940.

* lightclient: Return pending if socket is opening from poll_read

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket on `poll_close`

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reset closures on Drop to avoid recursive invokation

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket if not already closing

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* workflows: Install rustup component for building substrate (#1295)

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Command to fetch chainSpec and optimise its size (#1278)

* cli: Add chainSpec command

Signed-off-by: Alexandru Vasile <[email protected]>

* cli/chainSpec: Move to dedicated module

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Compute the state root hash

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove code substitutes

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Update polkadot.json

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Generate the chain spec

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove testing artifacts

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Fix clippy

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Apply rustfmt

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Introduce feature flag for smoldot dependency

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Rename chain-spec to chain-spec-pruning

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Update chain-spec command

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* update to new scale-typegen interfaces

* use released version of scale-typegen

* Merge branch 'master' into tadeohepperle/cli-support-runtime-apis

* remove unused debug file

* resolve merge errors

* adjustments

* constants file adjustment

* method renaming

* fix issue with encoding runtime api params

* Add logging to submit_transaction and unstable driver, and ensure unpin evs complete

* panic if None returned from subscription too, also with stats

* change panic to Err just to be on the safe side

* clippy

* make long tests run only after clippy + fmt pass

* megre in light client test change pr

* chore(subxt/src): typo fix (#1370)

* rpcmethods

* followstr

* mod and else

* Weekly Cronjob fetching artifacts and generating polkadot.rs file. (#1352)

* github CI action cronjob

* add commit message

* fix the CI yml files

* binary crate for CI script with substrate-runner

* update the CI script

* correct the artifacts script

* remove bash script

* lightclient(fix): Ensure lightclient chainSpec is at least one block old (#1372)

* testing(fix): Ensure lightclient chainSpec is at least one block old

Signed-off-by: Alexandru Vasile <[email protected]>

* Revert "testing(fix): Ensure lightclient chainSpec is at least one block old"

This reverts commit 0eafcb2.

* lightclient(fix): Ensure lightclient chainSpec is at least one block old

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Link smoldot issue

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Use tokio under lightclient feature flag

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Do not sleep on errors to fetch the chainSpec

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Remove test file

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Subscribe to two finalized blocks

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Revert cargo toml

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Reduce the light client timeout to 15 minutes (#1373)

* ci: Reduce the light client timpeut to 15 seconds

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Use ubuntu-latest for light-client tests

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* actually only wait for machete+fmt, clippy can be much slower

* update CI file from Alex PR

* resolve clippy err

* Try a few RPC nodes in case one of them is not working

* fix submit_transaction debug logging of message

* Improve Signed Extension and Block Decoding Examples/Book (#1357)

* asset hub example and book adjustment

* formatting

* recursive derives

* polkadot monitor example and book adjustments

* formatting

* adjust docs and examples, add dynamic example

* james suggestions

* fmt

* chore(subxt/src): typo fix (#1370)

* rpcmethods

* followstr

* mod and else

* Weekly Cronjob fetching artifacts and generating polkadot.rs file. (#1352)

* github CI action cronjob

* add commit message

* fix the CI yml files

* binary crate for CI script with substrate-runner

* update the CI script

* correct the artifacts script

* remove bash script

---------

Co-authored-by: James Wilson <[email protected]>
Co-authored-by: Pan chao <[email protected]>

* fix formatting of returned sections

* make storage use execute flag as well

---------

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: Niklas Adolfsson <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yjh <[email protected]>
Co-authored-by: Pan chao <[email protected]>
tadeohepperle added a commit that referenced this pull request Jan 22, 2024
* restructure cli commands

* config: Add `SkipCheckIfFeeless` signed extension (#1264)

* config: Add `SkipCheckIfFeeless` signed extension

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Add extra extension to the default params

Signed-off-by: Alexandru Vasile <[email protected]>

* examples: Adjust signed extension example

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Extend SkipCheckIfFeeless with inner signed extension

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Configure SkipCheck with inner signed extension params

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Implement Deafult for SkipCheckIfFeelessParams with Option

Signed-off-by: Alexandru Vasile <[email protected]>

* examples: Fix example with proper extension

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Extend <T as Config>::AssetId with EncodeAsType and Clone

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Add SkipCheck with AssetTx

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Encode as type from metadata the inner signed extensions

Signed-off-by: Alexandru Vasile <[email protected]>

* Adjust examples

Signed-off-by: Alexandru Vasile <[email protected]>

* blocks: Use `SkipCheckIfFeeless` for decoding the tip of extensions

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Decode `SkipCheckIfFeeless` with `Self`

Signed-off-by: Alexandru Vasile <[email protected]>

* tests: Adjust testing

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Descriptive errors for building `SkipCheckIfFeeless`

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Add docs for extra error types

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Add extra derives to signed extensions

Signed-off-by: Alexandru Vasile <[email protected]>

* config: Use `Default::default` to simplify type init

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Replace removed lint (#1270)

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Add support for multi-chain usecase (#1238)

* lightclient: Make `smoldot::chainID` part of the RPC requests

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Make `BackgroundTask` generic over `PlatformRef` and chain

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Construct from raw smoldot and target different chains

Signed-off-by: Alexandru Vasile <[email protected]>

* testing: Update cargo lock for wasm tests

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reuse `new_from_client` method and removed unused imports

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reexport smoldot client and RPC objects used in pub
interface

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Adjust `new_from_client` interface

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Extend background to poll over multiple RPC objects

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Build light client from raw and target different chains

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Add demo chain specs

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Move artifacts to dedicated folder

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Use SelectAll to drive all streams

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Fetch initial data from the target chain

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reexport other smoldot objects

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Target chain with potentially different config

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt/rpc: Log chainID for debugging

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt/examples: Add smoldot client with parachain example

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Propagate chain ID together with rpc responses object

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Multiplex responses by request ID and chain ID

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Add raw light client builder

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Add cargo feature flag for parachains example

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Derive default for internal structure

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Guard reexports by std feature flag

Signed-off-by: Alexandru Vasile <[email protected]>

* Update subxt/src/client/light_client/mod.rs

Co-authored-by: James Wilson <[email protected]>

* lightclient: Update the builder pattern and chain targetting

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Fix documentation

Signed-off-by: Alexandru Vasile <[email protected]>

* Provide more insightful docs wrt native/wasm panics

Signed-off-by: Alexandru Vasile <[email protected]>

* examples: Adjust comment location

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Refactor UniqueChainId into the background task

Signed-off-by: Alexandru Vasile <[email protected]>

* Update lightclient/src/background.rs

Co-authored-by: Niklas Adolfsson <[email protected]>

* Update subxt/src/client/light_client/builder.rs

Co-authored-by: James Wilson <[email protected]>

* lightclient: Update docs wrt panics

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Update docs wrt to smoldot instance -> client

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Use IntoIter instead of Iterator

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Adjsut docs wrt [`Self::new_from_client`]

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Remove RawRpc from LightClient in favor of chainID

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reexport everything under smoldot module

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Use stateRootHash instead of genesis.raw

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: James Wilson <[email protected]>
Co-authored-by: Niklas Adolfsson <[email protected]>

* Bump futures from 0.3.28 to 0.3.29 (#1272)

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.28 to 0.3.29.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](rust-lang/futures-rs@0.3.28...0.3.29)

---
updated-dependencies:
- dependency-name: futures
  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 zeroize from 1.6.0 to 1.7.0 (#1274)

Bumps [zeroize](https://github.com/RustCrypto/utils) from 1.6.0 to 1.7.0.
- [Commits](https://github.com/RustCrypto/utils/commits)

---
updated-dependencies:
- dependency-name: zeroize
  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>

* Bump tracing-subscriber from 0.3.17 to 0.3.18 (#1275)

Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](tokio-rs/tracing@tracing-subscriber-0.3.17...tracing-subscriber-0.3.18)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  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 tracing-subscriber from 0.3.17 to 0.3.18 (#1275)

Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](tokio-rs/tracing@tracing-subscriber-0.3.17...tracing-subscriber-0.3.18)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  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 getrandom from 0.2.10 to 0.2.11 (#1273)

Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.10 to 0.2.11.
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](rust-random/getrandom@v0.2.10...v0.2.11)

---
updated-dependencies:
- dependency-name: getrandom
  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>

* impl RpcClientT for Arc<T> and Box<T> (#1277)

* impl RpcClientT for Arc<WsClient>

* fix grumbles: impl for Box<T> and Arc<T>

* grumbles: move RpcClientT impls

* first iteration of using scale_typegen

* introduce indoc for formatting

* calls, constants and home are cleaner now

* added event subcommand

* show runtime apis working

* add better code formatting

* fix style

* adjust tests, use owo_colorize to not add extra dependency

* fmt

* adjust docs

* move scale-typegen-description dependency to workspace

* improve `substrate-compat` (#1265)

* improve `substrate-compat`

* From => Into

---------

Co-authored-by: James Wilson <[email protected]>

* Bump proc-macro2 from 1.0.69 to 1.0.70 (#1292)

Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.69 to 1.0.70.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](dtolnay/proc-macro2@1.0.69...1.0.70)

---
updated-dependencies:
- dependency-name: proc-macro2
  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.192 to 1.0.193 (#1291)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.192 to 1.0.193.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.192...v1.0.193)

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

* lightclient: Fix wasm socket closure called after being dropped (#1289)

* lightclient: Close wasm socket while dropping from connecting state

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Construct one time only closures

Signed-off-by: Alexandru Vasile <[email protected]>

* testing: Enable console logs for lightclient WASM testing

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Separate wakes and check connectivity on poll_read

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket depending on internal state

Signed-off-by: Alexandru Vasile <[email protected]>

* Revert "lightclient: Separate wakes and check connectivity on poll_read"

This reverts commit 8660940.

* lightclient: Return pending if socket is opening from poll_read

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket on `poll_close`

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reset closures on Drop to avoid recursive invokation

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket if not already closing

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* workflows: Install rustup component for building substrate (#1295)

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Command to fetch chainSpec and optimise its size (#1278)

* cli: Add chainSpec command

Signed-off-by: Alexandru Vasile <[email protected]>

* cli/chainSpec: Move to dedicated module

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Compute the state root hash

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove code substitutes

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Update polkadot.json

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Generate the chain spec

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove testing artifacts

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Fix clippy

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Apply rustfmt

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Introduce feature flag for smoldot dependency

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Rename chain-spec to chain-spec-pruning

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Update chain-spec command

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* update to new scale-typegen interfaces

* use released version of scale-typegen

* Merge branch 'master' into tadeohepperle/cli-support-runtime-apis

* remove unused debug file

* resolve merge errors

* adjustments

* constants file adjustment

* method renaming

* fix issue with encoding runtime api params

* Add logging to submit_transaction and unstable driver, and ensure unpin evs complete

* panic if None returned from subscription too, also with stats

* change panic to Err just to be on the safe side

* clippy

* make long tests run only after clippy + fmt pass

* megre in light client test change pr

* chore(subxt/src): typo fix (#1370)

* rpcmethods

* followstr

* mod and else

* Weekly Cronjob fetching artifacts and generating polkadot.rs file. (#1352)

* github CI action cronjob

* add commit message

* fix the CI yml files

* binary crate for CI script with substrate-runner

* update the CI script

* correct the artifacts script

* remove bash script

* lightclient(fix): Ensure lightclient chainSpec is at least one block old (#1372)

* testing(fix): Ensure lightclient chainSpec is at least one block old

Signed-off-by: Alexandru Vasile <[email protected]>

* Revert "testing(fix): Ensure lightclient chainSpec is at least one block old"

This reverts commit 0eafcb2.

* lightclient(fix): Ensure lightclient chainSpec is at least one block old

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Link smoldot issue

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Use tokio under lightclient feature flag

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Do not sleep on errors to fetch the chainSpec

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Remove test file

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Subscribe to two finalized blocks

Signed-off-by: Alexandru Vasile <[email protected]>

* subxt: Revert cargo toml

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Reduce the light client timeout to 15 minutes (#1373)

* ci: Reduce the light client timpeut to 15 seconds

Signed-off-by: Alexandru Vasile <[email protected]>

* ci: Use ubuntu-latest for light-client tests

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* actually only wait for machete+fmt, clippy can be much slower

* update CI file from Alex PR

* resolve clippy err

* Try a few RPC nodes in case one of them is not working

* fix submit_transaction debug logging of message

* Improve Signed Extension and Block Decoding Examples/Book (#1357)

* asset hub example and book adjustment

* formatting

* recursive derives

* polkadot monitor example and book adjustments

* formatting

* adjust docs and examples, add dynamic example

* james suggestions

* fmt

* chore(subxt/src): typo fix (#1370)

* rpcmethods

* followstr

* mod and else

* Weekly Cronjob fetching artifacts and generating polkadot.rs file. (#1352)

* github CI action cronjob

* add commit message

* fix the CI yml files

* binary crate for CI script with substrate-runner

* update the CI script

* correct the artifacts script

* remove bash script

---------

Co-authored-by: James Wilson <[email protected]>
Co-authored-by: Pan chao <[email protected]>

* fix formatting of returned sections

* add recursive derive and attribute options in the cli

* format tuples uncaught

* add tests and rename type map parser

* make parsing more strict

---------

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: Niklas Adolfsson <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yjh <[email protected]>
Co-authored-by: Pan chao <[email protected]>
tadeohepperle added a commit that referenced this pull request Jan 23, 2024
* integrate scale-typegen, remove types mod

* reintroduce default substitutes and derives

* support runtime_types only again

* generating polkadot.rs ok

* update scale-typegen to discrete error types

* scale-typegen-api-changes

* add note about UncheckedExtrinsic in default substitutes

* add resursive attributes and derives

* adjust example where Clone bound recursive

* move scale-typegen dependency to workspace

* expose default typegen settings

* lightclient: Fix wasm socket closure called after being dropped (#1289)

* lightclient: Close wasm socket while dropping from connecting state

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Construct one time only closures

Signed-off-by: Alexandru Vasile <[email protected]>

* testing: Enable console logs for lightclient WASM testing

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Separate wakes and check connectivity on poll_read

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket depending on internal state

Signed-off-by: Alexandru Vasile <[email protected]>

* Revert "lightclient: Separate wakes and check connectivity on poll_read"

This reverts commit 8660940.

* lightclient: Return pending if socket is opening from poll_read

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket on `poll_close`

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Reset closures on Drop to avoid recursive invokation

Signed-off-by: Alexandru Vasile <[email protected]>

* lightclient: Close the socket if not already closing

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* workflows: Install rustup component for building substrate (#1295)

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Command to fetch chainSpec and optimise its size (#1278)

* cli: Add chainSpec command

Signed-off-by: Alexandru Vasile <[email protected]>

* cli/chainSpec: Move to dedicated module

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Compute the state root hash

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove code substitutes

Signed-off-by: Alexandru Vasile <[email protected]>

* artifacts: Update polkadot.json

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Generate the chain spec

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Remove testing artifacts

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Fix clippy

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Apply rustfmt

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Introduce feature flag for smoldot dependency

Signed-off-by: Alexandru Vasile <[email protected]>

* cli: Rename chain-spec to chain-spec-pruning

Signed-off-by: Alexandru Vasile <[email protected]>

* scripts: Update chain-spec command

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>

* remove comments and unused args

* Update substrate- and signer-related dependencies (#1297)

* update crypto dependencies, adjust keypair

* add scale_info::TypeInfo derive in some places

* add multi signature derive

* fix lock file

* fix lock file again :|

* adjust to new interface in scale-typegen

* use released scale typegen

* reintroduce type aliases

* introduce type aliases again using scale-typegen

* cargo fmt and clippy

* reconcile changes with master branch

* update polkadot.rs

* bump scale-typgen to fix substitution

* subxt macro, helpful error messages

* adjust ui tests

* fix lock file

* format

* Update macro/src/lib.rs

Co-authored-by: Niklas Adolfsson <[email protected]>

* incorperate nits

* update Cargo.lock to avoid compatibility issues

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: Alexandru Vasile <[email protected]>
Co-authored-by: Niklas Adolfsson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cli: Command to fetch chainSpec and optimise its size
3 participants