Commit Graph

93 Commits

Author SHA1 Message Date
Niklas Adolfsson a97a6f2095 rpc: add rpc v2 chainSpec to polkadot (#2859)
The [chainSpec RPC API from the v2
spec](https://paritytech.github.io/json-rpc-interface-spec/api/chainSpec.html)
was only added to substrate-node and should be added to polkadot as well

/cc @lexnv
2024-01-08 13:35:12 +01:00
dependabot[bot] 6ff50526a7 Bump toml from 0.7.6 to 0.8.2 (#2685)
Bumps [toml](https://github.com/toml-rs/toml) from 0.7.6 to 0.8.2.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/toml-rs/toml/commit/fe65b2bfa2021b939a0fc71e8b008609ea21f6fe"><code>fe65b2b</code></a>
chore: Release</li>
<li><a
href="https://github.com/toml-rs/toml/commit/ed597ebad11afdadc27712e3f851e6c5cd48fb51"><code>ed597eb</code></a>
chore: Release</li>
<li><a
href="https://github.com/toml-rs/toml/commit/257a0fdc59656c01bcce151af61339563fac22c4"><code>257a0fd</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/toml-rs/toml/commit/4b44f53a3194729317250232872584464ebe12a7"><code>4b44f53</code></a>
Merge pull request <a
href="https://redirect.github.com/toml-rs/toml/issues/617">#617</a> from
epage/update</li>
<li><a
href="https://github.com/toml-rs/toml/commit/7eaf2861106430833eb40e7b237fe5522be6bb03"><code>7eaf286</code></a>
fix(parser): Failed on mixed inline tables</li>
<li><a
href="https://github.com/toml-rs/toml/commit/e1f20378a2a8c78f182b2ac61f76eebd30990b77"><code>e1f2037</code></a>
test: Verify with latest data</li>
<li><a
href="https://github.com/toml-rs/toml/commit/2f9253c9eb6c968be8227284b873660bd3451007"><code>2f9253c</code></a>
chore: Update toml-test</li>
<li><a
href="https://github.com/toml-rs/toml/commit/c9b481cab5038e9801e60f6bfb935f983218d8f6"><code>c9b481c</code></a>
test(toml): Ensure tables are used for validation</li>
<li><a
href="https://github.com/toml-rs/toml/commit/43d7f29cfdad91bb72658d94039b16e7457a54ed"><code>43d7f29</code></a>
Merge pull request <a
href="https://redirect.github.com/toml-rs/toml/issues/615">#615</a> from
toml-rs/renovate/actions-checkout-4.x</li>
<li><a
href="https://github.com/toml-rs/toml/commit/ef9b8372c86f84481e8439c9c4a1f5dc4c15c35e"><code>ef9b837</code></a>
chore(deps): update actions/checkout action to v4</li>
<li>Additional commits viewable in <a
href="https://github.com/toml-rs/toml/compare/toml-v0.7.6...toml-v0.8.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=toml&package-manager=cargo&previous-version=0.7.6&new-version=0.8.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 14:29:14 +00:00
Squirrel be8e626806 Set clippy lints in workspace (requires rust 1.74) (#2390)
We currently use a bit of a hack in `.cargo/config` to make sure that
clippy isn't too annoying by specifying the list of lints.

There is now a stable way to define lints for a workspace. The only down
side is that every crate seems to have to opt into this so there's a
*few* files modified in this PR.

Dependencies:

- [x] PR that upgrades CI to use rust 1.74 is merged.

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
2023-12-13 15:11:07 +01:00
Koute f01781a902 Remove wasm-builder's README (#2525)
Followup of https://github.com/paritytech/polkadot-sdk/pull/2217

This PR deletes the README of the `wasm-builder` crate and moves its
docs back into the rustdoc, [as requested
here](https://github.com/paritytech/polkadot-sdk/pull/2217#discussion_r1406401175).
(:
2023-11-28 14:30:02 +01:00
Koute 2610450a18 Build the standard library crates when building the runtimes (#2217)
Our executor currently only supports the WASM MVP feature set, however
nowadays when compiling WASM the Rust compiler has more features enabled
by default.

We do set the `-C target-cpu=mvp` flag to make sure that *our* code gets
compiled in a way that is compatible with our executor, however this
doesn't affect Rust's standard library crates (`std`, `core` and
`alloc`) which are by default precompiled and still can make use of
these extra features.

So in this PR we force the compiler to also compile the standard library
crates for us to make sure that they also only use the MVP features.

I've added the `WASM_BUILD_STD` environment variable which can be used
to disable this behavior if set to `0`.

Unfortunately this *will* slow down the compile times when building
runtimes, but there isn't much that we can do about that.

Fixes https://github.com/paritytech/polkadot-sdk/issues/1755

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-11-27 12:40:27 +02:00
Bastian Köcher 604704a84c wasm-builder: Optimize rerun-if-changed logic (#2282)
Optimizes the `rerun-if-changed` logic by ignoring `dev-dependencies`
and also not outputting paths. Because outputting paths could lead to
include unwanted crates in the rerun checks.
2023-11-13 13:57:52 +01:00
Liam Aharon ff3a3bca44 Small optimisation to --profile dev wasm builds (#1851)
`wasm-builder` was adjusted to default to building wasm blobs in
`release` mode even when cargo is in `debug` because `debug` wasm is too
slow.

A side effect of this was `.compact` and `.compact.compressed` getting
built when the dev is running build in `debug`, adding ~5s to the build
time of every wasm runtime.

I think it's reasonable to assume if the dev is running `debug` build
they want to optimise speed and do not care about the size of the wasm
binary. Compacting a blob has negligible impact on its actual
performance.

In this PR, I adjusted the behavior of the wasm builder so it does not
produce `.compact` or `.compact.compressed` wasm when the user is
running in `debug`. The builder will continue to produce the bloaty wasm
in release mode unless it is overriden with an env var.

As suggested by @koute in review, also refactored the
`maybe_compact_wasm_and_copy_blobs` into multiple funuctions, and
renamed things to better support RISC-V in the future.

---

There is no `T-runtime` label so @KiChjang told me to put `T1-FRAME` :)

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
2023-10-25 11:02:13 +11:00
Brian Anderson 39c04fdd96 Update wasm-opt to 0.116 (#1995)
Just keeping wasm-opt up to date.

I don't see anything in the [binaryen
changelog](https://github.com/WebAssembly/binaryen/blob/main/CHANGELOG.md)
that should affect substrate.

This release includes dwarf passes that were accidentally omitted from
previous versions of the wasm-opt crate. I suspect this will not affect
substrate as their omission hasn't been noticed until recently.
2023-10-24 12:52:30 +09:00
aj3n 38c3c62588 wasm-builder: manually set CARGO_TARGET_DIR (#1951)
✄
-----------------------------------------------------------------------------

Thank you for your Pull Request! 🙏 Please make sure it follows the
contribution guidelines outlined in
[this
document](https://github.com/paritytech/polkadot-sdk/blob/master/docs/CONTRIBUTING.md)
and fill
out the sections below. Once you're ready to submit your PR for review,
please
delete this section and leave only the text under the "Description"
heading.

# Description

*Please include a summary of the changes and the related issue. Please
also include relevant motivation and context,
including:*

- What does this PR do?

make 'substrate-wasm-builder' manually set 'CARGO_TARGET_DIR' to
'$project_dir/target' while building instead of unset
'CARGO_TARGET_DIR';

- Why are these changes needed?

If you using this in the `build.rs` with following content in your
`~/.cargo/config.toml':

    [build]
    target-dir = "target"

the build process will stuck because of dead lock -- two `cargo build`
on same target directory in the same time.
There is already an attempt to avoid such dead lock by unset the
`CARGO_TARGET_DIR`, but for users with config above in his build
enviroment (like me), this workaround won't work.

- How were these changes implemented and what do they affect?

Instead of unset 'CARGO_TARGET_DIR', we set 'CARGO_TARGET_DIR' to
'$project/target/', which is already assumed to be true by rest of the
code.

*Use [Github semantic

linking](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)
to address any open issues this PR relates to or closes.*

Fixes # (issue number, *if applicable*)

Closes # (issue number, *if applicable*)

# Checklist

- [x] My PR includes a detailed description as outlined in the
"Description" section above
- [ ] My PR follows the [labeling requirements](CONTRIBUTING.md#Process)
of this project (at minimum one label for `T`
  required)
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works (if applicable)

You can remove the "Checklist" section once all have been checked. Thank
you for your contribution!

✄
-----------------------------------------------------------------------------

I have built my project with this fix, there's still some warnings with
`build.target-dir` set but the building process won't hang.
I haven't found related issue in this repo. But I did find one issue
[here](https://github.com/substrate-developer-hub/substrate-node-template/issues/116).
2023-10-23 11:54:06 +02:00
Bastian Köcher f1994c8690 wasm-builder: Disable building when running on docs.rs (#1540)
This pull request changes the `wasm-builder` to skip building the wasm
files when the build process is running on docs.rs.
2023-09-13 21:53:05 +02:00
Chevdor a30092ab42 Markdown linter (#1309)
* Add markdown linting

- add linter default rules
- adapt rules to current code
- fix the code for linting to pass
- add CI check

fix #1243

* Fix markdown for Substrate
* Fix tooling install
* Fix workflow
* Add documentation
* Remove trailing spaces
* Update .github/.markdownlint.yaml

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix mangled markdown/lists
* Fix captalization issues on known words
2023-09-04 12:02:32 +03:00
Oliver Tale-Yazdi dcda0e50f5 Fix build profiles (#1229)
* Fix build profiles

Closes https://github.com/paritytech/polkadot-sdk/issues/1155

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Manually set version to 1.0.0

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use workspace repo

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* 'Authors and Edition from workspace

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-08-29 13:39:41 +02:00
alvicsam f441a5fc93 Diener workspacify
Signed-off-by: alvicsam <alvicsam@gmail.com>
2023-08-25 11:05:17 +02:00
Brian Anderson d160818a9f Update wasm-opt to 0.114 (#14695) 2023-08-16 12:05:47 +02:00
Arkadiy Paronyan d6d9bd9ea3 Encryption support for the statement store (#14440)
* Added ECIES encryption

* tweaks

* fmt

* Make clippy happy

* Use local keystore

* qed
2023-07-17 18:41:41 +00:00
Bastian Köcher 42243fb346 wasm-builder: Make hash and date optional (#14490)
* wasm-builder: Make `hash` and `date` optional

Apparently there are installations where the `hash` and `date` is optional.

Closes: https://github.com/paritytech/substrate/issues/14335

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
2023-07-03 09:58:42 +00:00
Bastian Köcher 83caca85b6 frame-benchmarking-cli: Remove native dispatch requirement (#14474)
* frame-benchmarking-cli: Remove native dispatch requirement

No need for this, we can just use the `WasmExecutor` directly.

* Fixes

* Pass benchmarking host functions

* Ensure we can pass custom host functions
2023-06-29 17:56:25 +02:00
Bastian Köcher 6947b334b4 wasm-builder: Enforce runtime_version wasm section (#14228)
* wasm-builder: Enforce `runtime_version` wasm section

This pr changes the `wasm-builder` to enforce the `runtime_version` wasm section. This wasm section
is being created by the `sp_version::runtime_version` attribute macro. This attribute macro now
exists since quite some time and `runtime_version` also is the only way for parachains to support
reading the `RuntimeVersion` from the runtime.

\# Disabling the check

By default the `WasmBuilder` will now check for this wasm section and if not found, exit with an
error. However, there are situations where you may want to disable this check (like for tests). In
this case there exists the `disable_runtime_version_section_check` function.

```
WasmBuilder::new()
   ...
   ...
   ...
   .disable_runtime_version_section_check()
   .build()
```

By using this method you get back the old behavior.

* Review comment

* Fix

* Fix issue with `enum-as-inner`
2023-05-28 23:52:10 +00:00
Brian Anderson 4be32b174b Upgrade wasm-opt to 0.112.0 (#13574)
Co-authored-by: parity-processbot <>
2023-05-05 08:10:34 +00:00
dependabot[bot] 890a65b87d Bump cargo_metadata from 0.15.3 to 0.15.4 (#13899)
Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from 0.15.3 to 0.15.4.
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/0.15.3...0.15.4)

---
updated-dependencies:
- dependency-name: cargo_metadata
  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-04-14 14:52:51 +02:00
dependabot[bot] 46e2d3e5f8 Bump toml from 0.5.11 to 0.7.3 (#13619)
Bumps [toml](https://github.com/toml-rs/toml) from 0.5.11 to 0.7.3.
- [Release notes](https://github.com/toml-rs/toml/releases)
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.11...toml-v0.7.3)

---
updated-dependencies:
- dependency-name: toml
  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-04-13 11:30:42 +02:00
Koute 795fcf0484 Disable sign-ext WASM feature when building runtimes (#13804)
Co-authored-by: parity-processbot <>
2023-04-03 12:00:31 +00:00
Alexander Theißen 25a616ce08 Build wasm for mvp cpu (#13758) 2023-03-30 16:20:12 +02:00
Bastian Köcher d338e9a114 Support stable rust for compiling the runtime (#13580)
* Support stable rust for compiling the runtime

This pull request brings support for compiling the runtime with stable Rust. This requires at least
rust 1.68.0 to work on stable. The code is written in a way that it is backwards compatible and
should automatically work when someone compiles with 1.68.0+ stable.

* We always support nightlies!

* 🤦

* Sort by version

* Review feedback

* Review feedback

* Fix version parsing

* Apply suggestions from code review

Co-authored-by: Koute <koute@users.noreply.github.com>

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
2023-03-29 07:17:50 +00:00
Vivek Pandya bc53b9a03a Remove years from copyright notes. (#13415)
* Change copyright year to 2023 from 2022

* Fix incorrect update of copyright year

* Remove years from copy right header

* Fix remaining files

* Fix typo in a header and remove update-copyright.sh
2023-02-21 18:46:41 +00:00
Koute 44cbf303c4 Bump wasmtime to 5.0.0 (and a few other deps) (#13160)
* Bump `wasmtime` to 4.0.0 (and a few other deps)

* Use `Error::msg` instead of `anyhow!`

* Bump `wasmtime` to 5.0.0

* Update `Cargo.lock`

* Add `wasmtime` feature to `sp-wasm-interface` dependency
2023-02-06 15:40:50 +00:00
Brian Anderson 545de88c47 Upgrade wasm-opt to 0.111.0 (#13038) 2023-01-24 18:21:52 +00:00
Nazar Mokrynskyi dccef86edb Only use substrate-wasm-builder when std feature is enabled. (#12790)
Co-authored-by: parity-processbot <>
2023-01-06 10:24:12 +00:00
Bastian Köcher c0c8d6305f Fixup some wrong dependencies (#12899)
* Fixup some wrong dependencies

Dev dependencies should not appear in the feature list. If features are required, they should be
directly enabled for the `dev-dependency`.

* More fixups

* Fix fix

* Remove deprecated feature

* Make all work properly and nice!!

* FMT

* Fix formatting
2022-12-13 22:47:51 +01:00
João Paulo Silva de Souza 8751f88fc7 Implement crate publishing on CI (#12768)
* implement crate publishing from CI

* fix indentation

* use resource_group for job exclusivity

ensure that at most one instance of the publish-crates job is running at any given time to prevent race conditions

* correct publish = false

* Remove YAML anchors as GitLab's `extends:` doesn't need it

* Temporarily force cache upload for the new jobs

* Revert `RUSTY_CACHIER_FORCE_UPLOAD`

* pin libp2p-tcp=0.37.0 for sc-telemetry

* Revert "pin libp2p-tcp=0.37.0 for sc-telemetry"

This reverts commit 29146bfad6c31e8cf0e2f17ad92a71bb81a373af.

* always collect generated crates

* increase timeout for publish-crates-template

* Force upload the new job cache again

* Revert "Force upload the new job cache again"

This reverts commit 5a5feee1b2c51fdef768b25a76be4c3949ec1c99.

* reformat

* improve timeout explanation

* s/usual/average

Co-authored-by: Vladimir Istyufeev <vladimir@parity.io>
2022-12-07 18:08:48 +00:00
Alexander Theißen 9c748c74de WIP: Replace wasm-gc with wasm-opt (#12280)
* Use wasm-opt on runtime

* Optimize for size

* Simplify fn compact_wasm_file

* Run a lighter pass for non production builds

* Disable optimizations and keep name section

* Update wasm-opt

* Remove dward sections

* Update wasm-opt

* Update wasm-opt
2022-10-30 10:09:47 +00:00
Nikos Kontakis 103f770e75 Rename node-runtime to node-kitchensink-runtime (#11930)
* Rename node=runtime to kithensink-runtime

* Undo md formatting
2022-08-02 15:25:52 +00:00
Qinxuan Chen 16ef0cee93 Pruned duplicated dependencies (#11900)
* Update comfy-table v5.0.1 => v6.0.0

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update strum v0.23.0 => v0.24.1

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update h2 v0.3.9 => v0.3.13

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update file-per-thread-logger v0.1.4 => v0.1.5

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update mio v0.8.0 => v0.8.4

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* revert twox-hash

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update secp256k1 v0.21.2 => v0.24.0

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2022-07-25 16:52:11 +00:00
Sebastian Kunert 10e966e643 Respect cargo offline env variable in wasm builder (#11735)
* Support offline env variable in wasm builder

* Clean up

* Improve checks

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update crate docs

* Add docs to `lib.rs` and introduce helper method `offline_build`

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-06-22 15:27:46 +00:00
Bastian Köcher d70d58922e wasm-builder: Fix constant re-running of build.rs scripts. (#11624)
Recently we added the wasm binaries to the `rerun-if-changed` list. The problem with that is that
they have a later mtime than the `invoked.timestamp` file and this file's mtime is used to determine
if the `build.rs` script needs to be re-run. The solution to this is that we copy the mtime of this
`invoked.timestamp` file and add it to the wasm binaries. Then cargo/rustc doesn't constantly wants
to rerun the `build.rs` script.
2022-06-14 11:21:44 +02:00
Bastian Köcher 3935f6a987 wasm-builder: Rerun the build if the generated file changed (#11582) 2022-06-02 18:48:48 +02:00
Shawn Tabrizi 7d5202341b Basic TOML Lint (#11348)
* basic lint

* lint ordering
2022-05-04 13:38:54 +00:00
Falco Hirschenberger b581604aa7 Apply some clippy lints (#11154)
* Apply some clippy hints

* Revert clippy ci changes

* Update client/cli/src/commands/generate.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/cli/src/commands/inspect_key.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/db/src/bench.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/db/src/bench.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/service/src/client/block_rules.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/service/src/client/block_rules.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/network/src/transactions.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/network/src/protocol.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Revert due to missing `or_default` function.

* Fix compilation and simplify code

* Undo change that corrupts benchmark.

* fix clippy

* Update client/service/test/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/state-db/src/noncanonical.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/state-db/src/noncanonical.rs

remove leftovers!

* Update client/tracing/src/logging/directives.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update utils/fork-tree/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* added needed ref

* Update frame/referenda/src/benchmarking.rs

* Simplify byte-vec creation

* let's just not overlap the ranges

* Correction

* cargo fmt

* Update utils/frame/benchmarking-cli/src/shared/stats.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update utils/frame/benchmarking-cli/src/pallet/command.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update utils/frame/benchmarking-cli/src/pallet/command.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Giles Cope <gilescope@gmail.com>
2022-04-30 21:28:27 +00:00
dependabot[bot] 5985697ded Bump cargo_metadata from 0.14.1 to 0.14.2 (#11066)
Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from 0.14.1 to 0.14.2.
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/0.14.1...0.14.2)

---
updated-dependencies:
- dependency-name: cargo_metadata
  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>
2022-03-19 21:07:18 +00:00
Bastian Köcher 47622d6912 wasm-builder: Support latest nightly (#10837)
* wasm-builder: Support latest nightly

With latest nightly, aka rust version 1.60+ namespaced features are added. This changes the handling
of optional dependencies. We currently have features that enable optional dependencies when `std` is
enabled. This was before no problem, but now the wasm-builder detects them as enabled. To support
the transition period until 1.60 is released as stable, this pr adds an heuristic to not enable these
optional crates in the wasm build when they are enabled in the `std` feature. This heuristic fails
when someones enables these optional dependencies from the outside as well as via the `std` feature,
however we hope that no one is doing this at the moment. When namespaced features are enabled, these
dependencies needs to be enabled using `dep:dependency-name` to solve this properly.

https://doc.rust-lang.org/cargo/reference/unstable.html#namespaced-features

* Remove accidentally added features
2022-02-14 21:12:48 +01:00
Alexander Theißen d1f490f454 wasm-builder: Fall back to release profile for unknown profiles (#10775) 2022-02-02 12:34:52 +01:00
Alexander Theißen f3168c3fa0 Add production profile to substrate-wasm-builder (#10747)
* Add production profile to wasm builder

* Fix profile detection

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Replace panic! by println! + exit

* Default to `release` for wasm on debug builds

* Replaced unwrap by expect

* Update all weights

Rerun on the bm2 server.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Parity Bot <admin@parity.io>
2022-01-31 14:16:26 +00:00
Bastian Köcher 3c3ad00412 wasm-builder: Enable all features when running cargo metadata (#10716)
This is required for projects like Cumulus that have dependencies on `westend-runtime`, but this
runtime is only added when the `runtime-benchmarks` feature is enabled. By having all features
"enabled" in `cargo metadata` we ensure that all crates can be found.
2022-01-22 21:15:28 +01:00
Bastian Köcher f41ef340e5 wasm-builder: Improve workspace handling (#10700)
When building a wasm binary from a different repo inside a local workspace, we did not used the
correct `Cargo.toml` to find the correct patches and features. The solution to this is to just walk
up from the target directory until we find the workspace we are currently compiling. If this
heuristic isn't working, we print a warning and let the user set an env variable
`WASM_BUILD_WORKSPACE_HINT` to tell the `wasm-builder` where the actual workspace is.
2022-01-21 16:43:21 +00:00
Bastian Köcher f3662b4bba Happy new year 2022 (#10573) 2022-01-03 09:22:14 +01:00
MOZGIII 6e424d74ff Set current dir at check_wasm_toolchain_installed at wasm-builder (#10284)
* Set current dir at check_wasm_toolchain_installed

* Add comments
2021-11-18 09:05:48 +00:00
dependabot[bot] 101366a351 Bump cargo_metadata from 0.13.1 to 0.14.1 (#10255)
Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from 0.13.1 to 0.14.1.
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/v0.13.1...0.14.1)

---
updated-dependencies:
- dependency-name: cargo_metadata
  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>
2021-11-13 21:27:46 +01:00
Benjamin Kampmann 2168a6d0c9 Intend to reactivate cargo-unleash check (#10167)
* Intend to reactivate cargo-unleash check

It appears the bug it was deactivated for has been resolved a while ago. Trying to reactivate the checks.

* adding missing cargo.toml metadata for BEEFY crates

* fix wrong version reference

* matching up versions

* disable faulty cache

* switching more versions to prerelease

* Revert "disable faulty cache"

This reverts commit 411a12ae444a9695a8bfea4458a868438d870b06.

* bump minor of sc-allocator to fix already-published-issue

* fixup another pre-released dependency problem

* temp switch to latest unleash

* fixing dependency version and features

* prometheus endpoint has also been changed

* fixing proposer metrics versioning

* fixing hex feature for beefy

* fix generate-bags feature selection

* fixup Cargo.lock

* upgrade prometheus dependencies

* missed one

* switch to latest release
2021-11-10 17:30:24 +01:00
zjb0807 617e2cc75e Upgrade wasm builder (#10226)
* add TypeInfo for DispatchTime

* upgrade wasm-builder to Rust 2021

* remove resolver

* revert resolver in virtual workspace
2021-11-10 08:03:52 +00:00
Bastian Köcher b08d3017a8 Switch to Rust 2021 (#10170)
* Switch to Rust 2021

* Update trybuild to fix errors
2021-11-04 19:54:48 +01:00