Skip to content
  1. Jul 17, 2023
  2. Jul 03, 2023
  3. Jun 29, 2023
  4. May 28, 2023
    • Bastian Köcher's avatar
      wasm-builder: Enforce `runtime_version` wasm section (#14228) · 6947b334
      Bastian Köcher authored
      * 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`
      6947b334
  5. Apr 03, 2023
  6. Mar 30, 2023
  7. Mar 29, 2023
    • Bastian Köcher's avatar
      Support stable rust for compiling the runtime (#13580) · d338e9a1
      Bastian Köcher authored
      * 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: default avatarKoute <[email protected]>
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      d338e9a1
  8. Feb 21, 2023
    • Vivek Pandya's avatar
      Remove years from copyright notes. (#13415) · bc53b9a0
      Vivek Pandya authored
      * 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
      bc53b9a0
  9. Dec 13, 2022
    • Bastian Köcher's avatar
      Fixup some wrong dependencies (#12899) · c0c8d630
      Bastian Köcher authored
      * 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
      c0c8d630
  10. Dec 07, 2022
    • João Paulo Silva de Souza's avatar
      Implement crate publishing on CI (#12768) · 8751f88f
      João Paulo Silva de Souza authored
      
      
      * 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's avatarVladimir Istyufeev <[email protected]>
      8751f88f
  11. Oct 30, 2022
    • Alexander Theißen's avatar
      WIP: Replace `wasm-gc` with `wasm-opt` (#12280) · 9c748c74
      Alexander Theißen authored
      * 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
      9c748c74
  12. Aug 02, 2022
  13. Jun 22, 2022
  14. Jun 14, 2022
    • Bastian Köcher's avatar
      wasm-builder: Fix constant re-running of `build.rs` scripts. (#11624) · d70d5892
      Bastian Köcher authored
      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.
      d70d5892
  15. Jun 02, 2022
  16. Apr 30, 2022
  17. Feb 14, 2022
    • Bastian Köcher's avatar
      wasm-builder: Support latest nightly (#10837) · 47622d69
      Bastian Köcher authored
      * 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
      47622d69
  18. Feb 02, 2022
  19. Jan 31, 2022
  20. Jan 22, 2022
  21. Jan 21, 2022
    • Bastian Köcher's avatar
      wasm-builder: Improve workspace handling (#10700) · f41ef340
      Bastian Köcher authored
      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.
      f41ef340
  22. Jan 03, 2022
  23. Nov 18, 2021
  24. Nov 10, 2021
    • zjb0807's avatar
      Upgrade wasm builder (#10226) · 617e2cc7
      zjb0807 authored
      * add TypeInfo for DispatchTime
      
      * upgrade wasm-builder to Rust 2021
      
      * remove resolver
      
      * revert resolver in virtual workspace
      617e2cc7
  25. Oct 04, 2021
  26. Sep 24, 2021
    • Bastian Köcher's avatar
      Prepare UI tests for rust 1.55 (#9637) · 62187b59
      Bastian Köcher authored
      
      
      * Prepare UI tests for rust 1.54
      
      * Delete wrong_page.stderr
      
      * CI: run with a staging CI image
      
      * Revert "CI: run with a staging CI image"
      
      This reverts commit 66f5b00d14b50fd9d8fbf773f7e884f380697591.
      
      * CI: debug, again
      
      * LOG_TARGET is only used in std
      
      * Remove unnecessary unsafe
      
      * Fixes
      
      * Use correct rustc locally
      
      * FMT
      
      * Compile with benchmarking
      
      * Review feedback
      
      * Some ui tests
      
      * I know...
      
      * Fix wasm tests
      
      Co-authored-by: default avatarDenis P <[email protected]>
      Co-authored-by: default avatarthiolliere <[email protected]>
      62187b59
  27. Aug 11, 2021
  28. Jul 22, 2021
  29. Jul 21, 2021
    • Bastian Köcher's avatar
      Run cargo fmt on the whole code base (#9394) · 7b56ab15
      Bastian Köcher authored
      * Run cargo fmt on the whole code base
      
      * Second run
      
      * Add CI check
      
      * Fix compilation
      
      * More unnecessary braces
      
      * Handle weights
      
      * Use --all
      
      * Use correct attributes...
      
      * Fix UI tests
      
      * AHHHHHHHHH
      
      * 🤦
      
      * Docs
      
      * Fix compilation
      
      * 🤷
      
      * Please stop
      
      * 🤦
      
       x 2
      
      * More
      
      * make rustfmt.toml consistent with polkadot
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      7b56ab15
  30. Jun 15, 2021
  31. Jun 07, 2021
    • cheme's avatar
      Compact proof utilities in sp_trie. (#8574) · f01c3966
      cheme authored
      * validation extension in sp_io
      
      * need paths
      
      * arc impl
      
      * missing host function in executor
      
      * io to pkdot
      
      * decode function.
      
      * encode primitive.
      
      * trailing tab
      
      * multiple patch
      
      * fix child trie logic
      
      * restore master versionning
      
      * bench compact proof size
      
      * trie-db 22.3 is needed
      
      * line width
      
      * split line
      
      * fixes for bench (additional root may not be needed as original issue was
      with empty proof).
      
      * revert compact from block size calculation.
      
      * New error type for compression.
      
      * Adding test (incomplete (failing)).
      Also lacking real proof checking (no good primitives in sp-trie crate).
      
      * There is currently no proof recording utility in sp_trie, removing
      test.
      
      * small test of child root in proof without a child proof.
      
      * remove empty test.
      
      * remove non compact proof size
      
      * Missing revert.
      
      * proof method to encode decode.
      f01c3966
  32. Apr 27, 2021
  33. Apr 12, 2021
  34. Apr 07, 2021
  35. Mar 01, 2021
    • Bastian Köcher's avatar
      Init `RuntimeLogger` automatically for each runtime api call (#8128) · 68390d40
      Bastian Köcher authored
      
      
      * Init `RuntimeLogger` automatically for each runtime api call
      
      This pr change the runtime api in such a way to always and automatically
      enable the `RuntimeLogger`. This enables the user to use `log` or
      `tracing` from inside the runtime to create log messages. As logging
      introduces some extra code and especially increases the size of the wasm
      blob. It is advised to disable all logging completely with
      `sp-api/disable-logging` when doing the wasm builds for the on-chain
      wasm runtime.
      
      Besides these changes, the pr also brings most of the logging found in
      frame to the same format "runtime::*".
      
      * Update frame/im-online/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Update test-utils/runtime/Cargo.toml
      
      * Fix test
      
      * Don't use tracing in the runtime, as we don't support it :D
      
      * Fixes
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      68390d40
  36. Jan 04, 2021
    • Bastian Köcher's avatar
      Happy new year (#7814) · e3e651f7
      Bastian Köcher authored
      * Happy new year
      
      Updates the copyright years and fixes wrong license headers.
      
      * Fix the template
      
      * Split HEADER into HEADER-APACHE & HEADER-GPL
      e3e651f7
  37. Nov 24, 2020
    • Bastian Köcher's avatar
      Wasm-builder 3.0 (#7532) · 923cb8ee
      Bastian Köcher authored
      
      
      * Build every wasm crate in its own project with wasm-builder
      
      Building all wasm crates in one workspace was a nice idea, however it
      just introduced problems:
      
      1. We needed to prune old members, but this didn't worked for old git
      deps.
      2. We locked the whole wasm workspace while building one crate. This
      could lead to infinitely locking the workspace on a crash.
      
      Now we just build every crate in its own project, this means we will
      build the dependencies multiple times. While building the dependencies
      multiple times, we still decrease the build time by around 30 seconds
      for Polkadot and Substrate because of the new parallelism ;)
      
      * Remove the requirement on wasm-builder-runner
      
      This removes the requirement on wasm-builder-runner by using the new
      `build_dep` feature of cargo. We use nightly anyway and that enables us
      to use this feature. This solves the problem of not mixing
      build/proc-macro deps with normal deps. By doing this we get rid off
      this complicated project structure and can depend directly on
      `wasm-builder`. This also removes all the code from wasm-builder-runner
      and mentions that it is deprecated.
      
      * Copy the `Cargo.lock` to the correct folder
      
      * Remove wasm-builder-runner
      
      * Update docs
      
      * Fix deterministic check
      
      Modified-by: default avatarBastian Köcher <[email protected]>
      
      * Try to make the ui test happy
      
      * Switch to `SKIP_WASM_BUILD`
      
      * Rename `SKIP_WASM_BINARY` to the correct name...
      
      * Update utils/wasm-builder/src/builder.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Update utils/wasm-builder/src/builder.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      923cb8ee
  38. Oct 19, 2020
    • Bastian Köcher's avatar
      Make `wasm-builder` print the rustc version (#7351) · 23382db1
      Bastian Köcher authored
      * Make `wasm-builder` print the rustc version
      
      This makes `wasm-builder` print the rustc version that is being used to
      compile the project. This is rather useful, because people can check
      faster if the used rustc version is maybe known for being broken with
      Substrate.
      
      * Apply suggestions from code review
      
      * Add some comments
      23382db1
  39. Oct 12, 2020
  40. Sep 15, 2020
    • Bastian Köcher's avatar
      Improve error output of wasm-builder when wasm ins't installed (#7105) · 9dd5812e
      Bastian Köcher authored
      This improves the error message of wasm-builder when the wasm toolchain
      isn't installed. Currently we print that the wasm toolchain is not
      installed, but the actual problem is that there is a bug in the
      packaging in rust. This will now be much easier to debug, by printing
      the full error message of the compiler.
      9dd5812e