Skip to content
  1. 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
  2. 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
  3. Jan 19, 2022
  4. Jan 17, 2022
    • zqhxuyuan's avatar
      make xcm_config public (#4731) · c0ed54f1
      zqhxuyuan authored
      c0ed54f1
    • 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
    • Zeke Mostov's avatar
      Change EraIndex import path: companion #10671 (#4728) · 7ef476c2
      Zeke Mostov authored
      * Change EraIndex import path: companion #10671
      
      * update lockfile for {"substrate"}
      
      Co-authored-by: parity-processbot <>
      7ef476c2
  5. Jan 15, 2022
  6. Jan 13, 2022
    • Alexander Popiak's avatar
      Add `fast-runtime` Cargo Feature for Quick Test Runs (#4332) · 401540ee
      Alexander Popiak authored
      
      
      * add fast-runtime feature for reduced session times
      
      * make democracy periods fast on fast-runtime
      
      * propagate fast-runtime feature through cargo.toml files
      
      * add fast motion and term durations to Kusama
      
      * Update runtime/westend/Cargo.toml
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * set session time to 2 minutes to avoid block production issues
      
      * formatting
      
      * update Substrate
      
      * set democracy fast periods back to 1min
      
      * set launch period and enactment period to 1 block in fast-runtime
      
      * remove unnecessary westend period configs
      
      * add prod_or_test macro to allow specifying prod, test and env values for parameter types
      
      * move prod_or_test macro into common module and use it consistently
      
      * rename macro to prod_or_fast
      
      * cargo +nightly fmt
      
      * bump impl_versions
      
      * newline
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * add note that env variable is evaluated at compile time
      
      * newline
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * newline
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * cargo fmt
      
      * impl_version: 0
      
      * impl_version: 0
      
      * use prod_or_fast macro for LeasePeriod and LeaseOffset
      
      * use prod_or_fast macro in WND and ROC constants
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarGiles Cope <[email protected]>
      401540ee
    • 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
    • Kian Paimani's avatar
      12d16002
  7. Jan 12, 2022
  8. Jan 11, 2022
  9. Jan 10, 2022
  10. Jan 07, 2022
  11. Jan 05, 2022
  12. 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
  13. Jan 01, 2022
  14. Dec 31, 2021
  15. Dec 30, 2021
  16. 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
  17. Dec 28, 2021
  18. 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
  19. Dec 25, 2021
  20. 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
  21. 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
  22. 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
  23. Dec 21, 2021