1. Mar 07, 2023
  2. Mar 06, 2023
    • Aaro Altonen's avatar
      Extract syncing protocol from `sc-network` (#12828) · 1a7f5be0
      Aaro Altonen authored
      
      
      * Move import queue out of `sc-network`
      
      Add supplementary asynchronous API for the import queue which means
      it can be run as an independent task and communicated with through
      the `ImportQueueService`.
      
      This commit removes removes block and justification imports from
      `sc-network` and provides `ChainSync` with a handle to import queue so
      it can import blocks and justifications. Polling of the import queue is
      moved complete out of `sc-network` and `sc_consensus::Link` is
      implemented for `ChainSyncInterfaceHandled` so the import queue
      can still influence the syncing process.
      
      * Move stuff to SyncingEngine
      
      * Move `ChainSync` instanation to `SyncingEngine`
      
      Some of the tests have to be rewritten
      
      * Move peer hashmap to `SyncingEngine`
      
      * Let `SyncingEngine` to implement `ChainSyncInterface`
      
      * Introduce `SyncStatusProvider`
      
      * Move `sync_peer_(connected|disconnected)` to `SyncingEngine`
      
      * Implement `SyncEventStream`
      
      Remove `SyncConnected`/`SyncDisconnected` events from
      `NetworkEvenStream` and provide those events through
      `ChainSyncInterface` instead.
      
      Modify BEEFY/GRANDPA/transactions protocol and `NetworkGossip` to take
      `SyncEventStream` object which they listen to for incoming sync peer
      events.
      
      * Introduce `ChainSyncInterface`
      
      This interface provides a set of miscellaneous functions that other
      subsystems can use to query, for example, the syncing status.
      
      * Move event stream polling to `SyncingEngine`
      
      Subscribe to `NetworkStreamEvent` and poll the incoming notifications
      and substream events from `SyncingEngine`.
      
      The code needs refactoring.
      
      * Make `SyncingEngine` into an asynchronous runner
      
      This commits removes the last hard dependency of syncing from
      `sc-network` meaning the protocol now lives completely outside of
      `sc-network`, ignoring the hardcoded peerset entry which will be
      addressed in the future.
      
      Code needs a lot of refactoring.
      
      * Fix warnings
      
      * Code refactoring
      
      * Use `SyncingService` for BEEFY
      
      * Use `SyncingService` for GRANDPA
      
      * Remove call delegation from `NetworkService`
      
      * Remove `ChainSyncService`
      
      * Remove `ChainSync` service tests
      
      They were written for the sole purpose of verifying that `NetworWorker`
      continues to function while the calls are being dispatched to
      `ChainSync`.
      
      * Refactor code
      
      * Refactor code
      
      * Update client/finality-grandpa/src/communication/tests.rs
      
      Co-authored-by: default avatarAnton <[email protected]>
      
      * Fix warnings
      
      * Apply review comments
      
      * Fix docs
      
      * Fix test
      
      * cargo-fmt
      
      * Update client/network/sync/src/engine.rs
      
      Co-authored-by: default avatarAnton <[email protected]>
      
      * Update client/network/sync/src/engine.rs
      
      Co-authored-by: default avatarAnton <[email protected]>
      
      * Add missing docs
      
      * Refactor code
      
      ---------
      
      Co-authored-by: default avatarAnton <[email protected]>
      1a7f5be0
  3. Mar 03, 2023
  4. Mar 02, 2023
  5. Feb 27, 2023
  6. Feb 25, 2023
  7. 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
  8. Feb 23, 2023
  9. Feb 21, 2023
  10. 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
  11. 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
  12. Feb 16, 2023
  13. Feb 14, 2023
  14. Feb 12, 2023
  15. Feb 08, 2023
  16. Feb 06, 2023
  17. Jan 30, 2023
  18. Jan 29, 2023
  19. Jan 28, 2023
  20. Jan 26, 2023
  21. Jan 25, 2023
    • Kian Paimani's avatar
      reduce exec time of fast-unstake benchmarks (#13120) · 451a13c6
      Kian Paimani authored
      * reduce exec time of fast-unstake benchmarks
      
      * fix test
      
      * fmt
      
      * fix patch the tests
      
      * fix patch the tests
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * add batch size as well
      
      * update some benches to be better
      
      * fix one last test
      
      * fix
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * reduce time even more
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * fix tests
      
      * nit
      
      * remove
      
      * improve the weight calc further
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * fix benchmarks
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * update
      
      * fix
      
      * fix
      
      * fmt
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * lots of changes again...
      
      * smaller input
      
      * update
      
      * fmt
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * cleanup
      
      * small simplification
      
      * fmt
      
      * reduce exec time a bit
      
      * fix
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * test
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * increase again
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      * review comments
      
      * fmt
      
      * fix
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_fast_unstake
      
      Co-authored-by: command-bot <>
      451a13c6
  22. Jan 24, 2023
  23. Jan 21, 2023
  24. Jan 20, 2023
  25. Jan 19, 2023
  26. Jan 18, 2023
    • Sasha Gryaznov's avatar
      [contracts] Add integrity checks by pallet hook (#12993) · 549637d9
      Sasha Gryaznov authored
      
      
      * integrity test for MaxCodeLen and CallStack::len()
      
      * integrity test for MaxDebugBufferLen
      
      * addressed review comments
      
      * fix append_debug_buffer()
      
      * ci fix
      
      * updated code_len_limit formula after further discussion
      
      * enlarged mem safe margin after discussion
      
      * +doc to Config trait associated types
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * more lil fixes from code review feedback
      
      * lowered max call depth to satisfy mem limits
      
      * fix node runtime pallet params to satisfy integrity check
      
      * fix max call depth value calc
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      549637d9