Skip to content
Snippets Groups Projects
  1. Nov 24, 2024
  2. Nov 22, 2024
  3. Nov 21, 2024
    • PG Herveou's avatar
      [pallet-revive] Support all eth tx types (#6461) · d8ce5502
      PG Herveou authored
      
      Add support for all eth tx types
      Note that js libs will continue to use the Legacy type since we don't
      include base_fee_per_gas yet in the block.
      We can think about setting these values after we revisit how we encode
      the gas into weight & deposit_limit in a follow up PR
      
      ---------
      
      Co-authored-by: default avatarAlexander Theißen <alex.theissen@me.com>
      Co-authored-by: default avatarGitHub Action <action@github.com>
      d8ce5502
    • Iulian Barbu's avatar
      parachain-template-node: add properties for dev chain-spec (#6560) · 6d59c3b1
      Iulian Barbu authored
      
      # Description
      
      Reused as before the `properties` variable when defining a development
      chain spec for parachain-template-node.
      
      ## Integration
      
      N/A
      
      ## Review Notes
      
      One line change, pretty self explanatory (it got lost within the history
      of changes over the parachain-template-node/chain_spec.rs file). To be
      honest, not really sure how useful it is, but I had the choice of
      removing the `properties` var or reuse it as before, and I went with the
      latter.
      
      Signed-off-by: default avatarIulian Barbu <iulian.barbu@parity.io>
      6d59c3b1
    • Ankan's avatar
      [Fix|NominationPools] Only allow apply slash to be executed if the slash... · bf20a9ee
      Ankan authored
      [Fix|NominationPools] Only allow apply slash to be executed if the slash amount is atleast ED (#6540)
      
      This change prevents `pools::apply_slash` from being executed when the
      pending slash amount of the member is lower than the ED.
      
      The issue came to light with the failing [benchmark
      test](https://github.com/polkadot-fellows/runtimes/actions/runs/11879471717/job/33101445269?pr=490#step:11:765)
      in Kusama. The problem arises from the inexact conversion between points
      and balance. Specifically, when points are converted to balance and then
      back to points, rounding can introduce a small discrepancy between the
      input and the resulting value. This issue surfaced in Kusama due to its
      ED being different from Westend and Polkadot (1 UNIT/300), making the
      rounding issue noticeable.
      
      This fix is also significant because applying a slash is feeless and
      permissionless. Allowing super small slash amounts to be applied without
      a fee is undesirable. With this change, such small slashes will still be
      applied but only when member funds are withdrawn.
      
      ---------
      
      Co-authored-by: default avatarDónal Murray <donal.murray@parity.io>
      bf20a9ee
    • Iulian Barbu's avatar
      github/workflows: add ARM macos build binaries job (#6427) · 1f7765b6
      Iulian Barbu authored
      # Description
      
      This PR adds the required changes to release `polkadot`,
      `polkadot-parachain` and `polkadot-omni-node` binaries built on Apple
      Sillicon macos.
      
      ## Integration
      
      This addresses requests from the community for such binaries: #802, and
      they should be part of the Github release page.
      
      ## Review Notes
      
      Test on paritytech-stg solely focused on macos binaries:
      https://github.com/paritytech-stg/polkadot-sdk/actions/runs/11824692766/job/32946793308,
      except the steps related to `pgpkms` (which need AWS credentials,
      missing from paritytech-stg). The binary names don't have a `darwin-arm`
      identifier, and conflict with the existing x86_64-linux binaries. I
      haven't tested building everything on `paritytech-stg` because the
      x86_64-linux builds run on `unbutu-latest-m` which isn't enabled on
      `pairtytech-stg` (and I haven't asked CI team to enable one), so testing
      how to go around naming conflicts should be covered next.
      
      ### TODO
      
      - [x] Test the workflow start to end (especially the last bits related
      to uploading the binaries on S3 and ensuring the previous binaries and
      the new ones coexist harmoniously on S3/action artifacts storage without
      naming conflicts) @EgorPopelyaev
      - [x] Publish the arm binaries on the Github release page - to clarify
      what's needed @iulianbarbu
      
       . Current practice is to manually publish the
      binaries built via `release-build-rc.yml` workflow, taken from S3. Would
      be great to have the binaries there in the first place before working on
      automating this, but I would also do it in a follow up PR.
      
      ### Follow ups
      
      - [ ] unify the binaries building under
      `release-30_publish_release_draft.yml` maybe?
      - [ ] automate binary artifacts upload to S3 in
      `release-30_publish_release_draft.yml`
      
      ---------
      
      Signed-off-by: default avatarIulian Barbu <iulian.barbu@parity.io>
      Co-authored-by: default avatarEgorPopelyaev <egor@parity.io>
      1f7765b6
    • Bastian Köcher's avatar
      slot-based-collator: Move spawning of the futures (#6561) · 56d97c3a
      Bastian Köcher authored
      
      Move spawning of the slot-based collator into the `run` function. Also
      the tasks are being spawned as blocking task and not just as normal
      tasks.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
      56d97c3a
    • Alexandru Vasile's avatar
      network-gossip: Ensure sync event is processed on unknown peer roles (#6553) · 7c9e34b5
      Alexandru Vasile authored
      
      The `GossipEngine::poll_next` implementation polls both the
      `notification_service` and the `sync_event_stream`.
      
      If both polls produce valid data to be processed
      (`Poll::Ready(Some(..))`), then the sync event is ignored when we
      receive `NotificationEvent::NotificationStreamOpened` and the role
      cannot be deduced.
      
      This PR ensures both events are processed gracefully. While at it, I
      have added a warning to the sync engine related to
      `notification_service` producing `Poll::Ready(None)`.
      
      This effectively ensures that `SyncEvents` propagate to the network
      potentially fixing any state mismatch.
      
      
      For more context: https://github.com/paritytech/polkadot-sdk/issues/6507
      
      cc @paritytech/sdk-node
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
      7c9e34b5
    • Alexander Theißen's avatar
      revive: Bump connect timeout to fix flaky tests (#6567) · b290f27c
      Alexander Theißen authored
      
      The eth RPC tests fail sometimes because they run into a connect timeout
      because the node takes a long time to start. This bumps the connect
      timeout from 30 to 120 seconds. Locally they take around 40s for me.
      
      As a drive by I also remove a apparently duplicated nextest config.
      
      ---------
      
      Co-authored-by: default avatarordian <write@reusable.software>
      b290f27c
    • gupnik's avatar
      Removes constraint in `BlockNumberProvider` from treasury (#6522) · a8722784
      gupnik authored
      https://github.com/paritytech/polkadot-sdk/pull/3970 updated the
      treasury pallet to support relay chain block number provider. However,
      it added a constraint to the BlockNumberProvider to have the same block
      number type as frame_system:
      
      ```rust
      type BlockNumberProvider: BlockNumberProvider<BlockNumber = BlockNumberFor<Self>>;
      ```
      
      This PR removes that constraint as suggested by @gui1117
      a8722784
  4. Nov 20, 2024
  5. Nov 19, 2024
    • Liu-Cheng Xu's avatar
      Pure state sync refactoring (part-2) (#6521) · 07a59333
      Liu-Cheng Xu authored
      
      This PR is the second part of the pure state sync refactoring,
      encapsulating `StateSyncMetadata` as a separate entity. Now it's pretty
      straightforward what changes are needed for the persistent state sync as
      observed in the struct `StateSync`:
      
      - `state`: redirect directly to the DB layer instead of being
      accumulated in the memory.
      - `metadata`: handle the state sync metadata on disk whenever the state
      is forwarded to the DB, resume an ongoing state sync on a restart, etc.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      Co-authored-by: default avatarAlexandru Vasile <60601340+lexnv@users.noreply.github.com>
      07a59333
    • Liu-Cheng Xu's avatar
      Support block gap created by fast sync (#5703) · ce20d0a5
      Liu-Cheng Xu authored
      This is part 2 of
      https://github.com/paritytech/polkadot-sdk/issues/5406#issuecomment-2325064863,
      properly handling the block gap generated during fast sync.
      
      Although #5406 remains unresolved due to the known issues in #5663, I
      decided to open up this PR earlier than later to speed up the overall
      progress. I've tested the fast sync locally with this PR, and it appears
      to be functioning well. (I was doing a fast sync from a discontinued
      archive node locally, thus the issue highlighted in
      https://github.com/paritytech/polkadot-sdk/pull/5663#discussion_r1752124039
      was bypassed exactly.)
      
      Once the edge cases in #5663 are addressed, we can move forward by
      removing the body attribute from the LightState block request and
      complete the work on #5406. The changes in this PR are incremental, so
      reviewing commit by commit should provide the best clarity.
      
      cc @dmitry-markin
      
      
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      ce20d0a5
    • Bastian Köcher's avatar
      Forward logging directives to Polkadot workers (#6534) · cccf3417
      Bastian Köcher authored
      
      This pull request forward all the logging directives given to the node
      via `RUST_LOG` or `-l` to the workers, instead of only forwarding
      `RUST_LOG`.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
      cccf3417
    • Kazunobu Ndong's avatar
      Migrate pallet-democracy benchmarks to benchmark v2 syntax (#6509) · 09757a41
      Kazunobu Ndong authored
      
      # Description
      
      Migrates pallet-democracy benchmarks to benchmark v2 syntax
      This is Part of https://github.com/paritytech/polkadot-sdk/issues/6202
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarDmitry Markin <dmitry@markin.tech>
      Co-authored-by: default avatarAlexandru Vasile <60601340+lexnv@users.noreply.github.com>
      09757a41
    • Maciej's avatar
      Validator Re-Enabling (#5724) · 8d4138f7
      Maciej authored
      
      Aims to implement Stage 3 of Validator Disbling as outlined here:
      https://github.com/paritytech/polkadot-sdk/issues/4359
      
      Features:
      - [x] New Disabling Strategy (Staking level)
      - [x] Re-enabling logic (Session level)
      - [x] More generic disabling decision output
      - [x] New Disabling Events
      
      Testing & Security:
      - [x] Unit tests
      - [x] Mock tests
      - [x] Try-runtime checks
      - [x] Try-runtime tested on westend snap
      - [x] Try-runtime CI tests
      - [ ] Re-enabling Zombienet Test (?)
      - [ ] SRLabs Audit
      
      Closes #4745 
      Closes #2418
      
      ---------
      
      Co-authored-by: default avatarordian <write@reusable.software>
      Co-authored-by: default avatarAnkan <10196091+Ank4n@users.noreply.github.com>
      Co-authored-by: default avatarTsvetomir Dimitrov <tsvetomir@parity.io>
      8d4138f7
    • tmpolaczyk's avatar
      Fix metrics not shutting down if there are open connections (#6220) · 0449b214
      tmpolaczyk authored
      Fix prometheus metrics not shutting down if there are open connections.
      I fixed the same issue in the past but it broke again after a dependecy
      upgrade.
      
      See also:
      
      https://github.com/paritytech/polkadot-sdk/pull/1637
      0449b214
    • Ermal Kaleci's avatar
      [pallet-revive] Update delegate_call to accept address and weight (#6111) · 293d4a59
      Ermal Kaleci authored
      
      Enhance the `delegate_call` function to accept an `address` target
      parameter instead of a `code_hash`. This allows direct identification of
      the target contract using the provided address.
      Additionally, introduce parameters for specifying a customizable
      `ref_time` limit and `proof_size` limit, thereby improving flexibility
      and control during contract interactions.
      
      ---------
      
      Co-authored-by: default avatarAlexander Theißen <alex.theissen@me.com>
      293d4a59
    • Tobi Demeco's avatar
      sp-trie: correctly avoid panicking when decoding bad compact proofs (#6502) · 5e8348f0
      Tobi Demeco authored
      # Description
      
      Opening another PR because I added a test to check for my fix pushed in
      #6486 and realized that for some reason I completely forgot how to code
      and did not fix the underlying issue, since out-of-bounds indexing could
      still happen even with the check I added. This one should fix that and,
      as an added bonus, has a simple test used as an integrity check to make
      sure future changes don't accidently revert this fix.
      
      Now `sp-trie` should definitely not panic when faced with bad
      `CompactProof`s. Sorry about that :sweat_smile:
      
      
      
      This, like #6486, is related to issue #6485
      
      ## Integration
      
      No changes have to be done downstream, and as such the version bump
      should be minor.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
      5e8348f0
    • Michal Kucharczyk's avatar
      `TransactionPool` API uses `async_trait` (#6528) · 5721e556
      Michal Kucharczyk authored
      
      This PR refactors `TransactionPool` API to use `async_trait`, replacing
      the` Pin<Box<...>>` pattern. This should improve readability and
      maintainability.
      
      The change is not altering any functionality.
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
      5721e556
  6. Nov 18, 2024
  7. Nov 15, 2024
  8. Nov 14, 2024
    • NingLin-P's avatar
      Support more types in TypeWithDefault (#6411) · 5bc571b0
      NingLin-P authored
      
      # Description
      
      When using `TypeWithDefault<u32, ..>` as the default nonce provider to
      overcome the [replay
      attack](https://wiki.polkadot.network/docs/transaction-attacks#replay-attack)
      issue, it fails to compile due to `TypeWithDefault<u32, ..>:
      TryFrom<u64>` is not satisfied (which is required by trait
      `BaseArithmetic`).
      
      This is because the blanket implementation `TryFrom<U> for T where U:
      Into<T>` only impl `TryFrom<u16>` and `TryFrom<u8>` for `u32` since
      `u32` only impl `Into` for `u16` and `u8` but not `u64`.
      
      This PR fixes the issue by adding `TryFrom<u16/u32/u64/u128>` and
      `From<u8/u16/u32/u64/u128>` impl (using macro) for
      `TypeWithDefault<u8/u16/u32/u64/u128, ..>` and removing the blanket impl
      (otherwise the compiler will complain about conflicting impl), such that
      `TypeWithDefault<u8/u16/u32/u64/u128, ..>: AtLeast8/16/32Bit` is
      satisfied.
      
      ## Integration
      
      This PR adds support to more types to be used with `TypeWithDefault`,
      existing code that used `u64` with `TypeWithDefault` should not be
      affected, an unit test is added to ensure that.
      
      ## Review Notes
      
      This PR simply makes `TypeWithDefault<u8/u16/u32/u64/u128, ..>:
      AtLeast8/16/32Bit` satisfied
      
      ---------
      
      Signed-off-by: default avatarlinning <linningde25@gmail.com>
      5bc571b0
    • PG Herveou's avatar
      [pallet-revive] set logs_bloom (#6460) · dbeea184
      PG Herveou authored
      
      Set the logs_bloom in the transaction receipt
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
      Co-authored-by: default avatarCyrill Leutwiler <cyrill@parity.io>
      dbeea184
    • Viraj Bhartiya's avatar
      feat: add workflow to test readme generation (#6359) · 5da40637
      Viraj Bhartiya authored
      
      # Description
      
      Created a workflow to search for README.docify.md in the repo, and run
      cargo build --features generate-readme in the dir of the file (assuming
      it is related to a crate). If the git diff shows some output for the
      README.md, then the file update wasn't pushed on the branch, and the
      workflow fails.
      Closes #6331
      
      ## Integration
      
      Downstream projects that want to adopt this README checking workflow
      should:
      
      1. Copy the `.github/workflows/readme-check.yml` file to their
      repository
      2. Ensure any `README.docify.md` files in their project follow the
      expected format
      3. Implement the `generate-readme` feature flag in their Cargo.toml if
      not already present
      
      ## Review Notes
      
      This PR adds a GitHub Actions workflow that automatically verifies
      README.md files are up-to-date with their corresponding README.docify.md
      sources. Key implementation details:
      
      - The workflow runs on both PRs and pushes to main
      - It finds all `README.docify.md` files recursively in the repository
      - For each file found:
      - Builds the project with `--features generate-readme` in that directory
        - Checks if the README.md has any uncommitted changes
        - Fails if any README.md is out of sync
      
      ---------
      
      Co-authored-by: default avatarAlexander Samusev <41779041+alvicsam@users.noreply.github.com>
      Co-authored-by: default avatarIulian Barbu <14218860+iulianbarbu@users.noreply.github.com>
      5da40637
    • georgepisaltu's avatar
      Follow up work on `TransactionExtension` - fix weights and clean up `UncheckedExtrinsic` (#6418) · ae4b68b3
      georgepisaltu authored
      
      Follow up to https://github.com/paritytech/polkadot-sdk/pull/3685
      Partially fixes https://github.com/paritytech/polkadot-sdk/issues/6403
      
      The main PR introduced bare support for the new extension version byte
      as well as extension weights and benchmarking.
      
      This PR:
      - Removes the redundant extension version byte from the signed v4
      extrinsic, previously unused and defaulted to 0.
      - Adds the extension version byte to the inherited implication passed to
      `General` transactions.
      - Whitelists the `pallet_authorship::Author`, `frame_system::Digest` and
      `pallet_transaction_payment::NextFeeMultiplier` storage items as they
      are read multiple times by extensions for each transaction, but are hot
      in memory and currently overestimate the weight.
      - Whitelists the benchmark caller for `CheckEra` and `CheckGenesis` as
      the reads are performed for every transaction and overestimate the
      weight.
      - Updates the umbrella frame weight template to work with the system
      extension changes.
      - Plans on re-running the benchmarks at least for the `frame_system`
      extensions.
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <george.pisaltu@parity.io>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatargui <gui.thiolliere@gmail.com>
      ae4b68b3
    • thiolliere's avatar
      Fix staking benchmark (#6463) · a1af8ed6
      thiolliere authored
      Found by @ggwpez
      
       
      
      Fix staking benchmark, error was introduced when migrating to v2:
      https://github.com/paritytech/polkadot-sdk/pull/6025
      
      ---------
      
      Co-authored-by: default avatarGitHub Action <action@github.com>
      a1af8ed6
  9. Nov 13, 2024