Skip to content
Snippets Groups Projects
  1. Jun 05, 2024
    • ordian's avatar
      statement-distribution: prep for re-enabling (#4431) · 0d661eac
      ordian authored
      In preparation for launching re-enabling
      (https://github.com/paritytech/polkadot-sdk/issues/2418), we need to
      adjust the disabling strategy of statement-distribution to use the relay
      parent's state instead of the latest state (union of active leaves).
      This will also ensure no raciness of getting the latest state vs
      accepting statements from disabling validators at the cost of being more
      lenient/potentially accepting more statements from disabled validators.
      
      - [x] PRDoc
  2. Jun 03, 2024
  3. Jun 02, 2024
  4. May 31, 2024
  5. May 30, 2024
  6. May 29, 2024
    • Francisco Aguirre's avatar
      Change `XcmDryRunApi::dry_run_extrinsic` to take a call instead (#4621) · d5053ac4
      Francisco Aguirre authored
      
      Follow-up to the new `XcmDryRunApi` runtime API introduced in
      https://github.com/paritytech/polkadot-sdk/pull/3872.
      
      Taking an extrinsic means the frontend has to sign first to dry-run and
      once again to submit.
      This is bad UX which is solved by taking an `origin` and a `call`.
      This also has the benefit of being able to dry-run as any account, since
      it needs no signature.
      
      This is a breaking change since I changed `dry_run_extrinsic` to
      `dry_run_call`, however, this API is still only on testnets.
      The crates are bumped accordingly.
      
      As a part of this PR, I changed the name of the API from `XcmDryRunApi`
      to just `DryRunApi`, since it can be used for general dry-running :)
      
      Step towards https://github.com/paritytech/polkadot-sdk/issues/690.
      
      Example of calling the API with PAPI, not the best code, just testing :)
      
      ```ts
      // We just build a call, the arguments make it look very big though.
      const call = localApi.tx.XcmPallet.transfer_assets({
        dest: XcmVersionedLocation.V4({ parents: 0, interior: XcmV4Junctions.X1(XcmV4Junction.Parachain(1000)) }),
        beneficiary: XcmVersionedLocation.V4({ parents: 0, interior: XcmV4Junctions.X1(XcmV4Junction.AccountId32({ network: undefined, id: Binary.fromBytes(encodeAccount(account.address)) })) }),
        weight_limit: XcmV3WeightLimit.Unlimited(),
        assets: XcmVersionedAssets.V4([{
          id: { parents: 0, interior: XcmV4Junctions.Here() },
          fun: XcmV3MultiassetFungibility.Fungible(1_000_000_000_000n) }
        ]),
        fee_asset_item: 0,
      });
      // We call the API passing in a signed origin 
      const result = await localApi.apis.XcmDryRunApi.dry_run_call(
        WestendRuntimeOriginCaller.system(DispatchRawOrigin.Signed(account.address)),
        call.decodedCall
      );
      if (result.success && result.value.execution_result.success) {
        // We find the forwarded XCM we want. The first one going to AssetHub in this case.
        const xcmsToAssetHub = result.value.forwarded_xcms.find(([location, _]) => (
          location.type === "V4" &&
            location.value.parents === 0 &&
            location.value.interior.type === "X1"
            && location.value.interior.value.type === "Parachain"
            && location.value.interior.value.value === 1000
        ))!;
      
        // We can even find the delivery fees for that forwarded XCM.
        const deliveryFeesQuery = await localApi.apis.XcmPaymentApi.query_delivery_fees(xcmsToAssetHub[0], xcmsToAssetHub[1][0]);
      
        if (deliveryFeesQuery.success) {
          const amount = deliveryFeesQuery.value.type === "V4" && deliveryFeesQuery.value.value[0].fun.type === "Fungible" && deliveryFeesQuery.value.value[0].fun.value.valueOf() || 0n;
          // We store them in state somewhere.
          setDeliveryFees(formatAmount(BigInt(amount)));
        }
      }
      ```
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
  7. May 28, 2024
    • Alexandru Gheorghe's avatar
      Add metric to measure the time it takes to gather enough assignments (#4587) · ad22fa6e
      Alexandru Gheorghe authored
      
      To understand with high granularity how many assignment tranches are
      triggered before we concur that we have enough assignments.
      
      This metric is important because the triggering of an assignment creates
      a lot of work in the system for approving the candidate and gossiping
      the necessary messages.
      
      ---------
      
      Signed-off-by: default avatarAlexandru Gheorghe <alexandru.gheorghe@parity.io>
      Co-authored-by: default avatarordian <write@reusable.software>
    • Bolaji Ahmad's avatar
      Improve On_demand_assigner events (#4339) · 650b124f
      Bolaji Ahmad authored
      
      title: Improving `on_demand_assigner` emitted events
      
      doc:
        - audience: Rutime User
      description: OnDemandOrderPlaced event that is useful for indexers to
      save data related to on demand orders. Check [discussion
      here](https://substrate.stackexchange.com/questions/11366/ondemandassignmentprovider-ondemandorderplaced-event-was-removed/11389#11389).
      
      Closes #4254 
      
      crates: [ 'runtime-parachain]
      
      ---------
      
      Co-authored-by: default avatarMaciej <maciej.zyszkiewicz@parity.io>
    • Andrei Eres's avatar
      [subsytem-bench] Remove redundant banchmark_name param (#4540) · 3bf283ff
      Andrei Eres authored
      Fixes https://github.com/paritytech/polkadot-sdk/issues/3601
      
      Since we print benchmark results manually, we don't need to save
      benchmark_name anywhere, better just put the name inside `println!`.
    • Alin Dima's avatar
      Add availability-recovery from systematic chunks (#1644) · 523e6256
      Alin Dima authored
      
      **Don't look at the commit history, it's confusing, as this branch is
      based on another branch that was merged**
      
      Fixes #598 
      Also implements [RFC
      #47](https://github.com/polkadot-fellows/RFCs/pull/47)
      
      ## Description
      
      - Availability-recovery now first attempts to request the systematic
      chunks for large POVs (which are the first ~n/3 chunks, which can
      recover the full data without doing the costly reed-solomon decoding
      process). This has a fallback of recovering from all chunks, if for some
      reason the process fails. Additionally, backers are also used as a
      backup for requesting the systematic chunks if the assigned validator is
      not offering the chunk (each backer is only used for one systematic
      chunk, to not overload them).
      - Quite obviously, recovering from systematic chunks is much faster than
      recovering from regular chunks (4000% faster as measured on my apple M2
      Pro).
      - Introduces a `ValidatorIndex` -> `ChunkIndex` mapping which is
      different for every core, in order to avoid only querying the first n/3
      validators over and over again in the same session. The mapping is the
      one described in RFC 47.
      - The mapping is feature-gated by the [NodeFeatures runtime
      API](https://github.com/paritytech/polkadot-sdk/pull/2177) so that it
      can only be enabled via a governance call once a sufficient majority of
      validators have upgraded their client. If the feature is not enabled,
      the mapping will be the identity mapping and backwards-compatibility
      will be preserved.
      - Adds a new chunk request protocol version (v2), which adds the
      ChunkIndex to the response. This may or may not be checked against the
      expected chunk index. For av-distribution and systematic recovery, this
      will be checked, but for regular recovery, no. This is backwards
      compatible. First, a v2 request is attempted. If that fails during
      protocol negotiation, v1 is used.
      - Systematic recovery is only attempted during approval-voting, where we
      have easy access to the core_index. For disputes and collator
      pov_recovery, regular chunk requests are used, just as before.
      
      ## Performance results
      
      Some results from subsystem-bench:
      
      with regular chunk recovery: CPU usage per block 39.82s
      with recovery from backers: CPU usage per block 16.03s
      with systematic recovery: CPU usage per block 19.07s
      
      End-to-end results here:
      https://github.com/paritytech/polkadot-sdk/issues/598#issuecomment-1792007099
      
      #### TODO:
      
      - [x] [RFC #47](https://github.com/polkadot-fellows/RFCs/pull/47)
      - [x] merge https://github.com/paritytech/polkadot-sdk/pull/2177 and
      rebase on top of those changes
      - [x] merge https://github.com/paritytech/polkadot-sdk/pull/2771 and
      rebase
      - [x] add tests
      - [x] preliminary performance measure on Versi: see
      https://github.com/paritytech/polkadot-sdk/issues/598#issuecomment-1792007099
      - [x] Rewrite the implementer's guide documentation
      - [x] https://github.com/paritytech/polkadot-sdk/pull/3065 
      - [x] https://github.com/paritytech/zombienet/issues/1705 and fix
      zombienet tests
      - [x] security audit
      - [x] final versi test and performance measure
      
      ---------
      
      Signed-off-by: default avataralindima <alin@parity.io>
      Co-authored-by: default avatarJavier Viola <javier@parity.io>
  8. May 27, 2024
    • Michal Kucharczyk's avatar
      `sc-chain-spec`: deprecated code removed (#4410) · 2d3a6932
      Michal Kucharczyk authored
      This PR removes deprecated code:
      - The `RuntimeGenesisConfig` generic type parameter in
      `GenericChainSpec` struct.
      - `ChainSpec::from_genesis` method allowing to create chain-spec using
      closure providing runtime genesis struct
      - `GenesisSource::Factory` variant together with no longer needed
      `GenesisSource`'s generic parameter `G` (which was intended to be a
      runtime genesis struct).
      
      
      https://github.com/paritytech/polkadot-sdk/blob/17b56fae/substrate/client/chain-spec/src/chain_spec.rs#L559-L563
    • Andrei Eres's avatar
      [subsystem-benchmarks] Add statement-distribution benchmarks (#3863) · a7097681
      Andrei Eres authored
      Fixes https://github.com/paritytech/polkadot-sdk/issues/3748
      
      Adds a subsystem benchmark for statements-distribution subsystem.
      
      Results in CI (reference hw):
      ```
      $ cargo bench -p polkadot-statement-distribution --bench statement-distribution-regression-bench --features subsystem-benchmarks
      
      [Sent to peers] standart_deviation 0.07%
      [Received from peers] standart_deviation 0.00%
      [statement-distribution] standart_deviation 0.97%
      [test-environment] standart_deviation 1.03%
      
      Network usage, KiB                     total   per block
      Received from peers                1088.0000    108.8000
      Sent to peers                      1238.1800    123.8180
      
      CPU usage, seconds                     total   per block
      statement-distribution                0.3897      0.0390
      test-environment                      0.4715      0.0472
      ```
    • omahs's avatar
      chore: fix typos (#4590) · 89b67bc6
      omahs authored
      chore: fix typos
    • Francisco Aguirre's avatar
      Deprecate XCMv2 (#4131) · 9201f9ab
      Francisco Aguirre authored
      
      Marked XCMv2 as deprecated now that we have XCMv4.
      It will be removed sometime around June 2024.
      
      ---------
      
      Co-authored-by: default avatarBranislav Kontur <bkontur@gmail.com>
  9. May 24, 2024
    • Andrei Sandu's avatar
      availability-recovery: bump chunk fetch threshold to 1MB for Polkadot and 4MB... · f469fbfb
      Andrei Sandu authored
      availability-recovery: bump chunk fetch threshold to 1MB for Polkadot and 4MB for Kusama + testnets (#4399)
      
      Doing this change ensures that we minimize the CPU usage we spend in
      reed-solomon by only doing the re-encoding into chunks if PoV size is
      less than 4MB (which means all PoVs right now)
       
      Based on susbystem benchmark results we concluded that it is safe to
      bump this number higher. At worst case scenario the network pressure for
      a backing group of 5 is around 25% of the network bandwidth in hw specs.
      
      Assuming 6s block times (max_candidate_depth 3) and needed_approvals 30
      the amount of bandwidth usage of a backing group used would hover above
      `30 * 4 * 3 = 360MB` per relay chain block. Given a backing group of 5
      that gives 72MB per block per validator -> 12 MB/s.
      
      <details>
      <summary>Reality check on Kusama PoV sizes (click for chart)</summary>
      <br>
      <img width="697" alt="Screenshot 2024-05-07 at 14 30 38"
      src="https://github.com/paritytech/polkadot-sdk/assets/54316454/bfed32d4-8623-48b0-9ec0-8b95dd2a9d8c">
      </details>
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <andrei-mihail@parity.io>
    • Oliver Tale-Yazdi's avatar
      Polkadot-SDK Umbrella Crate (#3935) · 1c7a1a58
      Oliver Tale-Yazdi authored
      
      # Umbrella Crate
      
      The Polkadot-SDK "umbrella" is a crate that re-exports all other
      published crates. This makes it
      possible to have a very small `Cargo.toml` file that only has one
      dependency, the umbrella
      crate. This helps with selecting the right combination of crate
      versions, since otherwise 3rd
      party tools are needed to select a compatible set of versions.
      
      ## Features
      
      The umbrella crate supports no-std builds and can therefore be used in
      the runtime and node.
      There are two main features: `runtime` and `node`. The `runtime` feature
      enables all `no-std`
      crates, while the `node` feature enables all `std` crates. It should be
      used like any other
      crate in the repo, with `default-features = false`.
      
      For more fine-grained control, additionally, each crate can be enabled
      selectively. The umbrella
      exposes one feature per dependency. For example, if you only want to use
      the `frame-support`
      crate, you can enable the `frame-support` feature.
      
      The umbrella exposes a few more general features:
      - `tuples-96`: Needs to be enabled for runtimes that have more than 64
      pallets.
      - `serde`: Specifically enable `serde` en/decoding support.
      - `experimental`: Experimental enable experimental features - should not
      yet used in production.
      - `with-tracing`: Enable tracing support.
      - `try-runtime`, `runtime-benchmarks` and `std`: These follow the
      standard conventions.
      - `runtime`: As described above, enable all `no-std` crates.
      - `node`: As described above, enable all `std` crates.
      - There does *not* exist a dedicated docs feature. To generate docs,
      enable the `runtime` and
      `node` feature. For docs.rs the manifest contains specific configuration
      to make it show up
        all re-exports.
      
      There is a specific `zepter` check in place to ensure that the features
      of the umbrella are
      correctly configured. This check is run in CI and locally when running
      `zepter`.
      
      ## Generation
      
      The umbrella crate needs to be updated every time when a new crate is
      added or removed from the
      workspace. It is checked in CI by calling its generation script. The
      generation script is
      located in `./scripts/generate-umbrella.py` and needs dependency
      `cargo_workspace`.
      
      Example: `python3 scripts/generate-umbrella.py --sdk . --version 1.9.0`
      
      ## Usage
      
      > Note: You can see a live example in the `staging-node-cli` and
      `kitchensink-runtime` crates.
      
      The umbrella crate can be added to your runtime crate like this:
      
      `polkadot-sdk = { path = "../../../../umbrella", features = ["runtime"],
      default-features =
      false}`
      
      or for a node:
      
      `polkadot-sdk = { path = "../../../../umbrella", features = ["node"],
      default-features = false
      }`
      
      In the code, it is then possible to bring all dependencies into scope
      via:
      
      `use polkadot_sdk::*;`
      
      ### Known Issues
      
      The only known issue so far is the fact that the `use` statement brings
      the dependencies only
      into the outer module scope - not the global crate scope. For example,
      the following code would
      need to be adjusted:
      
      ```rust
      use polkadot_sdk::*;
      
      mod foo {
         // This does sadly not compile:
         frame_support::parameter_types! { }
      
         // Instead, we need to do this (or add an equivalent `use` statement):
         polkadot_sdk::frame_support::parameter_types! { }
      }
      ```
      
      Apart from this, no issues are known. There could be some bugs with how
      macros locate their own
      re-exports. Please compile issues that arise from using this crate.
      
      ## Dependencies
      
      The umbrella crate re-exports all published crates, with a few
      exceptions:
      - Runtime crates like `rococo-runtime` etc are not exported. This
      otherwise leads to very weird
        compile errors and should not be needed anyway.
      - Example and fuzzing crates are not exported. This is currently
      detected by checking the name
      of the crate for these magic words. In the future, it will utilize
      custom metadata, as it is
        done in the `rococo-runtime` crate.
      - The umbrella crate itself. Should be obvious :)
      
      ## Follow Ups
      - [ ] Re-writing the generator in Rust - the python script is at its
      limit.
      - [ ] Using custom metadata to exclude some crates instead of filtering
      by names.
      - [ ] Finding a way to setting the version properly. Currently its
      locked in the CI script.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
    • Branislav Kontur's avatar
      Attempt to avoid specifying `BlockHashCount` for different... · ef144b1a
      Branislav Kontur authored
      Attempt to avoid specifying `BlockHashCount` for different `mocking::{MockBlock, MockBlockU32, MockBlockU128}` (#4543)
      
      While doing some migration/rebase I came in to the situation, where I
      needed to change `mocking::MockBlock` to `mocking::MockBlockU32`:
      ```
      #[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
      impl frame_system::Config for TestRuntime {
      	type Block = frame_system::mocking::MockBlockU32<TestRuntime>;
      	type AccountData = pallet_balances::AccountData<ThisChainBalance>;
      }
      ```
      But actual `TestDefaultConfig` for `frame_system` is using `ConstU64`
      for `type BlockHashCount = frame_support::traits::ConstU64<10>;`
      [here](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/system/src/lib.rs#L303).
      Because of this, it force me to specify and add override for `type
      BlockHashCount = ConstU32<10>`.
      
      This PR tries to fix this with `TestBlockHashCount` implementation for
      `TestDefaultConfig` which supports `u32`, `u64` and `u128` as a
      `BlockNumber`.
      
      ### How to simulate error
      Just by removing `type BlockHashCount = ConstU32<250>;`
      [here](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/multisig/src/tests.rs#L44)
      ```
      :~/parity/olkadot-sdk$ cargo test -p pallet-multisig
         Compiling pallet-multisig v28.0.0 (/home/bparity/parity/aaa/polkadot-sdk/substrate/frame/multisig)
      error[E0277]: the trait bound `ConstU64<10>: frame_support::traits::Get<u32>` is not satisfied
         --> substrate/frame/multisig/src/tests.rs:41:1
          |
      41  | #[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
          | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `frame_support::traits::Get<u32>` is not implemented for `ConstU64<10>`
          |
          = help: the following other types implement trait `frame_support::traits::Get<T>`:
                    <ConstU64<T> as frame_support::traits::Get<u64>>
                    <ConstU64<T> as frame_support::traits::Get<std::option::Option<u64>>>
      note: required by a bound in `frame_system::Config::BlockHashCount`
         --> /home/bparity/parity/aaa/polkadot-sdk/substrate/frame/system/src/lib.rs:535:24
          |
      535 |         type BlockHashCount: Get<BlockNumberFor<Self>>;
          |                              ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Config::BlockHashCount`
          = note: this error originates in the attribute macro `derive_impl` which comes from the expansion of the macro `frame_support::macro_magic::forward_tokens_verbatim` (in Nightly builds, run with -Z macro-backtrace for more info)
      
      For more information about this error, try `rustc --explain E0277`.
      error: could not compile `pallet-multisig` (lib test) due to 1 previous error 
      ```
      
      
      
      
      ## For reviewers:
      
      (If there is a better solution, please let me know!)
      
      The first commit contains actual attempt to fix the problem:
      https://github.com/paritytech/polkadot-sdk/commit/3c5499e5
      
      .
      The second commit is just removal of `BlockHashCount` from all other
      places where not needed by default.
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/1657
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <git@kchr.de>
  10. May 22, 2024
  11. May 21, 2024
  12. May 19, 2024
  13. May 16, 2024
    • Oliver Tale-Yazdi's avatar
      [Runtime] Bound XCMP queue (#3952) · 4adfa37d
      Oliver Tale-Yazdi authored
      
      Re-applying #2302 after increasing the `MaxPageSize`.  
      
      Remove `without_storage_info` from the XCMP queue pallet. Part of
      https://github.com/paritytech/polkadot-sdk/issues/323
      
      Changes:
      - Limit the number of messages and signals a HRMP channel can have at
      most.
      - Limit the number of HRML channels.
      
      A No-OP migration is put in place to ensure that all `BoundedVec`s still
      decode and not truncate after upgrade. The storage version is thereby
      bumped to 5 to have our tooling remind us to deploy that migration.
      
      ## Integration
      
      If you see this error in your try-runtime-cli:  
      ```pre
      Max message size for channel is too large. This means that the V5 migration can be front-run and an
      attacker could place a large message just right before the migration to make other messages un-decodable.
      Please either increase `MaxPageSize` or decrease the `max_message_size` for this channel. Channel max:
      102400, MaxPageSize: 65535
      ```
      
      Then increase the `MaxPageSize` of the `cumulus_pallet_xcmp_queue` to
      something like this:
      ```rust
      type MaxPageSize = ConstU32<{ 103 * 1024 }>;
      ```
      
      There is currently no easy way for on-chain governance to adjust the
      HRMP max message size of all channels, but it could be done:
      https://github.com/paritytech/polkadot-sdk/issues/3145.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
      Co-authored-by: default avatarFrancisco Aguirre <franciscoaguirreperez@gmail.com>
    • Francisco Aguirre's avatar
      XCM Cookbook (#2633) · 289f5bbf
      Francisco Aguirre authored
      # Context
      
      XCM docs are currently an md book hosted with github pages:
      https://paritytech.github.io/xcm-docs/.
      While that's fine, it's not in line with the work being done in the
      polkadot-sdk docs.
      
      # Main addition
      
      This PR aims to fix that by bringing the docs back to this repo.
      This does not have all the information currently present in the mdbook
      xcm-docs but aims to be a good chunk of it and fully replace it over
      time.
      
      I also added the sections `guides` and `cookbook` which will be very
      useful for users wanting to get into XCM.
      For now I only added one example to the cookbook, but have ideas for
      guides and more examples.
      Having this docs be in rust docs is very useful for the cookbook.
      
      # TODO
      
      - [x] Use `FungibleAdapter`
      - [x] Improve and relocate mock message queue
      - [x] Fix license issue. Why does docs/sdk/ not have this problem? (Just
      added the licenses)
      
      # Next steps
      
      - More examples in the cookbook
      - End-to-end XCM guide with zombienet testing
      
      ---------
      
      Co-authored-by: co...
  14. May 15, 2024
  15. May 14, 2024
    • dependabot[bot]'s avatar
      Bump nix from 0.27.1 to 0.28.0 (#4438) · 712a750a
      dependabot[bot] authored
      
      Bumps [nix](https://github.com/nix-rust/nix) from 0.27.1 to 0.28.0.
      <details>
      <summary>Changelog</summary>
      <p><em>Sourced from <a
      href="https://github.com/nix-rust/nix/blob/master/CHANGELOG.md">nix's
      changelog</a>.</em></p>
      <blockquote>
      <h2>[0.28.0] - 2024-02-24</h2>
      <h3>Added</h3>
      <ul>
      <li>
      <p>Added <code>mkdtemp</code> wrapper (<a
      href="https://redirect.github.com/nix-rust/nix/pull/1297">#1297</a>)</p>
      </li>
      <li>
      <p>Add associated constants <code>UTIME_OMIT</code>
      <code>UTIME_NOW</code> for <code>TimeSpec</code>
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/1879">#1879</a>)</p>
      </li>
      <li>
      <p>Added <code>EventFd</code> type. (<a
      href="https://redirect.github.com/nix-rust/nix/pull/1945">#1945</a>)</p>
      </li>
      <li>
      <ul>
      <li>Added <code>impl From&lt;Signal&gt; for SigSet</code>.</li>
      <li>Added <code>impl std::ops::BitOr for SigSet</code>.</li>
      <li>Added <code>impl std::ops::BitOr for Signal</code>.</li>
      <li>Added <code>impl std::ops::BitOr&lt;Signal&gt; for
      SigSet</code></li>
      </ul>
      <p>(<a
      href="https://redirect.github.com/nix-rust/nix/pull/1959">#1959</a>)</p>
      </li>
      <li>
      <p>Added <code>TlsGetRecordType</code> control message type and
      corresponding enum for
      linux (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2065">#2065</a>)</p>
      </li>
      <li>
      <p>Added <code>Ipv6HopLimit</code> to
      <code>::nix::sys::socket::ControlMessage</code> for Linux,
      MacOS, FreeBSD, DragonflyBSD, Android, iOS and Haiku.
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2074">#2074</a>)</p>
      </li>
      <li>
      <p>Added <code>Icmp</code> and <code>IcmpV6</code> to
      <code>SockProtocol</code>
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2103">#2103</a>)</p>
      </li>
      <li>
      <p>Added rfork support for FreeBSD in <code>unistd</code>
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2121">#2121</a>)</p>
      </li>
      <li>
      <p>Added <code>MapFlags::map_hugetlb_with_size_log2</code> method for
      Linux targets
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2125">#2125</a>)</p>
      </li>
      <li>
      <p>Added <code>mmap_anonymous</code> function
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2127">#2127</a>)</p>
      </li>
      <li>
      <p>Added <code>mips32r6</code> and <code>mips64r6</code> support for
      signal, ioctl and ptrace
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2138">#2138</a>)</p>
      </li>
      <li>
      <p>Added <code>F_GETPATH</code> FcntlFlags entry on
      Apple/NetBSD/DragonflyBSD for
      <code>::nix::fcntl</code>. (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2142">#2142</a>)</p>
      </li>
      <li>
      <p>Added <code>F_KINFO</code> FcntlFlags entry on FreeBSD for
      <code>::nix::fcntl</code>.
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2152">#2152</a>)</p>
      </li>
      <li>
      <p>Added <code>F_GETPATH_NOFIRMLINK</code> and
      <code>F_BARRIERFSYNC</code> FcntlFlags entry
      on Apple for <code>::nix::fcntl</code>.
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2155">#2155</a>)</p>
      </li>
      <li>
      <p>Added newtype <code>Flock</code> to automatically unlock a held flock
      upon drop.
      Added <code>Flockable</code> trait to represent valid types for
      <code>Flock</code>.
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2170">#2170</a>)</p>
      </li>
      <li>
      <p>Added <code>SetSockOpt</code> impls to enable Linux Kernel TLS on a
      TCP socket and to
      import TLS parameters. (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2175">#2175</a>)</p>
      </li>
      <li>
      <ul>
      <li>Added the <code>::nix::sys::socket::SocketTimestamp</code> enum for
      configuring the
      <code>TsClock</code> (a.k.a <code>SO_TS_CLOCK</code>) sockopt</li>
      <li>Added FreeBSD's <code>ScmRealtime</code> and
      <code>ScmMonotonic</code> as new options in
      <code>::nix::sys::socket::ControlMessageOwned</code></li>
      </ul>
      <p>(<a
      href="https://redirect.github.com/nix-rust/nix/pull/2187">#2187</a>)</p>
      </li>
      <li>
      <p>Added new fanotify API: wrappers for <code>fanotify_init</code> and
      <code>fanotify_mark</code>
      (<a
      href="https://redirect.github.com/nix-rust/nix/pull/2194">#2194</a>)</p>
      </li>
      </ul>
      <!-- raw HTML omitted -->
      </blockquote>
      <p>... (truncated)</p>
      </details>
      <details>
      <summary>Commits</summary>
      <ul>
      <li><a
      href="https://github.com/nix-rust/nix/commit/21ab06ef23de214174ddb039be5b5f08750d19e6"><code>21ab06e</code></a>
      chore: release 0.8.0</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/595c6eb2515723eae1f1db1b9103c95f339380ec"><code>595c6eb</code></a>
      chore: changelog for 0.28.0 (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2303">#2303</a>)</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/79b86a7dff071a2a59858d1c98e202fdf38ebd06"><code>79b86a7</code></a>
      mmsg revert signature simplification (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2227">#2227</a>)</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/08e05a5f66d14d4f06288c9a725e87f473eba41a"><code>08e05a5</code></a>
      refactor: remove redundant imports to fix CI (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2320">#2320</a>)</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/197f55b3ccbce3273bf6ce119d1a8541b5df5d66"><code>197f55b</code></a>
      refactor: update nix (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2311">#2311</a>)</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/f34d00d353a8ebcb16eb8810b00d613e4a294925"><code>f34d00d</code></a>
      chore(deps): try libc 0.2.153 (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2309">#2309</a>)</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/062f6c0f0306743a401138fc2612d59e818d5768"><code>062f6c0</code></a>
      test: clean clippy needless_borrow false positive issue (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2310">#2310</a>)</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/ca173ff30cc42e0fc7a7ba2cf7c1fcbe61dccfa5"><code>ca173ff</code></a>
      Fix the mount tests (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2269">#2269</a>)</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/0dfcf3228489a5060a53e69783a1eea6f43b11a9"><code>0dfcf32</code></a>
      test: tweak test_fanotify to monitor ONLY 1 file (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2294">#2294</a>)</li>
      <li><a
      href="https://github.com/nix-rust/nix/commit/0fb346031f6ddc87a57377101a6063133a25e443"><code>0fb3460</code></a>
      Temporarily disable CI on GNU hurd (<a
      href="https://redirect.github.com/nix-rust/nix/issues/2307">#2307</a>)</li>
      <li>Additional commits viewable in <a
      href="https://github.com/nix-rust/nix/compare/v0.27.1...v0.28.0">compare
      view</a></li>
      </ul>
      </details>
      <br />
      
      
      [![Dependabot compatibility
      score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nix&package-manager=cargo&previous-version=0.27.1&new-version=0.28.0)](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 this major version` will close this PR and stop
      Dependabot creating any more for this major version (unless you reopen
      the PR or upgrade to it yourself)
      - `@dependabot ignore this minor version` will close this PR and stop
      Dependabot creating any more for this minor version (unless you reopen
      the PR or upgrade to it yourself)
      - `@dependabot ignore this dependency` will close this PR and stop
      Dependabot creating any more for this dependency (unless you reopen the
      PR or upgrade to it yourself)
      
      
      </details>
      
      Signed-off-by: default avatardependabot[bot] <support@github.com>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  16. May 13, 2024
    • Tsvetomir Dimitrov's avatar
      Bump `proc-macro-crate` to the latest version (#4409) · fb7362f6
      Tsvetomir Dimitrov authored
      This PR bumps `proc-macro-crate` to the latest version.
      
      In order to test a runtime from
      https://github.com/polkadot-fellows/runtimes/ with the latest version of
      polkadot-sdk one needs to use `cargo vendor` to extract all runtime
      dependencies, patch them by hand and then build the runtime.
      
      However at the moment 'vendored' builds fail due to
      https://github.com/bkchr/proc-macro-crate/issues/48. To fix this
      `proc-macro-crate` should be updated to version `3.0.1` or higher.
      
      ---------
      
      Co-authored-by: command-bot <>
    • Alin Dima's avatar
      prospective-parachains rework (#4035) · d36da12e
      Alin Dima authored
      
      Reworks prospective-parachains so that we allow a number of unconnected
      candidates (for which we don't know the parent candidate yet). Needed
      for elastic scaling:
      https://github.com/paritytech/polkadot-sdk/issues/3541. Without this,
      candidate B will not be validated and backed until candidate A (its
      parent) is validated and a backing statement reaches the validator.
      
      Due to the high complexity of the subsystem, I rewrote parts of it so
      that we don't concern ourselves with candidates which form cycles or
      which form parachain forks. We now have "Fragment chains" instead of
      "Fragment trees". This greatly simplifies some of the code and is a
      compromise we can make. We just need to make sure that cycle-producing
      parachains don't brick the relay chain and that fork-producing
      parachains can still make some progress (on one core at least). The only
      forks that are allowed are those on the relay chain, obviously.
      
      Unconnected candidates are kept in the `CandidateStorage` and whenever a
      new candidate is introduced, we try to repopulate the chain with as many
      candidates as we can.
      
      Also fixes https://github.com/paritytech/polkadot-sdk/issues/3219
      
      Guide changes will be done as part of:
      https://github.com/paritytech/polkadot-sdk/issues/3699
      
      TODOs:
      
      - [x] see if we can replace the `Cow` over the candidate commitments
      with an `Arc` over the entire `ProspectiveCandidate`. It's only being
      overwritten in unit tests. We can work around that.
      - [x] finish fragment_chain unit tests
      - [x] add more prospective-parachains subsystem tests
      - [x] test with zombienet what happens if a parachain is creating cycles
      (it should not brick the relay chain).
      - [x] test with zombienet a parachain that is creating forks. it should
      keep producing blocks from time to time (one bad collator should not DOS
      the parachain, even if throughput decreases)
      - [x] add some more logs and metrics
      - [x] add prdoc and remove the "silent" label
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <andrei-mihail@parity.io>
      Co-authored-by: default avatarAndrei Sandu <andrei-mihail@parity.io>
    • Serban Iorga's avatar
      Add generate and verify logic for `AncestryProof` (#4430) · f4b73bd1
      Serban Iorga authored
      Extracting the logic for generating and verifying ancestry proofs from
      this PR: https://github.com/paritytech/polkadot-sdk/pull/1903 with small
      adjustments
      
      @Lederstrumpf I added you as a co-author to each commit. Please let me
      know if you want me to also associate an e-mail address with your name
  17. May 10, 2024
  18. May 09, 2024
    • Niklas Adolfsson's avatar
      rpc: add option to `whitelist ips` in rate limiting (#3701) · d37719da
      Niklas Adolfsson authored
      This PR adds two new CLI options to disable rate limiting for certain ip
      addresses and whether to trust "proxy header".
      After going back in forth I decided to use ip addr instead host because
      we don't want rely on the host header which can be spoofed but another
      solution is to resolve the ip addr from the socket to host name.
      
      Example:
      
      ```bash
      $ polkadot --rpc-rate-limit 10 --rpc-rate-limit-whitelisted-ips 127.0.0.1/8 --rpc-rate-limit-trust-proxy-headers
      ```
      
      The ip addr is read from the HTTP proxy headers `Forwarded`,
      `X-Forwarded-For` `X-Real-IP` if `--rpc-rate-limit-trust-proxy-headers`
      is enabled if that is not enabled or the headers are not found then the
      ip address is read from the socket.
      
      //cc @BulatSaif can you test this and give some feedback on it?