1. Apr 25, 2024
    • Andrei Eres's avatar
      8f5c8f73
    • Alin Dima's avatar
    • s0me0ne-unkn0wn's avatar
      Do not re-prepare PVFs if not needed (#4211) · c26cf3f6
      s0me0ne-unkn0wn authored
      Currently, PVFs are re-prepared if any execution environment parameter
      changes. As we've recently seen on Kusama and Polkadot, that may lead to
      a severe finality lag because every validator has to re-prepare every
      PVF. That cannot be avoided altogether; however, we could cease
      re-preparing PVFs when a change in the execution environment can't lead
      to a change in the artifact itself. For example, it's clear that
      changing the execution timeout cannot affect the artifact.
      
      In this PR, I'm introducing a separate hash for the subset of execution
      environment parameters that changes only if a preparation-related
      parameter changes. It introduces some minor code duplication, but
      without that, the scope of changes would be much bigger.
      
      TODO:
      - [x] Add a test to ensure the artifact is not re-prepared if
      non-preparation-related parameter is changed
      - [x] Add a test to ensure the artifact is re-prepared if a
      preparation-related parameter is changed
      - [x] Add comments, warnings, and, possibly, a test to ensure a new
      parameter ever added to the executor environment parameters will be
      evaluated by the author of changes with respect to its artifact
      preparation impact and added to the new hash preimage if needed.
      
      Closes #4132
      c26cf3f6
  2. Apr 24, 2024
  3. Apr 23, 2024
  4. Apr 22, 2024
  5. Apr 19, 2024
  6. Apr 18, 2024
  7. Apr 16, 2024
  8. Apr 12, 2024
  9. Apr 08, 2024
  10. Apr 05, 2024
  11. Apr 02, 2024
  12. Apr 01, 2024
  13. Mar 28, 2024
  14. Mar 26, 2024
    • ordian's avatar
      fix regression in approval-voting introduced in #3747 (#3831) · 3fc5b826
      ordian authored
      
      
      Fixes #3826.
      
      The docs on the `candidates` field of `BlockEntry` were incorrectly
      stating that they are sorted by core index. The (incorrect) optimization
      was introduced in #3747 based on this assumption. The actual ordering is
      based on `CandidateIncluded` events ordering in the runtime. We revert
      this optimization here.
      
      - [x] verify the underlying issue
      - [x] add a regression test
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      3fc5b826
    • Dcompoze's avatar
      Fix spelling mistakes across the whole repository (#3808) · 002d9260
      Dcompoze authored
      **Update:** Pushed additional changes based on the review comments.
      
      **This pull request fixes various spelling mistakes in this
      repository.**
      
      Most of the changes are contained in the first **3** commits:
      
      - `Fix spelling mistakes in comments and docs`
      
      - `Fix spelling mistakes in test names`
      
      - `Fix spelling mistakes in error messages, panic messages, logs and
      tracing`
      
      Other source code spelling mistakes are separated into individual
      commits for easier reviewing:
      
      - `Fix the spelling of 'authority'`
      
      - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'`
      
      - `Fix the spelling of 'prev_enqueud_messages'`
      
      - `Fix the spelling of 'endpoint'`
      
      - `Fix the spelling of 'children'`
      
      - `Fix the spelling of 'PenpalSiblingSovereignAccount'`
      
      - `Fix the spelling of 'PenpalSudoAccount'`
      
      - `Fix the spelling of 'insufficient'`
      
      - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'`
      
      - `Fix the spelling of 'subtracted'`
      
      - `Fix the spelling of 'CandidatePendingAvailability'`
      
      - `Fix the spelling of 'exclusive'`
      
      - `Fix the spelling of 'until'`
      
      - `Fix the spelling of 'discriminator'`
      
      - `Fix the spelling of 'nonexistent'`
      
      - `Fix the spelling of 'subsystem'`
      
      - `Fix the spelling of 'indices'`
      
      - `Fix the spelling of 'committed'`
      
      - `Fix the spelling of 'topology'`
      
      - `Fix the spelling of 'response'`
      
      - `Fix the spelling of 'beneficiary'`
      
      - `Fix the spelling of 'formatted'`
      
      - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'`
      
      - `Fix the spelling of 'succeeded'`
      
      - `Fix the spelling of 'reopened'`
      
      - `Fix the spelling of 'proposer'`
      
      - `Fix the spelling of 'InstantiationNonce'`
      
      - `Fix the spelling of 'depositor'`
      
      - `Fix the spelling of 'expiration'`
      
      - `Fix the spelling of 'phantom'`
      
      - `Fix the spelling of 'AggregatedKeyValue'`
      
      - `Fix the spelling of 'randomness'`
      
      - `Fix the spelling of 'defendant'`
      
      - `Fix the spelling of 'AquaticMammal'`
      
      - `Fix the spelling of 'transactions'`
      
      - `Fix the spelling of 'PassingTracingSubscriber'`
      
      - `Fix the spelling of 'TxSignaturePayload'`
      
      - `Fix the spelling of 'versioning'`
      
      - `Fix the spelling of 'descendant'`
      
      - `Fix the spelling of 'overridden'`
      
      - `Fix the spelling of 'network'`
      
      Let me know if this structure is adequate.
      
      **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`,
      `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it
      as it is.
      
      ~~**Note:** In some places the term `Receival` is used to refer to
      message reception, IMO `Reception` is the correct word here, but I left
      it as it is.~~
      
      ~~**Note:** In some places the term `Overlayed` is used instead of the
      more acceptable version `Overlaid` but I also left it as it is.~~
      
      ~~**Note:** In some places the term `Applyable` is used instead of the
      correct version `Applicable` but I also left it as it is.~~
      
      **Note:** Some usage of British vs American english e.g. `judgement` vs
      `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc.
      are both present in different places, but I suppose that's
      understandable given the number of contributors.
      
      ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it
      triggers errors in CI when I make changes to it, so I left it as it
      is.~~
      002d9260
  15. Mar 25, 2024
  16. Mar 21, 2024
  17. Mar 20, 2024
  18. Mar 15, 2024
    • ordian's avatar
      collator protocol changes for elastic scaling (validator side) (#3302) · 02e1a7f4
      ordian authored
      Fixes #3128.
      
      This introduces a new variant for the collation response from the
      collator that includes the parent head data. For now, collators won't
      send this new variant. We'll need to change the collator side of the
      collator protocol to detect all the cores assigned to a para and send
      the parent head data in the case when it's more than 1 core.
      
      - [x] validate approach
      - [x] check head data hash
      02e1a7f4
  19. Mar 12, 2024
    • Alexandru Gheorghe's avatar
      Add api-name in `cannot query the runtime API version` warning (#3653) · 1ead5977
      Alexandru Gheorghe authored
      
      
      Sometimes we see nodes printing this warning:
      ```
      cannot query the runtime API version: Api called for an unknown Block: State already discarded for
      ```
      
      The log is harmless, but let's print the api we got this for, so that we
      can track its call site and truly confirm it is harmless or fix it.
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      1ead5977
    • Koute's avatar
      Add a PolkaVM-based executor (#3458) · b0f34e4b
      Koute authored
      This PR adds a new PolkaVM-based executor to Substrate.
      
      - The executor can now be used to actually run a PolkaVM-based runtime,
      and successfully produces blocks.
      - The executor is always compiled-in, but is disabled by default.
      - The `SUBSTRATE_ENABLE_POLKAVM` environment variable must be set to `1`
      to enable the executor, in which case the node will accept both WASM and
      PolkaVM program blobs (otherwise it'll default to WASM-only). This is
      deliberately undocumented and not explicitly exposed anywhere (e.g. in
      the command line arguments, or in the API) to disincentivize anyone from
      enabling it in production. If/when we'll move this into production usage
      I'll remove the environment variable and do it "properly".
      - I did not use our legacy runtime allocator for the PolkaVM executor,
      so currently every allocation inside of the runtime will leak guest
      memory until that particular instance is destroyed. The idea here is
      that I will work on the https://github.com/polkadot-fellows/RFCs/pull/4
      which will remove the need for the legacy allocator under WASM, and that
      will also allow us to use a proper non-leaking allocator under PolkaVM.
      - I also did some minor cleanups of the WASM executor and deleted some
      dead code.
      
      No prdocs included since this is not intended to be an end-user feature,
      but an unofficial experiment, and shouldn't affect any current
      production user. Once this is production-ready a full Polkadot
      Fellowship RFC will be necessary anyway.
      b0f34e4b
  20. Mar 08, 2024
  21. Mar 07, 2024
  22. 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
  23. Feb 29, 2024
  24. Feb 28, 2024
  25. Feb 23, 2024
  26. Feb 22, 2024
  27. Feb 20, 2024
    • Oliver Tale-Yazdi's avatar
      Lift dependencies to the workspace (Part 2/x) (#3366) · e89d0fca
      Oliver Tale-Yazdi authored
      
      
      Lifting some more dependencies to the workspace. Just using the
      most-often updated ones for now.
      It can be reproduced locally.
      
      ```sh
      # First you can check if there would be semver incompatible bumps (looks good in this case):
      $ zepter transpose dependency lift-to-workspace --ignore-errors syn quote thiserror "regex:^serde.*"
      
      # Then apply the changes:
      $ zepter transpose dependency lift-to-workspace --version-resolver=highest syn quote thiserror "regex:^serde.*" --fix
      
      # And format the changes:
      $ taplo format --config .config/taplo.toml
      ```
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      e89d0fca
    • Bastian Köcher's avatar
      Downgrade log message to `trace` (#3405) · ef6ac94f
      Bastian Köcher authored
      This spams logs in `Debug` with no useful information.
      ef6ac94f
  28. Feb 17, 2024