Skip to content
  1. Feb 25, 2022
  2. Feb 22, 2022
    • Sergei Shulepov's avatar
      paras: `initialize_para_now` and `ParachainsCache` (#4934) · 95a78e87
      Sergei Shulepov authored
      This commit adds a new primitive called `ParachainsCache` to manipulate
      the `Parachains` storage entry in a more convenient way.
      
      Then, on top of that, this commit changes the logic of
      `initialize_para_now` so that it is identical to what is used for
      initialization of onboarding.
      95a78e87
  3. Feb 16, 2022
  4. Feb 03, 2022
  5. Feb 02, 2022
  6. Jan 30, 2022
  7. Jan 28, 2022
  8. Jan 27, 2022
  9. Jan 21, 2022
    • Kian Paimani's avatar
      HRMP benchmarks (#3876) · 3cb2d626
      Kian Paimani authored
      
      
      * wip template for hrmp benchmarks
      
      * add all of the benchmarks, first draft
      
      * File was not saved :/
      
      * cargo +nightly fmt
      
      * Use configs
      
      * add configs
      
      * Fix rococo
      
      * Final touches
      
      * revert fmt changes, one last time
      
      * Fix wrappings
      
      * Fix a bunch of tests
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::hrmp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_hrmp.rs
      
      * add to westend
      
      * actually use everything
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::hrmp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_hrmp.rs
      
      * Update runtime/parachains/src/hrmp.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * use real weight in wnd
      
      * reorg
      
      * minor cleanup
      
      * weigh some of the internal stuff as well
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::hrmp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_hrmp.rs
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::hrmp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_hrmp.rs
      
      * add files
      
      * Master.into()
      
      * add validation
      
      * fmt
      
      * fmt
      
      * final fixes
      
      * all runtimes build
      
      * undo formatting
      
      * Update runtime/parachains/src/hrmp.rs
      
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      
      * non-controversial changes
      
      * do it the parachain-way: use const instead of type configs for simplicity.
      
      * borrow assert_storage_consistency_exhaustive
      
      * move assert_storage_consistency_exhaustive to Pallet, so it can be reused for benchmarks as well.
      
      * fix typo
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarSergey Shulepov <[email protected]>
      Co-authored-by: default avatarZeke Mostov <[email protected]>
      3cb2d626
  10. Jan 20, 2022
    • Oliver Tale-Yazdi's avatar
      co #10662: Require `MaxEncodedLen` per default (#4746) · 3d61cc01
      Oliver Tale-Yazdi authored
      
      
      * Add `without_storage_info`
      
      The MaxEncodedLen trait is now enforced by default in Substrate.
      All pallets missing an implementation need to be marked with
      `without_storage_info` now.
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Remove `generate_storage_info`
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * Add more `without_storage_info`
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      
      * update lockfile for {"substrate"}
      
      Co-authored-by: parity-processbot <>
      3d61cc01
    • Bernhard Schuster's avatar
      [runtime] follow up relay chain cleanups (#4657) · b7a05fd4
      Bernhard Schuster authored
      
      
      * fix miscalculation of remaining weight
      
      * rename a var
      
      * move out enforcing filtering by dropping inherents
      
      * prepare for dispute statement validity check being split off
      
      * refactor
      
      * refactor, only check disputes we actually want to include
      
      * more refactor and documentation
      
      * refactor and minimize inherent checks
      
      * chore: warnings
      
      * fix a few tests
      
      * fix dedup regression
      
      * fix
      
      * more asserts in tests
      
      * remove some asserts
      
      * chore: fmt
      
      * skip signatures checks, some more
      
      * undo unwatend changes
      
      * Update runtime/parachains/src/paras_inherent/mod.rs
      
      Co-authored-by: default avatarsandreim <[email protected]>
      
      * cleanups, checking CheckedDisputeStatments makes no sense
      
      * integrity, if called create_inherent_inner, it shall do the checks, and not rely on enter_inner
      
      * review comments
      
      * use from impl rather than into
      
      * remove outdated comment
      
      * adjust tests accordingly
      
      * assure no weight is lost
      
      * address review comments
      
      * remove unused import
      
      * split error into two and document
      
      * use assurance, O(n)
      
      * Revert "adjust tests accordingly"
      
      This reverts commit 3cc9a3c449f82db38cea22c48f4a21876603374b.
      
      * fix comment
      
      * fix sorting
      
      * comment
      
      Co-authored-by: default avatarsandreim <[email protected]>
      b7a05fd4
  11. Jan 17, 2022
    • Sergey Pepyakin's avatar
      paras: do not allow PVF vote submission if disabled (#4684) · 815021ab
      Sergey Pepyakin authored
      if the PVF pre-checking is disabled the runtime dispatchable will reject
      any attempts of submission. This is also concern the unsigned tx
      validation.
      
      Right now, the `include_pvf_check_statement` dispatchable is effectively
      uncallable because of the weight set to the maximum value. If we were to
      benchmark it, it would become includable in a block, but since there
      will be no active votes, the dispatchable won't do anything.
      
      However, it will execute some code, like signature validation and
      querying some storage entries. To be completely safe, we can bail out
      early if the `pvf_checking_enabled` config is disabled. That's what this
      PR does.
      815021ab
  12. Jan 13, 2022
    • Sergey Pepyakin's avatar
      paras: Add runtime events for PVF pre-checking (#4683) · 21419a81
      Sergey Pepyakin authored
      In this PR, paras module emit runtime events on certain PVF pre-checking
      related conditions.
      
      Specifically, there are 3 new events in the paras module:
      
      1. PvfCheckStarted
      2. PvfCheckAccepted
      3. PvfCheckRejected
      
      All of those have identifiers for the parachain that triggered the PVF
      pre-checking and the validation code that goes through the pre-checking.
      
      The mechanics of those are as follows. Each time a new PVF is added, be
      it due to onboarding or upgrading, the `PvfCheckStarted` will be
      triggered. If another parachain triggers a pre-checking process for the
      validation code which is already being pre-checked, another
      `PvfCheckStarted` event will be triggered with the corresponding para
      id.
      
      When the PVF pre-checking voting for a PVF was finished, several
      `PvfCheckAccepted/Rejected` events will be triggered: one for each para id that
      was subscribed to this check (i.e. was a "cause" for it).
      
      If the PVF pre-checking is disabled, then one can still expect these
      events to be fired. Since insta PVF approval is syncronous, the
      `PvfCheckStarted` will be followed by the `PvfCheckAccepted` with the
      same validation code and para id.
      
      If somebody is interested in following validation code changes for a PVF
      of a parachain, they would need to subscribe to those events. I did not
      supply the topics for the events, since I am not sure if that's needed
      or will be used, but they can be added later if needed.
      21419a81
  13. Jan 12, 2022
  14. Jan 07, 2022
  15. Jan 05, 2022
  16. Jan 03, 2022
    • Keith Yeung's avatar
      Set CurrentCodeHash before running some dispatchable benchmarks (#4645) · 5047ef8e
      Keith Yeung authored
      
      
      * Set CurrentCodeHash before running some dispatchable benchmarks
      
      * Use insert instead of put
      
      * Actually hash the ValidationCode
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      5047ef8e
    • Sergey Pepyakin's avatar
      paras: split tests (#4636) · 575775a1
      Sergey Pepyakin authored
      This is only a module structure change: the tests module was promoted to
      have its own file.
      575775a1
  17. Jan 01, 2022
  18. Dec 31, 2021
  19. Dec 30, 2021
  20. Dec 29, 2021
    • Sergey Pepyakin's avatar
      paras: add governance control dispatchables (#4575) · 4bf62d85
      Sergey Pepyakin authored
      * paras: add governance control dispatchables
      
      Adds a couple of functions for governance control for the paras module
      in the anticipation of PVF pre-checking enabling.
      
      Specifically, this commit adds a function for pre-registering a PVF that
      governance trusts enough. This function will come in handy in case there
      is a parachain that does not follow the GoAhead signal. That is, does
      not include https://github.com/paritytech/cumulus/pull/517
      
      .
      
      This may be not an exhaustive list of the functions that may come in
      handy. Any suggestions to add more are welcome.
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras.rs
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs
      
      * cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      4bf62d85
  21. Dec 28, 2021
  22. Dec 27, 2021
    • Sergey Pepyakin's avatar
      configuration: Unified consistency checks (#4581) · 4d768787
      Sergey Pepyakin authored
      This commit refactors the consistency checks. Instead of each individual
      setter performs its checks locally, we delegate those checks to the
      already existing function `check_consistency`. This removes duplication
      and simplifies the logic.
      
      A motivating example of this one is the next PR in the stack that will
      introduce a check for a field, which validity depends on the validity of
      other two fields. Without this refactoring we will have to place a check
      not only to the field in question, but also to the other two fields so
      that if they are changed they do not violate consistency criteria. It's
      easy to imagine how this can go unwieldy with the number of checks.
      
      This also adds a test that verifies that the default chain spec host
      configuration is consistent.
      4d768787
    • ordian's avatar
      9efb223a
    • ordian's avatar
      session-info: add new fields + migration (#4545) · b342ae11
      ordian authored
      
      
      * session_info: v2 + migration
      
      * use primitives::v2
      
      * use polkadot_primitives::v2
      
      * impl primitives::v2
      
      * fix approval-voting tests
      
      * fix other tests
      
      * hook storage migration up
      
      * backwards compat (1)
      
      * backwards compat (2)
      
      * fmt
      
      * fix tests
      
      * FMT
      
      * do not reexport v1 in v2
      
      * fmt
      
      * set storage version to 1
      
      Co-authored-by: default avatarJavier Viola <[email protected]>
      b342ae11
  23. Dec 24, 2021
    • cheme's avatar
      Companion for substrate#9732 (#4104) · 48dc6750
      cheme authored
      * merge master (do not compile)
      
      * fix
      
      * lock
      
      * update lock
      
      * Update to refactoring.
      
      * runtime version
      
      * fmt
      
      * remove trie patch
      
      * remove patch
      
      * No layout alias for bridge proof.
      
      * update depupdate depss
      
      * No switch until migration.
      
      * master lock
      
      * test
      
      * test
      
      * Revert "test"
      
      This reverts commit 57325ef73332bf4b054aa4a667bb716fcf8a0d89.
      
      * Revert "test"
      
      This reverts commit ce74d0e2062806f72c0e9e9ca07b14165f43521e.
      
      * rename feature
      
      * state version as parameter, use the feature only on runtimes.
      
      * update
      
      * update to state version in runtime
      
      * state version from storage
      
      * update lockfile for substrate
      
      Co-authored-by: parity-processbot <>
      48dc6750
  24. Dec 23, 2021
    • Robert Klotzner's avatar
      First step in implementing #4386 (#4437) · 846828f6
      Robert Klotzner authored
      * First step in implementing https://github.com/paritytech/polkadot/issues/4386
      
      This PR:
      
      - Reduces MAX_UNSHARED_UPLOAD_TIME to 150ms
      - Increases timeout on collation fetching to 1200ms
      - Reduces limit on needed backing votes in the runtime
      
      This PR does not yet reduce the number of needed backing votes on the
      node as this can only be meaningfully enacted once the changed limit in
      the runtime is live.
      
      * Fix tests.
      
      * Guide updates.
      
      * Review remarks.
      
      * Bump minimum required backing votes to 2 in runtime.
      
      * Make sure node side code won't make runtime vomit.
      
      * cargo +nightly fmt
      846828f6
  25. Dec 22, 2021
    • Sergey Pepyakin's avatar
      configuration: refactor configuration initialization (#4569) · 4689ccff
      Sergey Pepyakin authored
      Refactor the configuration module's initializer_on_new_session in such a
      way that it returns the configuration. This would make it inline with
      other special initialization routines like `shared`'s or `paras`.
      
      This will be useful in a following PR that will check consistency of the
      configuration before setting it.
      4689ccff
  26. Dec 21, 2021
    • Sergey Pepyakin's avatar
      pvf-precheck: update rustdoc for paras module (#4459) · 0e046a00
      Sergey Pepyakin authored
      Basically updates the docs for the paras module.
      0e046a00
    • Sergey Pepyakin's avatar
      parachains: Fix configuration module (#4540) · 5a3ee43c
      Sergey Pepyakin authored
      
      
      * parachains: Fix configuration module
      
      Closes #4529
      Closes #4533
      
      I figured that trying to avoid updates does not really worth it to keep.
      This is because we seem to not update the configuration often and when
      we do we approach this carefully. Thus possibility of a redundant update
      is really negligable. At the same time, if such a redundant update does
      happen then the effects of that are really small: just some wasted
      storage interactions.
      
      On the other hand, making it work was a little bit annoying. With the
      proper fix for the pending updates this would be even more annoying
      since now we would have to add combinatorically more cases to test this.
      
      So I figured that I will just scrap that and simplify the code.
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_configuration.rs
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_configuration.rs
      
      * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_configuration.rs
      
      * review fixes
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      5a3ee43c
  27. Dec 16, 2021