Skip to content
Snippets Groups Projects
  1. Jan 04, 2025
  2. Dec 30, 2024
  3. Dec 23, 2024
  4. Dec 22, 2024
  5. Dec 21, 2024
    • Dónal Murray's avatar
      [pallet-broker] add extrinsic to reserve a system core without having to wait... · f9cdf41a
      Dónal Murray authored
      [pallet-broker] add extrinsic to reserve a system core without having to wait two sale boundaries (#4273)
      
      When calling the reserve extrinsic after sales have started, the
      assignment will be reserved, but two sale period boundaries must pass
      before the core is actually assigned.
      
      Since this can take between 28 and 56 days on production networks, a new
      extrinsic is introduced to shorten the timeline.
      
      This essentially performs three actions:
      1. Reserve it (applies after two sale boundaries)
      2. Add it to the Workplan for the next sale period
      3. Add it to the Workplan for the rest of the current sale period from
      the next timeslice to be commmitted.
      
      The caller must ensure that a core is first added, with most relay chain
      implementations having a delay of two session boundaries until it comes
      into effect.
      
      Alternatively the extrinsic can be called on a core whose workload can
      be clobbered from now until the reservation kicks in (the sale period
      after the next). Any workplan entries for that core at other timeslices
      should be first removed by the caller.
      
      ---------
      
      Co-authored-by: command-bot <>
  6. Dec 20, 2024
    • Bastian Köcher's avatar
      grandpa: Ensure `WarpProof` stays in its limits (#6963) · d0c8a073
      Bastian Köcher authored
      There was the chance that a `WarpProof` was bigger than the maximum warp
      sync proof size. This could have happened when inserting the last
      justification, which then may pushed the total proof size above the
      maximum. The solution is simply to ensure that the last justfication
      also fits into the limits.
      
      Close: https://github.com/paritytech/polkadot-sdk/issues/6957
      
      ---------
      
      Co-authored-by: command-bot <>
    • Xavier Lau's avatar
      Reorder dependencies' keys (#6967) · a843d15e
      Xavier Lau authored
      
      It doesn't make sense to only reorder the features array.
      
      For example:
      
      This makes it hard for me to compare the dependencies and features,
      especially some crates have a really really long dependencies list.
      ```toml​
      [dependencies]
      c = "*"
      a = "*"
      b = "*"
      
      [features]
      std = [
        "a",
        "b",
        "c",
      ]
      ```
      
      This makes my life easier.
      ```toml​
      [dependencies]
      a = "*"
      b = "*"
      c = "*"
      
      [features]
      std = [
        "a",
        "b",
        "c",
      ]
      ```
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      Co-authored-by: command-bot <>
    • runcomet's avatar
      Migrate `pallet-atomic-swap` to umbrella crate (#6601) · 4e805ca0
      runcomet authored
      
      Part of https://github.com/paritytech/polkadot-sdk/issues/6504
      
      ---------
      
      Co-authored-by: default avatarGiuseppe Re <giuseppe.re@parity.io>
  7. Dec 19, 2024
  8. Dec 18, 2024
  9. Dec 17, 2024
  10. Dec 16, 2024
    • Nazar Mokrynskyi's avatar
      Upgrade libp2p from 0.52.4 to 0.54.1 (#6248) · c8812883
      Nazar Mokrynskyi authored
      
      # Description
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/5996
      
      https://github.com/libp2p/rust-libp2p/releases/tag/libp2p-v0.53.0
      https://github.com/libp2p/rust-libp2p/blob/master/CHANGELOG.md
      
      ## Integration
      
      Nothing special is needed, just note that `yamux_window_size` is no
      longer applicable to libp2p (litep2p seems to still have it though).
      
      ## Review Notes
      
      There are a few simplifications and improvements done in libp2p 0.53
      regarding swarm interface, I'll list a few key/applicable here.
      
      https://github.com/libp2p/rust-libp2p/pull/4788 removed
      `write_length_prefixed` function, so I inlined its code instead.
      
      https://github.com/libp2p/rust-libp2p/pull/4120 introduced new
      `libp2p::SwarmBuilder` instead of now deprecated
      `libp2p::swarm::SwarmBuilder`, the transition is straightforward and
      quite ergonomic (can be seen in tests).
      
      https://github.com/libp2p/rust-libp2p/pull/4581 is the most annoying
      change I have seen that basically makes many enums `#[non_exhaustive]`.
      I mapped some, but those that couldn't be mapped I dealt with by
      printing log messages once they are hit (the best solution I could come
      up with, at least with stable Rust).
      
      https://github.com/libp2p/rust-libp2p/issues/4306 makes connection close
      as soon as there are no handler using it, so I had to replace
      `KeepAlive::Until` with an explicit future that flips internal boolean
      after timeout, achieving the old behavior, though it should ideally be
      removed completely at some point.
      
      `yamux_window_size` is no longer used by libp2p thanks to
      https://github.com/libp2p/rust-libp2p/pull/4970 and generally Yamux
      should have a higher performance now.
      
      I have resolved and cleaned up all deprecations related to libp2p except
      `BandwidthSinks`. Libp2p deprecated it (though it is still present in
      0.54.1, which is why I didn't handle it just yet). Ideally Substrate
      would finally [switch to the official Prometheus
      client](https://github.com/paritytech/substrate/issues/12699), in which
      case we'd get metrics for free. Otherwise a bit of code will need to be
      copy-pasted to maintain current behavior with `BandwidthSinks` gone,
      which I left a TODO about.
      
      The biggest change in 0.54.0 is
      https://github.com/libp2p/rust-libp2p/pull/4568 that changed transport
      APIs and enabled unconditional potential port reuse, which can lead to
      very confusing errors if running two Substrate nodes on the same machine
      without changing listening port explicitly.
      
      Overall nothing scary here, but testing is always appreciated.
      
      # Checklist
      
      * [x] My PR includes a detailed description as outlined in the
      "Description" and its two subsections above.
      * [x] My PR follows the [labeling requirements](
      
      https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process
      ) of this project (at minimum one label for `T` required)
      * External contributors: ask maintainers to put the right label on your
      PR.
      
      ---
      
      Polkadot Address: 1vSxzbyz2cJREAuVWjhXUT1ds8vBzoxn2w4asNpusQKwjJd
      
      ---------
      
      Co-authored-by: default avatarDmitry Markin <dmitry@markin.tech>
  11. Dec 14, 2024
  12. Dec 13, 2024
  13. Dec 12, 2024
  14. Dec 11, 2024
    • Alexander Theißen's avatar
      pallet-revive: Statically verify imports on code deployment (#6759) · f0b5c3e6
      Alexander Theißen authored
      
      Previously, we failed at runtime if an unknown or unstable host function
      was called. This requires us to keep track of when a host function was
      added and when a code was deployed. We used the `api_version` to track
      at which API version each code was deployed. This made sure that when a
      new host function was added that old code won't have access to it. This
      is necessary as otherwise the behavior of a contract that made calls to
      this previously non existent host function would change from "trap" to
      "do something".
      
      In this PR we remove the API version. Instead, we statically verify on
      upload that no non-existent host function is ever used in the code. This
      will allow us to add new host function later without needing to keep
      track when they were added.
      
      This simplifies the code and also gives an immediate feedback if unknown
      host functions are used.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
    • PG Herveou's avatar
      [pallet-revive] eth-rpc add missing tests (#6728) · 99be9b1e
      PG Herveou authored
      Add tests for #6608 
      
      fix https://github.com/paritytech/contract-issues/issues/12
      
      ---------
      
      Co-authored-by: command-bot <>
  15. Dec 10, 2024
    • Iulian Barbu's avatar
      omni-node: --dev sets manual seal and allows --chain to be set (#6646) · 48c28d4c
      Iulian Barbu authored
      # Description
      
      This PR changes a few things:
      * `--dev` flag will not conflict with `--chain` anymore, but if
      `--chain` is not given will set `--chain=dev`.
      * `--dev-block-time` is optional and it defaults to 3000ms if not set
      after setting `--dev`.
      * to start OmniNode with manual seal it is enough to pass just `--dev`.
      * `--dev-block-time` can still be used to start a node with manual seal,
      but it will not set it up as `--dev` does (it will not set a bunch of
      flags which are enabled by default when `--dev` is set: e.g. `--tmp`,
      `--alice` and `--force-authoring`.
      
      Closes: #6537
      
      ## Integration
      
      Relevant for node/runtime developers that use OmniNode lib, including
      `polkadot-omni-node` binary, although the recommended way for runtime
      development is to use `chopsticks`.
      
      ## Review Notes
      
      * Decided to focus only on OmniNode & templates docs in relation to it,
      and leave the `parachain-template-node` as is (meaning `--dev` isn't
      usable and te...
    • Joseph Zhao's avatar
      Remove AccountKeyring everywhere (#5899) · 311ea438
      Joseph Zhao authored
      
      Close: #5858
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
  16. Dec 09, 2024
  17. Dec 05, 2024
    • Michal Kucharczyk's avatar
      `basic-authorship`: debug level is now less spammy (#6768) · f7838db5
      Michal Kucharczyk authored
      The `debug` level in `sc-basic-authorship` is now less spammy.
      Previously it was outputing logs per individual transactions. It was
      quite hard to follow the logs (and also generates unneeded traffic in
      grafana).
      
      Now `debug` level only show some internal details, without spamming
      output with per-transaction logs. They were moved to `trace` level.
      
      I also added the `EndProposingReason` to the summary INFO message. This
      allows us to know what was the block limit (which is very useful for
      debugging).
      
      Example:
      ```
      :gift:
      
       Prepared block for proposing at 64 (1186 ms) hash: 0x4b5386c13c507d0dbab319ac054cc1bcfa08311e184452221ad07f12ecc6091c; parent_hash: 0x157c…ca5e; end: HitBlockWeightLimit; extrinsics_count: 7032; 
      ```
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
    • Alexander Theißen's avatar
      pallet-revive: Adjust error handling of sub calls (#6741) · 0d3d4502
      Alexander Theißen authored
      
      We were trapping the host context in case a sub call was exhausting the
      storage deposit limit set for this sub call. This prevents the caller
      from handling this error. In this PR we added a new error code that is
      returned when either gas or storage deposit limit is exhausted by the
      sub call.
      
      We also remove the longer used `NotCallable` error. No longer used
      because this is no longer an error: It will just be a balance transfer.
      
      We also make `set_code_hash` infallible to be consistent with other host
      functions which just trap on any error condition.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
    • Alexandru Vasile's avatar
      chainHead: Always report discarded items for storage operations (#6760) · df1375ea
      Alexandru Vasile authored
      
      This PR ensures that substrate always reports discarded items as zero.
      This is needed to align with the rpc-v2 spec
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/6683
      
      
      cc @paritytech/subxt-team
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
      Co-authored-by: default avatarGitHub Action <action@github.com>
    • Andrei Eres's avatar
      Optimize initialization of networking protocol benchmarks (#6636) · f4a196ab
      Andrei Eres authored
      
      # Description
      These changes should enhance the quality of benchmark results by
      excluding worker initialization time from the measurements and reducing
      the overall duration of the benchmarks.
      
      ### Integration
      It should not affect any downstream projects.
      
      ### Review Notes
      - Workers initialize once per benchmark to avoid side effects.  
      - The listen address is assigned when a worker starts.  
      - Benchmarks are divided into two groups by size to create better charts
      for comparison.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
  18. Dec 04, 2024