1. May 05, 2023
    • Liam Aharon's avatar
      try-runtime-cli: 'instant' snapshots, threading refactor, better progress logs (#14057) · ead46b9e
      Liam Aharon authored
      * remote externalities refactor
      
      * remove redundant logs
      
      * use const for parallel requests
      
      * prefer functional
      
      * improve variable naming
      
      * handle requests error
      
      * use overlayedchanges
      
      * Revert "use overlayedchanges"
      
      This reverts commit c0ddb87a5abdd52207597f5df66cbbdf9d79badc.
      
      * Revert "Revert "use overlayedchanges""
      
      This reverts commit 1d49362d9b999c045c8f970a0ab8b486bc47a90a.
      
      * Revert "Revert "Revert "use overlayedchanges"""
      
      This reverts commit 06df786488d94f249e9abccffac4af445f76e5a7.
      
      * backup/load raw storage values
      
      * test raw storage drain and restore
      
      * update snapshot tests
      
      * improve logs
      
      * clippy suggestions
      
      * address comments
      
      * fix example
      
      * fix test
      
      * clippy
      ead46b9e
  2. May 04, 2023
    • Michal Kucharczyk's avatar
      substrate-test-runtime migrated to "pure" frame runtime (#13737) · 6a295e7c
      Michal Kucharczyk authored
      * substrate-test-runtime migrated to pure-frame based
      
      * test block builder: helpers added
      
      * simple renaming
      
      * basic_authorship test adjusted
      
      * block_building storage_proof test adjusted
      
      * babe: tests: should_panic expected added
      
      * babe: tests adjusted
      
      ConsensusLog::NextEpochData is now added by pallet_babe as
      pallet_babe::SameAuthoritiesForever trigger is used in runtime config.
      
      * beefy: tests adjusted
      
      test-substrate-runtime is now using frame::executive to finalize the
      block. during finalization the digests stored during block execution are
      checked against header digests:
      https://github.com/paritytech/substrate/blob/91bb2d29ca905599098a5b35eaf24867c4fbd60a/frame/executive/src/lib.rs#L585-L591
      
      It makes impossible to directly manipulate header's digets, w/o
      depositing logs into system pallet storage `Digest<T: Config>`.
      
      Instead of this dedicated extrinsic allowing to store logs items
      (MmrRoot / AuthoritiesChange) is used.
      
      * grandpa: tests adjusted
      
      test-substrate-runtime is now using frame::executive to finalize the
      block. during finalization the digest logs stored during block execution are
      checked against header digest logs:
      https://github.com/paritytech/substrate/blob/91bb2d29ca905599098a5b35eaf24867c4fbd60a/frame/executive/src/lib.rs#L585-L591
      
      
      
      It makes impossible to directly manipulate header's digets, w/o
      depositing logs into system pallet storage `Digest<T: Config>`.
      
      Instead of this dedicated extrinsic allowing to store logs items
      (ScheduledChange / ForcedChange and DigestItem::Other) is used.
      
      * network:bitswap: test adjusted
      
      The size of unchecked extrinsic was increased. The pattern used in test will
      be placed at the end of scale-encoded buffer.
      
      * runtime apis versions adjusted
      
      * storage keys used in runtime adjusted
      
      * wasm vs native tests removed
      
      * rpc tests: adjusted
      
      Transfer transaction processing was slightly improved, test was
      adjusted.
      
      * tests: sizes adjusted
      
      Runtime extrinsic size was increased. Size of data read during block
      execution was also increased due to usage of new pallets in runtime.
      
      Sizes were adjusted in tests.
      
      * cargo.lock update
      
      cargo update -p substrate-test-runtime -p substrate-test-runtime-client
      
      * warnings fixed
      
      * builders cleanup: includes / std
      
      * extrinsic validation cleanup
      
      * txpool: benches performance fixed
      
      * fmt
      
      * spelling
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Apply code review suggestions
      
      * Apply code review suggestions
      
      * get rid of 1063 const
      
      * renaming: UncheckedExtrinsic -> Extrinsic
      
      * test-utils-runtime: further step to pure-frame
      
      * basic-authorship: tests OK
      
      * CheckSubstrateCall added + tests fixes
      
      * test::Transfer call removed
      
      * priority / propagate / no sudo+root-testing
      
      * fixing warnings + format
      
      * cleanup: build2/nonce + format
      
      * final tests fixes
      
      all tests are passing
      
      * logs/comments removal
      
      * should_not_accept_old_signatures test removed
      
      * make txpool benches work again
      
      * Cargo.lock reset
      
      * format
      
      * sudo hack removed
      
      * txpool benches fix+cleanup
      
      * .gitignore reverted
      
      * rebase fixing + unsigned cleanup
      
      * Cargo.toml/Cargo.lock cleanup
      
      * force-debug feature removed
      
      * mmr tests fixed
      
      * make cargo-clippy happy
      
      * network sync test uses unsigned extrinsic
      
      * cleanup
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * push_storage_change signed call remove
      
      * GenesisConfig cleanup
      
      * fix
      
      * fix
      
      * GenesisConfig simplified
      
      * storage_keys_works: reworked
      
      * storage_keys_works: expected keys in vec
      
      * storage keys list moved to substrate-test-runtime
      
      * substrate-test: some sanity tests + GenesisConfigBuilder rework
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Apply suggestions from code review
      
      * Review suggestions
      
      * fix
      
      * fix
      
      * beefy: generate_blocks_and_sync block_num sync with actaul value
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Update test-utils/runtime/src/genesismap.rs
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * cargo update -p sc-rpc -p sc-transaction-pool
      
      * Review suggestions
      
      * fix
      
      * doc added
      
      * slot_duration adjusted for Babe::slot_duration
      
      * small doc fixes
      
      * array_bytes::hex used instead of hex
      
      * tiny -> medium name fix
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      
      * TransferData::try_from_unchecked_extrinsic -> try_from
      
      * Update Cargo.lock
      
      ---------
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      6a295e7c
  3. May 02, 2023
  4. Apr 27, 2023
  5. Apr 25, 2023
  6. Apr 21, 2023
    • Liam Aharon's avatar
      try-runtime: dynamic storage query sizes (#13923) · bc1a5992
      Liam Aharon authored
      
      
      * improve batch rpc error message
      
      * wip aimd storage data fetch
      
      * complete aimd function refactor
      
      * make batch_request function async
      
      * improve function name
      
      * fix load_child_remote issue
      
      * slight efficiency improvement
      
      * improve logs and variable name
      
      * remove redundant comment
      
      * improve comment
      
      * address pr comments
      
      * Update utils/frame/remote-externalities/src/lib.rs
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * simplify client handling
      
      * fix type issue
      
      * fix clippy issue
      
      * try to trigger ci
      
      * try to trigger ci
      
      ---------
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      bc1a5992
  7. Apr 14, 2023
  8. Apr 13, 2023
  9. Apr 12, 2023
  10. Apr 09, 2023
    • yjh's avatar
      refactor(sc-executor): use wasm executor builder instead of old apis (#13740) · d5e460b3
      yjh authored
      * refactor: use builder api for all executors
      
      * improve a lot
      
      * remove unused args
      
      * cleanup deps
      
      * fix inconsistency about heap alloc
      
      * add `heap_pages` back to try-runtime
      
      * fix
      
      * chore: reduce duplicated code for sc-service-test
      
      * cleanup code
      
      * fmt
      
      * improve test executor
      
      * improve
      
      * use #[deprecated]
      
      * set runtime_cache_size: 4
      
      * fix and improve
      
      * refactor builder
      
      * fix
      
      * fix bench
      
      * fix tests
      
      * fix warnings
      
      * fix warnings
      
      * fix
      
      * fix
      
      * update by suggestions
      
      * update name
      d5e460b3
  11. Apr 06, 2023
  12. Apr 05, 2023
  13. Apr 04, 2023
    • Bastian Köcher's avatar
      Remove deprecated batch verification (#13799) · 846ec8cd
      Bastian Köcher authored
      This removes the deprecated batch verification. This was actually never really activated.
      Nevertheless, we need to keep the host functions around to support old runtimes which may import
      these host functions. However, we do not give access to these functions anymore. This means that any new
      runtime can not call them anymore. The host function implementations we keep will not do batch verification and will
      instead fall back to the always existing option of directly verifying the passed signature.
      `finish_batch_verification` will return the combined result of all the batch verify calls.
      
      This removes the `TaskExecutorExt` which only existed to support the batch verification. So, any
      code that used this extension can just remove the registration of them. It also removes
      `SignatureBatching` that was used by `frame-executive` to control the batch verification.
      However, there wasn't any `Verify` implementation that called the batch verification functions.
      846ec8cd
  14. Apr 03, 2023
  15. Mar 30, 2023
  16. Mar 29, 2023
    • Bastian Köcher's avatar
      Support stable rust for compiling the runtime (#13580) · d338e9a1
      Bastian Köcher authored
      * Support stable rust for compiling the runtime
      
      This pull request brings support for compiling the runtime with stable Rust. This requires at least
      rust 1.68.0 to work on stable. The code is written in a way that it is backwards compatible and
      should automatically work when someone compiles with 1.68.0+ stable.
      
      * We always support nightlies!
      
      * 🤦
      
      
      
      * Sort by version
      
      * Review feedback
      
      * Review feedback
      
      * Fix version parsing
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      d338e9a1
  17. Mar 24, 2023
  18. Mar 22, 2023
  19. Mar 20, 2023
    • Davide Galassi's avatar
      Keystore overhaul (iter 2) (#13634) · 480396fe
      Davide Galassi authored
      * Remove bloat about remote keystore
      
      * Update docs and remove unused 'KeystoreRef' trait
      
      * Use wherever possible, MemoryKeystore for testing
      
      * Remove unrequired fully qualified method syntax for Keystore
      480396fe
    • Mira Ressel's avatar
      address clippy & rustdoc warnings · faaa0c28
      Mira Ressel authored
      The comment was out of date anyway, State::Live no longer takes a
      snapshot_path argument.
      faaa0c28
  20. Mar 17, 2023
    • Davide Galassi's avatar
      Keystore overhaul (#13615) · f110941b
      Davide Galassi authored
      * Remove 'supported_keys' 'sign_with_any' and 'sign_with_all' from keystore trait
      
      * Remove the aync keystore
      
      * Renaming:
      - SyncCryptoStore -> Keystore
      - SyncCryptoStorePtr -> KeystorePtr
      - KeyStore -> MemoryKeystore
      
      * Fix authority discovery worker and tests
      
      * Rename 'insert_unknown' to 'insert'
      
      * Remove leftover
      f110941b
  21. Mar 14, 2023
  22. Mar 13, 2023
    • Vivek Pandya's avatar
      Remove use of trait Store from all pallets and deprecate it. (#13535) · 2009821c
      Vivek Pandya authored
      * Remove use of trait Store from staking pallet
      
      * Remove use of trait Store from bounties pallet
      
      * Remove use of trait Store from collective pallet
      
      * Remove use of trait Store from babe pallet
      
      * Remove use of trait Store from assets pallet
      
      * Remove use of trait Store from grandpa pallet
      
      * Remove use of trait Store from balances pallet
      
      * Remove use of trait Store from authorship pallet
      
      * Remove use of trait Store from authority-discovery pallet
      
      * Remove use of trait Store from atomic-swap pallet
      
      * Remove use of trait Store from sudo pallet
      
      * Remove use of trait Store from scheduler pallet
      
      * Remove use of trait Store from scored-pool pallet
      
      * Remove use of trait Store from society pallet
      
      * Remove use of trait Store from lottery pallet
      
      * Remove use of trait Store from executive pallet
      
      * Remove use of trait Store from democracy pallet
      
      * Remove use of trait Store from elections-phragmen pallet
      
      * Remove use of trait Store from indices pallet
      
      * Remove use of trait Store from identity pallet
      
      * Remove use of trait Store from multisig pallet
      
      * Remove use of trait Store from merkle-mountain-range pallet
      
      * Remove use of trait Store from im-online pallet
      
      * Remove use of trait Store from membership pallet
      
      * Remove use of trait Store from nicks pallet
      
      * Remove use of trait Store from session pallet
      
      * Remove use of trait Store from transaction-payment pallet
      
      * Remove use of trait Store from utility pallet
      
      * Remove use of trait Store from child-bounties pallet
      
      * Remove use of trait Store from nis pallet
      
      * Remove use of trait Store from nfts pallet
      
      * Remove use of trait Store from conviction-voting pallet
      
      * Remove use of trait Store from treasury pallet
      
      * Remove use of trait Store from vesting pallet
      
      * Remove use of trait Store from preimage pallet
      
      * Remove use of trait Store from uniques pallet
      
      * Remove use of trait Store from ranked-collective pallet
      
      * Remove use of trait Store from beefy-mmr pallet
      
      * Remove use of trait Store from referenda pallet
      
      * Remove use of trait Store from whitelist pallet
      
      * Remove use of trait Store from alliance pallet
      
      * Remove use of trait Store from nomination-pools pallet
      
      * Remove use of trait Store from state-trie-migration pallet
      
      * Remove use of trait Store from message-queue pallet
      
      * Remove use of trait Store from root-offences pallet
      
      * Remove use of trait Store from root-testing pallet
      
      * Remove use of trait Store from timestamps pallet
      
      * Remove use of trait Store from system pallet
      
      * Remove use of trait Store from offences pallet
      
      * Remove use of trait Store from recovery pallet
      
      * Remove use of trait Store from node-authorization pallet
      
      * Remove use of trait Store from proxy pallet
      
      * Remove use of trait Store from benchmarking pallet
      
      * Remove use of trait Store from bags-list pallet
      
      * Add deprecated warning in store_trait
      
      * Change warning message
      
      * Run cargo fmt
      
      * Fix warning and update tests
      
      * Remove unnecessary allow deprecated
      
      * Remove use of trait Store
      
      * Fix mismatch in expected output
      
      * Minor update to warning message for deprecation of generate_store with Store trait attribute
      
      * Fixes as per review comments
      
      * Fixes as per review suggestions
      
      * Remove use of Store trait from core-fellowship pallet
      
      * Fix type in store_trait.rs
      
      * Fixes as pre review comment
      2009821c
  23. Mar 02, 2023
  24. Mar 01, 2023
    • Koute's avatar
      Speed up storage iteration from within the runtime (#13479) · 55263fa2
      Koute authored
      * Speed up storage iteration from within the runtime
      
      * Move the cached iterator into an `Option`
      
      * Use `RefCell` in no_std
      
      * Simplify the code slightly
      
      * Use `Option::replace`
      
      * Update doc comment for `next_storage_key_slow`
      55263fa2
  25. Feb 28, 2023
  26. Feb 24, 2023
    • Bastian Köcher's avatar
      wasm-executor: Support growing the memory (#12520) · 941288c6
      Bastian Köcher authored
      
      
      * As always, start with something :P
      
      * Add support for max_heap_pages
      
      * Add support for wasmtime
      
      * Make it compile
      
      * Fix compilation
      
      * Copy wrongly merged code
      
      * Fix compilation
      
      * Some fixes
      
      * Fix
      
      * Get stuff working
      
      * More work
      
      * More fixes
      
      * ...
      
      * More
      
      * FIXEs
      
      * Switch wasmi to use `RuntimeBlob` like wasmtime
      
      * Removed unused stuff
      
      * Cleanup
      
      * More cleanups
      
      * Introduce `CallContext`
      
      * Fixes
      
      * More fixes
      
      * Add builder for creating the `WasmExecutor`
      
      * Adds some docs
      
      * FMT
      
      * First round of feedback.
      
      * Review feedback round 2
      
      * More fixes
      
      * Fix try-runtime
      
      * Update client/executor/wasmtime/src/instance_wrapper.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Update client/executor/common/src/wasm_runtime.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Update client/executor/common/src/runtime_blob/runtime_blob.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Update client/executor/common/src/wasm_runtime.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Update client/allocator/src/freeing_bump.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Update client/allocator/src/freeing_bump.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Feedback round 3
      
      * FMT
      
      * Review comments
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      941288c6
  27. Feb 23, 2023
    • Gonçalo Pestana's avatar
    • Gonçalo Pestana's avatar
      Abstracts elections-phragmen pallet to use NposSolver (#12588) · b793666c
      Gonçalo Pestana authored
      
      
      * Abstracts elections-phragmen pallet to use NposSolver
      
      * Update frame/elections-phragmen/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/elections-phragmen/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * changes the name of the pallet; adds changelog
      
      * update changelog
      
      * Adds weight testing
      
      * Adds log macro_rules
      
      * renames elections-phragment dir to elections
      
      * weights rename
      
      * fixes typo in cargo toml
      
      * pre/post solve weight scafolding
      
      * refactor do_post_election
      
      * refactors into pre and post election solve for independent benchmarking
      
      * deconstructs PreElectionResults struct
      
      * updates benchmarking pre and post election solve; mock weights
      
      * Update frame/elections/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/elections/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * addresses PR comments
      
      * adds pre_solve and post_sove weights
      
      * Adds comments on election pallet id param name change
      
      * ".git/.scripts/bench-bot.sh" pallet dev pallet_elections
      
      * Finishes pre-post solve weights
      
      * Update frame/elections/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/elections/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Addresses PR comments: no panic in on_init path; nits
      
      * Fixes node build
      
      * Implements approval voting to use as a `NposSolver` (#13367)
      
      * Implements the approval voting methods in sp_npos_elections
      
      * fmt
      
      * remove unecessary file
      
      * comment clarification
      
      * re-run weights
      
      * fix typo
      
      * updates MaxVoters in tests for integrity_tests to pass
      
      * Refactors election provider support benchmarks outside its own crate (#13431)
      
      * Refactors election provider support benchmarks outside its own crate
      ---------
      
      Co-authored-by: command-bot <>
      
      ---------
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      b793666c
  28. Feb 22, 2023
    • Koute's avatar
      Rework storage iterators (#13284) · f8e3bdad
      Koute authored
      * Rework storage iterators
      
      * Make sure storage iteration is also accounted for when benchmarking
      
      * Use `trie-db` from crates.io
      
      * Appease clippy
      
      * Bump `trie-bench` to 0.35.0
      
      * Fix tests' compilation
      
      * Update comment to clarify how `IterArgs::start_at` works
      
      * Add extra tests
      
      * Fix iterators on `Client` so that they behave as before
      
      * Add extra `unwrap`s in tests
      
      * More clippy fixes
      
      * Come on clippy, give me a break already
      
      * Rename `allow_missing` to `stop_on_incomplete_database`
      
      * Add `#[inline]` to `with_recorder_and_cache`
      
      * Use `with_recorder_and_cache` in `with_trie_db`; add doc comment
      
      * Simplify code: use `with_trie_db` in `next_storage_key_from_root`
      
      * Remove `expect`s in the benchmarking CLI
      
      * Add extra doc comments
      
      * Move `RawIter` before `TrieBackendEssence` (no code changes; just cut-paste)
      
      * Remove a TODO in tests
      
      * Update comment for `StorageIterator::was_complete`
      
      * Update `trie-db` to 0.25.1
      f8e3bdad
  29. Feb 21, 2023
    • Vivek Pandya's avatar
      Remove years from copyright notes. (#13415) · bc53b9a0
      Vivek Pandya authored
      * Change copyright year to 2023 from 2022
      
      * Fix incorrect update of copyright year
      
      * Remove years from copy right header
      
      * Fix remaining files
      
      * Fix typo in a header and remove update-copyright.sh
      bc53b9a0
  30. Feb 20, 2023
    • Michal Kucharczyk's avatar
      `BlockId` removal: `runtime-api` refactor (#13255) · 7a101541
      Michal Kucharczyk authored
      
      
      * BlockId removal: refactor of runtime API
      
      It changes the arguments of:
      - `ApiExt` methods:  `has_api`, `has_api_with`, `api_version`
      - `CallApiAt` method: `runtime_version_at`
      from: `BlockId<Block>` to: `Block::Hash`
      
      It also changes the first argument of all generated runtime API calls from: `BlockId<Block>` to: `Block::Hash`
      
      This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)
      
      * BlockId removal: refactor of runtime API - tests
      
      - tests adjusted to new runtime API,
      - some tests migrated from block number to block hash
      
      * benchmarking-cli: BlockId(0) migrated to info().genesis_hash
      
      `runtime_api.call()` now requires the block hash instead of BlockId::Number.
      To access the genesis hash widely used in benchmarking engine the Client
      was constrained to satisfy `sp_blockchain::HeaderBackend<Block>` trait
      which provides `info().genesis_hash`.
      
      * trivial: api.call(BlockId) -> api.call(Hash)
      
      - Migrated all `runtime_api.calls` to use Hash
      - Noteworthy (?):
      -- `validate_transaction_blocking` in transaction pool,
      
      * CallApiAtParams::at changed to Block::Hash
      
      * missed doc updated
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * BlockId removal: Benchmark::consumed_weight
      
      Little refactor around `Benchmark::consumed_weight`: `BlockId` removed.
      
      * at_hash renamed
      
      * wrong merge fixed
      
      * beefy worker: merged with master
      
      * beefy: tests: missing block problem fixed
      
      * Apply review suggestion
      
      * fix
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: command-bot <>
      7a101541
  31. Feb 17, 2023
    • Piotr Mikołajczyk's avatar
      `try-runtime::fast-forward` (#12896) · 3595d871
      Piotr Mikołajczyk authored
      * try-runtime::fast-forward
      
      * Revert un`pub`ing command's fields
      
      * Handle storage change failure
      
      * Adjust Substrate node
      
      * Feature-gated imports
      
      * doc link
      
      * Feature-gated imports in node-template
      
      * Move trait, blanket implementation and auxiliary functions to a new module
      
      * Distinguish between plain babe+timestamp and substrate enhanced info
      
      * Remove uncles inherents
      
      * Missing argument
      
      * Add doc comment about `blocktime_millis`
      
      * Add licenses
      3595d871
  32. Feb 15, 2023
  33. Feb 12, 2023