1. Apr 19, 2024
  2. Jan 21, 2024
  3. Dec 29, 2023
  4. Dec 05, 2023
  5. Nov 28, 2023
  6. Nov 21, 2023
  7. Nov 19, 2023
  8. Nov 14, 2023
  9. Nov 03, 2023
  10. Oct 31, 2023
  11. Oct 14, 2023
    • Julian Eager's avatar
      Discard `Executor` (#1855) · 9f7656df
      Julian Eager authored
      
      
      closes #622 
      
      Pros:
      * simpler interface, just functions:
      `create_runtime_from_artifact_bytes()` and `execute_artifact()`
      
      Cons:
      * extra overhead of constructing executor semantics each time
      
      I could make it a combination of
      * `create_runtime_config(params)` (such that we could clone the
      constructed semantics)
      * `create_runtime(blob, config)`
      * `execute_artifact(blob, config, params)`
      
      Not sure if it's worth it though.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      9f7656df
  12. Oct 05, 2023
  13. Sep 28, 2023
  14. Aug 14, 2023
  15. Aug 08, 2023
  16. Jul 31, 2023
    • Marcin S.'s avatar
      98.6% OF DEVELOPERS CANNOT REVIEW THIS PR! [read more...] (#7337) · 85b06f18
      Marcin S. authored
      
      
      * [WIP] PVF: Split out worker binaries
      
      * Address compilation problems and re-design a bit
      
      * Reorganize once more, fix tests
      
      * Reformat with new nightly to make `cargo fmt` test happy
      
      * Address `clippy` warnings
      
      * Add temporary trace to debug zombienet tests
      
      * Fix zombienet node upgrade test
      
      * Fix malus and its CI
      
      * Fix building worker binaries with malus
      
      * More fixes for malus
      
      * Remove unneeded cli subcommands
      
      * Support placing auxiliary binaries to `/usr/libexec`
      
      * Fix spelling
      
      * Spelling
      
      Co-authored-by: default avatarMarcin S. <[email protected]>
      
      * Implement review comments (mostly nits)
      
      * Fix worker node version flag
      
      * Rework getting the worker paths
      
      * Address a couple of review comments
      
      * Minor restructuring
      
      * Fix CI error
      
      * Add tests for worker binaries detection
      
      * Improve tests; try to fix CI
      
      * Move workers module into separate file
      
      * Try to fix failing test and workers not printing latest version
      
      - Tests were not finding the worker binaries
      - Workers were not being rebuilt when the version changed
      - Made some errors easier to read
      
      * Make a bunch of fixes
      
      * Rebuild nodes on version change
      
      * Fix more issues
      
      * Fix tests
      
      * Pass node version from node into dependencies to avoid recompiles
      
      - [X] get version in CLI
      - [X] pass it in to service
      - [X] pass version along to PVF
      - [X] remove rerun from service
      - [X] add rerun to CLI
      
      - [X] don’t rerun pvf/worker’s (these should be built by nodes which have rerun enabled)
      
      * Some more improvements for smoother tests
      
      - [X] Fix tests
      - [X] Make puppet workers pass None for version and remove rerun
      - [X] Make test collators self-contained
      
      * Add back rerun to PVF workers
      
      * Move worker binaries into files in cli crate
      
      As a final optimization I've separated out each worker binary from its own crate
      into the CLI crate. Before, the worker bin shared a crate with the worker lib,
      so when the binaries got recompiled so did the libs and everything transitively
      depending on the libs. This commit fixes this regression that was causing
      recompiles after every commit.
      
      * Fix bug (was passing worker version for node version)
      
      * Move workers out of cli into root src/bin/ dir
      
      - [X] Pass in node version from top-level (polkadot)
      - [X] Add build.rs with rerun-git-head to root dir
      
      * Add some sanity checks for workers to dockerfiles
      
      * Update malus
      
        + [X] Make it self-contained
        + [X] Undo multiple binary changes
      
      * Try to fix clippy errors
      
      * Address `cargo run` issue
      
      - [X] Add default-run for polkadot
      - [X] Add note about installation to error
      
      * Update readme (installation instructions)
      
      * Allow disabling external workers for local/testing setups
      
        + [X] cli flag to enable single-binary mode
        + [X] Add message to error
      
      * Revert unnecessary Cargo.lock changes
      
      * Remove unnecessary build scripts from collators
      
      * Add back missing malus commands (should fix failing ZN job)
      
      * Some minor fixes
      
      * Update Cargo.lock
      
      * Fix some build errors
      
      * Undo self-contained binaries; cli flag to disable version check
      
        + [X] Remove --dont-run-external-workers
        + [X] Add --disable-worker-version-check
        + [X] Remove PVF subcommands
        + [X] Redo malus changes
      
      * Try to fix failing job and add some docs for local tests
      
      ---------
      
      Co-authored-by: default avatarDmitry Sinyavin <[email protected]>
      Co-authored-by: default avatars0me0ne-unkn0wn <[email protected]>
      Co-authored-by: parity-processbot <>
      85b06f18
  17. Jul 05, 2023
  18. Jun 02, 2023
    • Marcin S.'s avatar
      PVF: Instantiate wasm in pre-checking (#7246) · 5bbb87c4
      Marcin S. authored
      * PVF: Instantiate wasm in pre-checking
      
      * Move `runtime_construction_check` to prepare thread, use bytes
      
      * [minor] Update comment
      
      * Fix compile error
      
      * Update Cargo.lock
      
      * Update docs
      
      * Add some missing docs!
      5bbb87c4
  19. May 25, 2023
    • Marcin S.'s avatar
      PVF: Refactor workers into separate crates, remove host dependency (#7253) · 8782dde4
      Marcin S. authored
      * PVF: Refactor workers into separate crates, remove host dependency
      
      * Fix compile error
      
      * Remove some leftover code
      
      * Fix compile errors
      
      * Update Cargo.lock
      
      * Remove worker main.rs files
      
      I accidentally copied these from the other PR. This PR isn't intended to
      introduce standalone workers yet.
      
      * Address review comments
      
      * cargo fmt
      
      * Update a couple of comments
      
      * Update log targets
      8782dde4
  20. May 16, 2023
    • Marcin S.'s avatar
      PVF: Vote invalid on panics in execution thread (after a retry) (#7155) · 82e4dbcc
      Marcin S. authored
      * PVF: Remove `rayon` and some uses of `tokio`
      
      1. We were using `rayon` to spawn a superfluous thread to do execution, so it was removed.
      
      2. We were using `rayon` to set a threadpool-specific thread stack size, and AFAIK we couldn't do that with `tokio` (it's possible [per-runtime](https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.html#method.thread_stack_size) but not per-thread). Since we want to remove `tokio` from the workers [anyway](https://github.com/paritytech/polkadot/issues/7117), I changed it to spawn threads with the `std::thread` API instead of `tokio`.[^1]
      
      [^1]: NOTE: This PR does not totally remove the `tokio` dependency just yet.
      
      3. Since `std::thread` API is not async, we could no longer `select!` on the threads as futures, so the `select!` was changed to a naive loop.
      
      4. The order of thread selection was flipped to make (3) sound (see note in code).
      
      I left some TODO's related to panics which I'm going to address soon as part of https://github.com/paritytech/polkadot/issues/7045.
      
      * PVF: Vote invalid on panics in execution thread (after a retry)
      
      Also make sure we kill the worker process on panic errors and internal errors to
      potentially clear any error states independent of the candidate.
      
      * Address a couple of TODOs
      
      Addresses a couple of follow-up TODOs from
      https://github.com/paritytech/polkadot/pull/7153
      
      .
      
      * Add some documentation to implementer's guide
      
      * Fix compile error
      
      * Fix compile errors
      
      * Fix compile error
      
      * Update roadmap/implementers-guide/src/node/utility/candidate-validation.md
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      
      * Address comments + couple other changes (see message)
      
      - Measure the CPU time in the prepare thread, so the observed time is not
        affected by any delays in joining on the thread.
      
      - Measure the full CPU time in the execute thread.
      
      * Implement proper thread synchronization
      
      Use condvars i.e. `Arc::new((Mutex::new(true), Condvar::new()))` as per the std
      docs.
      
      Considered also using a condvar to signal the CPU thread to end, in place of an
      mpsc channel. This was not done because `Condvar::wait_timeout_while` is
      documented as being imprecise, and `mpsc::Receiver::recv_timeout` is not
      documented as such. Also, we would need a separate condvar, to avoid this case:
      the worker thread finishes its job, notifies the condvar, the CPU thread returns
      first, and we join on it and not the worker thread. So it was simpler to leave
      this part as is.
      
      * Catch panics in threads so we always notify condvar
      
      * Use `WaitOutcome` enum instead of bool condition variable
      
      * Fix retry timeouts to depend on exec timeout kind
      
      * Address review comments
      
      * Make the API for condvars in workers nicer
      
      * Add a doc
      
      * Use condvar for memory stats thread
      
      * Small refactor
      
      * Enumerate internal validation errors in an enum
      
      * Fix comment
      
      * Add a log
      
      * Fix test
      
      * Update variant naming
      
      * Address a missed TODO
      
      ---------
      
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      82e4dbcc
    • Marcin S.'s avatar
      b75b137b
  21. Apr 21, 2023
    • Marcin S.'s avatar
      PVF: Move PVF workers into separate crate (#7101) · e277f95b
      Marcin S. authored
      * Move PVF workers into separate crate
      
      * Fix indentation
      
      * Fix compilation errors
      
      * Fix more compilation errors
      
      * Rename `worker.rs` files, make host interface to worker more clear
      
      * Fix more compilation errors
      
      * Fix more compilation errors
      
      * Add link to issue
      
      * Address review comments
      
      * Update comment
      e277f95b