1. Jan 28, 2024
  2. Jan 26, 2024
  3. Jan 25, 2024
  4. Jan 24, 2024
  5. Jan 23, 2024
    • Branislav Kontur's avatar
      Various nits and alignments for testnet runtimes (#3024) · a817d310
      Branislav Kontur authored
      There were several improvements and PRs that didn't apply to all
      runtimes, so this PR attempts to align those small differences. In
      addition, the PR eliminates unused dependencies across multiple modules.
      
      Relates to PR for `polkadot-fellows`:
      https://github.com/polkadot-fellows/runtimes/pull/154
      a817d310
    • Andrei Sandu's avatar
      approval-distribution: aggresion must target unfinalized chain rather than unapproved chain (#2988) · b4dfad83
      Andrei Sandu authored
      
      
      Found the issue while investigating the recent finality stall on Westend
      after upgrading to 1.6.0. Approval distribution aggression is supposed
      to trade off bandwidth and re-send assignemnts/approvals until enough
      approvals are be received by at least 2/3 validators. This is supposed
      to be a catch all mechanism when network connectivity goes south or many
      validators reboot at the same time.
      
      This fix ensures that we always resend approvals starting with the first
      unfinalized block even in the case when it appears approved from the
      node's perspective.
      
      TODO:
      - [x] Versi test
      
      ---------
      
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      b4dfad83
    • joe petrowski's avatar
    • Niklas Adolfsson's avatar
      rpc: backpressured RPC server (bump jsonrpsee 0.20) (#1313) · e16ef086
      Niklas Adolfsson authored
      This is a rather big change in jsonrpsee, the major things in this bump
      are:
      - Server backpressure (the subscription impls are modified to deal with
      that)
      - Allow custom error types / return types (remove jsonrpsee::core::Error
      and jsonrpee::core::CallError)
      - Bug fixes (graceful shutdown in particular not used by substrate
      anyway)
         - Less dependencies for the clients in particular
         - Return type requires Clone in method call responses
         - Moved to tokio channels
         - Async subscription API (not used in this PR)
      
      Major changes in this PR:
      - The subscriptions are now bounded and if subscription can't keep up
      with the server it is dropped
      - CLI: add parameter to configure the jsonrpc server bounded message
      buffer (default is 64)
      - Add our own subscription helper to deal with the unbounded streams in
      substrate
      
      The most important things in this PR to review is the added helpers
      functions in `substrate/client/rpc/src/utils.rs` and the rest is pretty
      much chore.
      
      Regarding the "bounded buffer limit" it may cause the server to handle
      the JSON-RPC calls
      slower than before.
      
      The message size limit is bounded by "--rpc-response-size" thus "by
      default 10MB * 64 = 640MB"
      but the subscription message size is not covered by this limit and could
      be capped as well.
      
      Hopefully the last release prior to 1.0, sorry in advance for a big PR
      
      Previous attempt: https://github.com/paritytech/substrate/pull/13992
      
      Resolves https://github.com/paritytech/polkadot-sdk/issues/748, resolves
      https://github.com/paritytech/polkadot-sdk/issues/627
      e16ef086
    • Francisco Aguirre's avatar
      Add unit impl for XcmAssetTransfers trait (#3022) · 1417a026
      Francisco Aguirre authored
      If an Executor is required in some pallet's config, a mock might be
      provided where `Executor = ()`. `()` already implements `ExecuteXcm`,
      but not `XcmAssetTransfers`, which is also related. This PR just fixes
      that so you can skip having to create a whole xcm configuration, which
      is non-trivial right now.
      1417a026
  6. Jan 22, 2024
  7. Jan 21, 2024
  8. Jan 20, 2024
  9. Jan 19, 2024
  10. Jan 18, 2024
  11. Jan 17, 2024
  12. Jan 16, 2024
    • Francisco Aguirre's avatar
      XCMv4 (#1230) · 8428f678
      Francisco Aguirre authored
      
      
      # Note for reviewer
      
      Most changes are just syntax changes necessary for the new version.
      Most important files should be the ones under the `xcm` folder.
      
      # Description 
      
      Added XCMv4.
      
      ## Removed `Multi` prefix
      The following types have been renamed:
      - MultiLocation -> Location
      - MultiAsset -> Asset
      - MultiAssets -> Assets
      - InteriorMultiLocation -> InteriorLocation
      - MultiAssetFilter -> AssetFilter
      - VersionedMultiAsset -> VersionedAsset
      - WildMultiAsset -> WildAsset
      - VersionedMultiLocation -> VersionedLocation
      
      In order to fix a name conflict, the `Assets` in `xcm-executor` were
      renamed to `HoldingAssets`, as they represent assets in holding.
      
      ## Removed `Abstract` asset id
      
      It was not being used anywhere and this simplifies the code.
      
      Now assets are just constructed as follows:
      
      ```rust
      let asset: Asset = (AssetId(Location::new(1, Here)), 100u128).into();
      ```
      
      No need for specifying `Concrete` anymore.
      
      ## Outcome is now a named fields struct
      
      Instead of
      
      ```rust
      pub enum Outcome {
        Complete(Weight),
        Incomplete(Weight, Error),
        Error(Error),
      }
      ```
      
      we now have
      
      ```rust
      pub enum Outcome {
        Complete { used: Weight },
        Incomplete { used: Weight, error: Error },
        Error { error: Error },
      }
      ```
      
      ## Added Reanchorable trait
      
      Now both locations and assets implement this trait, making it easier to
      reanchor both.
      
      ## New syntax for building locations and junctions
      
      Now junctions are built using the following methods:
      
      ```rust
      let location = Location {
          parents: 1,
          interior: [Parachain(1000), PalletInstance(50), GeneralIndex(1984)].into()
      };
      ```
      
      or
      
      ```rust
      let location = Location::new(1, [Parachain(1000), PalletInstance(50), GeneralIndex(1984)]);
      ```
      
      And they are matched like so:
      
      ```rust
      match location.unpack() {
        (1, [Parachain(id)]) => ...
        (0, Here) => ...,
        (1, [_]) => ...,
      }
      ```
      
      This syntax is mandatory in v4, and has been also implemented for v2 and
      v3 for easier migration.
      
      This was needed to make all sizes smaller.
      
      # TODO
      - [x] Scaffold v4
      - [x] Port github.com/paritytech/polkadot/pull/7236
      - [x] Remove `Multi` prefix
      - [x] Remove `Abstract` asset id
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      8428f678
    • Andrei Eres's avatar
      subsystem-bench: cache misses profiling (#2893) · ec7bfae0
      Andrei Eres authored
      ## Why we need it
      To provide another level of understanding to why polkadot's subsystems
      may perform slower than expected. Cache misses occur when processing
      large amounts of data, such as during availability recovery.
      
      ## Why Cachegrind
      Cachegrind has many drawbacks: it is slow, it uses its own cache
      simulation, which is very basic. But unlike `perf`, which is a great
      tool, Cachegrind can run in a virtual machine. This means we can easily
      run it in remote installations and even use it in CI/CD to catch
      possible regressions.
      
      Why Cachegrind and not Callgrind, another part of Valgrind? It is simply
      empirically proven that profiling runs faster with Cachegrind.
      
      ## First results
      First results have been obtained while testing of the approach. Here is
      an example.
      
      ```
      $ target/testnet/subsystem-bench --n-cores 10 --cache-misses data-availability-read
      $ cat cachegrind_report.txt
      I refs:        64,622,081,485
      I1  misses:         3,018,168
      LLi misses:           437,654
      I1  miss rate:           0.00%
      LLi miss rate:           0.00%
      
      D refs:        12,161,833,115  (9,868,356,364 rd   + 2,293,476,751 wr)
      D1  misses:       167,940,701  (   71,060,073 rd   +    96,880,628 wr)
      LLd misses:        33,550,018  (   16,685,853 rd   +    16,864,165 wr)
      D1  miss rate:            1.4% (          0.7%     +           4.2%  )
      LLd miss rate:            0.3% (          0.2%     +           0.7%  )
      
      LL refs:          170,958,869  (   74,078,241 rd   +    96,880,628 wr)
      LL misses:         33,987,672  (   17,123,507 rd   +    16,864,165 wr)
      LL miss rate:             0.0% (          0.0%     +           0.7%  )
      ```
      
      The CLI output shows that 1.4% of the L1 data cache missed, which is not
      so bad, given that the last-level cache had that data most of the time
      missing only 0.3%. Instruction data of the L1 has 0.00% misses of the
      time. Looking at an output file with `cg_annotate` shows that most of
      the misses occur during reed-solomon, which is expected.
      ec7bfae0
    • Dónal Murray's avatar
      Bump rococo relay and coretime-rococo to 1.6 (#2913) · a42a47f8
      Dónal Murray authored
      Co-authored-by: command-bot <>
      a42a47f8
  13. Jan 15, 2024
  14. Jan 12, 2024
    • Javier Viola's avatar
      Bump zombienet version `v1.3.91` (#2912) · c421b879
      Javier Viola authored
      This version includes
      - Performance improvements.
      - Minor fixes.
      c421b879
    • Dmitry Markin's avatar
      Extract warp sync strategy from `ChainSync` (#2467) · 5208bed7
      Dmitry Markin authored
      
      
      Extract `WarpSync` (and `StateSync` as part of warp sync) from
      `ChainSync` as independent syncing strategy called by `SyncingEngine`.
      Introduce `SyncingStrategy` enum as a proxy between `SyncingEngine` and
      specific syncing strategies.
      
      ## Limitations
      Gap sync is kept in `ChainSync` for now because it shares the same set
      of peers as block syncing implementation in `ChainSync`. Extraction of a
      common context responsible for peer management in syncing strategies
      able to run in parallel is planned for a follow-up PR.
      
      ## Further improvements
      A possibility of conversion of `SyncingStartegy` into a trait should be
      evaluated. The main stopper for this is that different strategies need
      to communicate different actions to `SyncingEngine` and respond to
      different events / provide different APIs (e.g., requesting
      justifications is only possible via `ChainSync` and not through
      `WarpSync`; `SendWarpProofRequest` action is only relevant to
      `WarpSync`, etc.)
      
      ---------
      
      Co-authored-by: default avatarAaro Altonen <[email protected]>
      5208bed7