1. Jan 11, 2023
  2. Jan 10, 2023
    • Marcin S.'s avatar
      Minor fixes (#6533) · 3cf18f11
      Marcin S. authored
      * Minor fixes
      
      * Fix compile errors
      3cf18f11
    • Marcin S.'s avatar
      Replace async-std with tokio in PVF subsystem (#6419) · 44fd9566
      Marcin S. authored
      
      
      * Replace async-std with tokio in PVF subsystem
      
      * Rework workers to use `select!` instead of a mutex
      
      The improvement in code readability is more important than the thread overhead.
      
      * Remove unnecessary `fuse`
      
      * Add explanation for `expect()`
      
      * Update node/core/pvf/src/worker_common.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update node/core/pvf/src/worker_common.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Address some review comments
      
      * Shutdown tokio runtime
      
      * Run cargo fmt
      
      * Add a small note about retries
      
      * Fix up merge
      
      * Rework `cpu_time_monitor_loop` to return when other thread finishes
      
      * Add error string to PrepareError::IoErr variant
      
      * Log when artifacts fail to prepare
      
      * Fix `cpu_time_monitor_loop`; fix test
      
      * Fix text
      
      * Fix a couple of potential minor data races.
      
      First data race was due to logging in the CPU monitor thread even if the
      job (other thread) finished. It can technically finish before or after the log.
      
      Maybe best would be to move this log to the `select!`s, where we are guaranteed
      to have chosen the timed-out branch, although there would be a bit of
      duplication.
      
      Also, it was possible for this thread to complete before we executed
      `finished_tx.send` in the other thread, which would trigger an error as the
      receiver has already been dropped. And right now, such a spurious error from
      `send` would be returned even if the job otherwise succeeded.
      
      * Update Cargo.lock
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      44fd9566
  3. Jan 04, 2023
  4. Dec 20, 2022
    • Marcin S.'s avatar
      PVF preparation: do not conflate errors (#6384) · e0a0475a
      Marcin S. authored
      * PVF preparation: do not conflate errors
      
      + Adds some more granularity to the prepare errors.
      + Better distinguish whether errors occur on the host side or the worker.
      + Do not kill the worker if the error happened on the host side.
      + Do not retry preparation if the error was `Panic`.
      + Removes unnecessary indirection with `Selected` type.
      
      * Add missing docs, resolve TODOs
      
      * Address review comments and remove TODOs
      
      * Fix error in CI
      
      * Undo unnecessary change
      
      * Update couple of comments
      
      * Don't return error for stream shutdown
      
      * Update node/core/pvf/src/worker_common.rs
      e0a0475a
  5. Dec 06, 2022
  6. Dec 05, 2022
  7. Nov 30, 2022
    • Marcin S.'s avatar
      Use CPU clock timeout for PVF jobs (#6282) · 28a4e909
      Marcin S. authored
      * Put in skeleton logic for CPU-time-preparation
      
      Still needed:
      - Flesh out logic
      - Refactor some spots
      - Tests
      
      * Continue filling in logic for prepare worker CPU time changes
      
      * Fix compiler errors
      
      * Update lenience factor
      
      * Fix some clippy lints for PVF module
      
      * Fix compilation errors
      
      * Address some review comments
      
      * Add logging
      
      * Add another log
      
      * Address some review comments; change Mutex to AtomicBool
      
      * Refactor handling response bytes
      
      * Add CPU clock timeout logic for execute jobs
      
      * Properly handle AtomicBool flag
      
      * Use `Ordering::Relaxed`
      
      * Refactor thread coordination logic
      
      * Fix bug
      
      * Add some timing information to execute tests
      
      * Add section about the mitigation to the IG
      
      * minor: Change more `Ordering`s to `Relaxed`
      
      * candidate-validation: Fix build errors
      28a4e909
    • alexgparity's avatar
      Clippyfy (#6341) · 9ea14e66
      alexgparity authored
      
      
      * Add clippy config and remove .cargo from gitignore
      
      * first fixes
      
      * Clippyfied
      
      * Add clippy CI job
      
      * comment out rusty-cachier
      
      * minor
      
      * fix ci
      
      * remove DAG from check-dependent-project
      
      * add DAG to clippy
      
      Co-authored-by: default avataralvicsam <[email protected]>
      9ea14e66
    • Mara Broda's avatar
      sync versions with current release (0.9.33) (#6363) · b76086c6
      Mara Broda authored
      * westend: update transaction version
      
      * polkadot: update transaction version
      
      * kusama: update transaction version
      
      * Bump spec_version to 9330
      
      * bump versions to 0.9.33
      b76086c6
  8. Nov 28, 2022
  9. Nov 23, 2022
    • Marcin S.'s avatar
      Add PVF module documentation (#6293) · 1dec2433
      Marcin S. authored
      
      
      * Add PVF module documentation
      
      TODO (once the PRs land):
      
      - [ ] Document executor parametrization.
      
      - [ ] Document CPU time measurement of timeouts.
      
      * Update node/core/pvf/src/lib.rs
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      
      * Clarify meaning of PVF acronym
      
      * Move PVF doc to implementer's guide
      
      * Clean up implementer's guide a bit
      
      * Add page for PVF types
      
      * pvf: Better separation between crate docs and implementer's guide
      
      * ci: Add "prevalidating" to the dictionary
      
      * ig: Remove types/chain.md
      
      The types contained therein did not exist and the file was not referenced
      anywhere.
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      1dec2433
  10. Nov 08, 2022
  11. Nov 01, 2022
    • Marcin S.'s avatar
      PVF timeouts follow-up (#6151) · 1f821976
      Marcin S. authored
      * Rename timeout consts and timeout parameter; bump leniency
      
      * Update implementor's guide with info about PVFs
      
      * Make glossary a bit easier to read
      
      * Add a note to LENIENT_PREPARATION_TIMEOUT
      
      * Remove PVF-specific section from glossary
      
      * Fix some typos
      1f821976
  12. Oct 26, 2022
    • Marcin S.'s avatar
      Make some fixes to logging in PVF subsystem (#6180) · d4e3501e
      Marcin S. authored
      * Log exit status code for workers
      
      * Make log for execute job conclusion match prepare job conclusion
      
      Trace log for conclusion of prepare job:
      
      ```rs
      gum::debug!(
      	target: LOG_TARGET,
      	validation_code_hash = ?artifact_id.code_hash,
      	?worker,
      	?rip,
      	"prepare worker concluded",
      );
      ```
      
      Co-authored-by: parity-processbot <>
      d4e3501e
  13. Oct 22, 2022
    • Mara Broda's avatar
      sync versions with current release (0.9.31) (#6176) · f8cc39a7
      Mara Broda authored
      * Bump spec_version to 9310
      
      * bump transaction_version (0.9.31) (#6171)
      
      * Bump transaction_version for polkadot
      
      * Bump transaction_version for kusama
      
      * Bump transaction_version for rococo
      
      * Bump transaction_version for westend
      
      * Bump transaction_version for polkadot
      
      * Bump transaction_version for kusama
      
      * Bump transaction_version for rococo
      
      * Bump transaction_version for westend
      
      * Bump crate versions (0.9.31)
      f8cc39a7
  14. Oct 13, 2022
  15. Sep 15, 2022
  16. Sep 09, 2022
  17. Aug 29, 2022
    • Mara Broda's avatar
      version bumps (0.9.28) (#5933) · fc97080c
      Mara Broda authored
      * Bump crate versions
      
      * Bump spec_version to 9280 for kusama
      
      * Bump spec_version to 9280 for polkadot
      
      * Bump spec_version to 9280 for rococo
      
      * Bump spec_version to 9280 for westend
      
      * update Cargo.lock
      
      Co-authored-by: parity-processbot <>
      fc97080c
  18. Jul 28, 2022
  19. Jul 06, 2022
  20. Jun 27, 2022
  21. Jun 24, 2022
  22. Jun 23, 2022
  23. Jun 21, 2022
    • Mara Broda's avatar
      bump versions to 0.9.25 (#5684) · 97f9b840
      Mara Broda authored
      * kusama: bump spec_version to 9250
      
      * polkadot: bump spec_version to 9250
      
      * rococo: bump spec_version to 9250
      
      * westend: bump spec_version to 9250
      
      * bump version to 0.9.25
      
      * bump transaction version (polkadot & kusama) (#5690)
      
      * kusama: bump transaction_version to 12
      
      * polkadot: bump transaction_version to 13
      97f9b840
  24. May 30, 2022
  25. May 27, 2022
  26. May 19, 2022
    • Koute's avatar
      Switch to pooling copy-on-write instantiation strategy for WASM (companion for... · d9eff4ec
      Koute authored
      Switch to pooling copy-on-write instantiation strategy for WASM (companion for Substrate#11232) (#5337)
      
      * Switch to pooling copy-on-write instantiation strategy for WASM
      
      * Fix compilation of `polkadot-test-service`
      
      * Update comments
      
      * Move `max_memory_size` to `Semantics`
      
      * Rename `WasmInstantiationStrategy` to `WasmtimeInstantiationStrategy`
      
      * Update a safety comment
      
      * update lockfile for {"substrate"}
      
      Co-authored-by: parity-processbot <>
      d9eff4ec
  27. May 16, 2022
  28. Apr 09, 2022
    • Sergei Shulepov's avatar
      Fixes the dead lock when any of the channels get at capacity. (#5297) · b89dc00e
      Sergei Shulepov authored
      The PVF host is designed to avoid spawning tasks to minimize knowledge
      of outer code. Using `async_std::task::spawn` (or Tokio's counterpart)
      deemed unacceptable, `SpawnNamed` undesirable. Instead there is only one
      task returned that is spawned by the candidate-validation subsystem.
      The tasks from the sub-components are polled by that root task.
      
      However, the way the tasks are bundled was incorrect. There was a giant
      select that was polling those tasks. Particularly, that implies that as soon as
      one of the arms of that select goes into await those sub-tasks stop
      getting polled. This is a recipe for a deadlock which indeed happened
      here.
      
      Specifically, the deadlock happened during sending messages to the
      execute queue by calling
      [`send_execute`](https://github.com/paritytech/polkadot/blob/a68d9be35656dcd96e378fd9dd3d613af754d48a/node/core/pvf/src/host.rs#L601).
      When the channel to the queue reaches the capacity, the control flow is
      suspended until the queue handles those messages. Since this code is
      essentially reached from [one of the select
      arms](https://github.com/paritytech/polkadot/blob/a68d9be35656dcd96e378fd9dd3d613af754d48a/node/core/pvf/src/host.rs#L371),
      the queue won't be given the control and thus no further progress can be
      made.
      
      This problem is solved by bundling the tasks one level higher instead,
      by `selecting` over those long-running tasks.
      
      We also stop treating returning from those long-running tasks as error
      conditions, since that can happen during legit shutdown.
      b89dc00e
  29. Apr 08, 2022
  30. Mar 24, 2022
  31. Mar 23, 2022
  32. Mar 18, 2022
  33. Mar 15, 2022
  34. Mar 14, 2022
  35. Mar 11, 2022