1. Mar 08, 2024
  2. Mar 07, 2024
  3. Mar 06, 2024
  4. Mar 05, 2024
  5. Mar 04, 2024
  6. Mar 03, 2024
  7. Mar 02, 2024
    • gupnik's avatar
      Remove `as frame_system::DefaultConfig` from the required syntax in `derive_impl` (#3505) · cdc8d197
      gupnik authored
      Step in https://github.com/paritytech/polkadot-sdk/issues/171
      
      This PR removes the need to specify `as [disambiguation_path]` for cases
      where the trait definition resides within the same scope as default impl
      path.
      
      For example, in the following macro invocation
      ```rust
      #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
      impl frame_system::Config for Runtime {
         ...
      }
      ```
      the trait `DefaultConfig` lies within the `frame_system` scope and
      `TestDefaultConfig` impls the `DefaultConfig` trait. Using this
      information, we can compute the disambiguation path internally, thus
      removing the need of an explicit specification.
      
      In cases where the trait lies outside this scope, we would still need to
      specify it explicitly, but this should take care of most (if not all)
      uses of `derive_impl` within FRAME's context.
      cdc8d197
  8. Mar 01, 2024
    • Alin Dima's avatar
      provisioner: allow multiple cores assigned to the same para (#3233) · 62b78a16
      Alin Dima authored
      https://github.com/paritytech/polkadot-sdk/issues/3130
      
      builds on top of https://github.com/paritytech/polkadot-sdk/pull/3160
      
      Processes the availability cores and builds a record of how many
      candidates it should request from prospective-parachains and their
      predecessors.
      Tries to supply as many candidates as the runtime can back. Note that
      the runtime changes to back multiple candidates per para are not yet
      done, but this paves the way for it.
      
      The following backing/inclusion policy is assumed:
      1. the runtime will never back candidates of the same para which don't
      form a chain with the already backed candidates. Even if the others are
      still pending availability. We're optimistic that they won't time out
      and we don't want to back parachain forks (as the complexity would be
      huge).
      2. if a candidate is timed out of the core before being included, all of
      its successors occupying a core will be evicted.
      3. only the candidates which are made available and form a chain
      starting from the on-chain para head may be included/enacted and cleared
      from the cores. In other words, if para head is at A and the cores are
      occupied by B->C->D, and B and D are made available, only B will be
      included and its core cleared. C and D will remain on the cores awaiting
      for C to be made available or timed out. As point (2) above already
      says, if C is timed out, D will also be dropped.
      4. The runtime will deduplicate candidates which form a cycle. For
      example if the provisioner supplies candidates A->B->A, the runtime will
      only back A (as the state output will be the same)
      
      Note that if a candidate is timed out, we don't guarantee that in the
      next relay chain block the block author will be able to fill all of the
      timed out cores of the para. That increases complexity by a lot.
      Instead, the provisioner will supply N candidates where N is the number
      of candidates timed out, but doesn't include their successors which will
      be also deleted by the runtime. This'll be backfilled in the next relay
      chain block.
      
      Adjacent changes:
      - Also fixes: https://github.com/paritytech/polkadot-sdk/issues/3141
      - For non prospective-parachains, don't supply multiple candidates per
      para (we can't have elastic scaling without prospective parachains
      enabled). paras_inherent should already sanitise this input but it's
      more efficient this way.
      
      Note: all of these changes are backwards-compatible with the
      non-elastic-scaling scenario (one core per para).
      62b78a16
    • Andrei Eres's avatar
      subsystem-bench: add regression tests for availability read and write (#3311) · f0e589d7
      Andrei Eres authored
      ### What's been done
      - `subsystem-bench` has been split into two parts: a cli benchmark
      runner and a library.
      - The cli runner is quite simple. It just allows us to run `.yaml` based
      test sequences. Now it should only be used to run benchmarks during
      development.
      - The library is used in the cli runner and in regression tests. Some
      code is changed to make the library independent of the runner.
      - Added first regression tests for availability read and write that
      replicate existing test sequences.
      
      ### How we run regression tests
      - Regression tests are simply rust integration tests without the
      harnesses.
      - They should only be compiled under the `subsystem-benchmarks` feature
      to prevent them from running with other tests.
      - This doesn't work when running tests with `nextest` in CI, so
      additional filters have been added to the `nextest` runs.
      - Each benchmark run takes a different time in the beginning, so we
      "warm up" the tests until their CPU usage differs by only 1%.
      - After the warm-up, we run the benchmarks a few more times and compare
      the average with the exception using a precision.
      
      ### What is still wrong?
      - I haven't managed to set up approval voting tests. The spread of their
      results is too large and can't be narrowed down in a reasonable amount
      of time in the warm-up phase.
      - The tests start an unconfigurable prometheus endpoint inside, which
      causes errors because they use the same 9999 port. I disable it with a
      flag, but I think it's better to extract the endpoint launching outside
      the test, as we already do with `valgrind` and `pyroscope`. But we still
      use `prometheus` inside the tests.
      
      ### Future work
      * https://github.com/paritytech/polkadot-sdk/issues/3528
      * https://github.com/paritytech/polkadot-sdk/issues/3529
      * https://github.com/paritytech/polkadot-sdk/issues/3530
      * https://github.com/paritytech/polkadot-sdk/issues/3531
      
      
      
      ---------
      
      Co-authored-by: default avatarAlexander Samusev <[email protected]>
      f0e589d7
    • Xiliang Chen's avatar
      make SelfParaId a metadata constant (#3517) · 6f81a4a0
      Xiliang Chen authored
      expose para id via metadata
      
      #2116 is blocked by this
      6f81a4a0