1. Oct 29, 2020
  2. Oct 28, 2020
  3. Oct 27, 2020
    • Bastian Köcher's avatar
      Make consensus `SlotWorker` don't assume a slot is time / duration (#7441) · 05af334b
      Bastian Köcher authored
      
      
      * Make consensus `SlotWorker` don't assume a slot is time / duration
      
      This removes the last bit of assumption that a slot is always `time /
      duration`. This will be required by parachains where a slot will be the
      relay chain block number. Besides this there are also some other drive
      by changes. One more notable is that `on_slot` now returns a
      `SlotResult` that holds the block and a potential storage proof.
      
      To simplify the implementation and usage of the `SimpleSlotWorker` the
      `SlotWorker` trait is now implemented for each type that implements
      `SimpleSlotWorker`.
      
      * Update client/consensus/slots/src/lib.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Update client/consensus/slots/src/lib.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      05af334b
    • Shawn Tabrizi's avatar
      New Weight Template + Organization (#7391) · e4cfb255
      Shawn Tabrizi authored
      
      
      * add_handlebar_template_to_benchmark
      
      - add benchmark-cli arg to take in a handlebar-template file
      
      * update to always use template
      
      * rewrite writer for handlebars
      
      * polish
      
      * pass cmd data
      
      * update docs
      
      * new weight layout
      
      * separate templates
      
      * support custom filename output
      
      * Update command.rs
      
      * Create frame-weight-template.hbs
      
      * use a vector to maintain benchmark order
      
      * bring back ()
      
      * fix tests
      
      * fix build
      
      * Custom string serializer, remove feature flag
      
      * temp
      
      * rename
      
      * nit
      
      * update docs
      
      * docs on public objects
      
      * small fix
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * remove long line
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for system
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for staking
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_identity --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/identity/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for identity and staking
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_collective --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/collective/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for collective
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_democracy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/democracy/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for democracy
      
      * clean up zeros
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_elections_phragmen --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/elections-phragmen/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for elections phragmen
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_im_online --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/im-online/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for im online
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_indices --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/indices/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for indices
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_multisig --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/multisig/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for multisig
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_proxy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/proxy/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for proxy
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_scheduler --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/scheduler/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for scheduler
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_session --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/session/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for session
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_timestamp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/timestamp/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for timestamp
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for treasury
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for utility
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_vesting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/vesting/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * update for vesting
      
      * temp update
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      Co-authored-by: default avatarEzadkiel Marbella <[email protected]>
      Co-authored-by: default avatarParity Benchmarking Bot <[email protected]>
      e4cfb255
    • Xiliang Chen's avatar
      Implement batch_all and update Utility pallet for weight refunds (#7188) · f1480977
      Xiliang Chen authored
      
      
      * implement batch_all
      
      * bump version
      
      * updates
      
      * Better weight story for utility
      
      * small fixes
      
      * weights
      
      * assert_noop_ignore_postinfo doesnt make sense
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      f1480977
    • Bernhard Schuster's avatar
      improve error handling in cli (#7436) · f373ecbc
      Bernhard Schuster authored
      
      
      * other error variant should carry a dyn Error
      
      * introduce thiserror for error derive, add explicit error variants, cleanup dependencies
      
      * cleanup handle dev-deps of sc-cli too
      
      * Update client/cli/src/error.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      f373ecbc
    • Shawn Tabrizi's avatar
      Use Handlebars Template for Benchmark CLI Output (#7390) · 3ac070b6
      Shawn Tabrizi authored
      
      
      * add_handlebar_template_to_benchmark
      
      - add benchmark-cli arg to take in a handlebar-template file
      
      * update to always use template
      
      * rewrite writer for handlebars
      
      * polish
      
      * pass cmd data
      
      * update docs
      
      * support custom filename output
      
      * Update command.rs
      
      * Create frame-weight-template.hbs
      
      * use a vector to maintain benchmark order
      
      * fix tests
      
      * Custom string serializer, remove feature flag
      
      * update docs
      
      * docs on public objects
      
      * small fix
      
      Co-authored-by: default avatarEzadkiel Marbella <[email protected]>
      3ac070b6
    • Shawn Tabrizi's avatar
      Fix typo in toml (#7431) · 21d1cd0c
      Shawn Tabrizi authored
      21d1cd0c
  4. Oct 26, 2020
  5. Oct 24, 2020
  6. Oct 23, 2020
  7. Oct 22, 2020
    • Bastian Köcher's avatar
      Improve `mock_impl_runtime_apis!` (#7370) · 79be0777
      Bastian Köcher authored
      * Improve `mock_impl_runtime_apis!`
      
      This adds a new attribute for functions being implemented in the
      `mock_impl_runtime_apis!` macro, the `advanced` attribute. When this
      attribute is given the user gets access to the `at` parameter and is
      able to return a `Result`, instead of letting the macro generate this
      stuff.
      
      * Use the `at_param_name` directly
      
      * Prevent clashing of `params`
      79be0777
    • Cecile Tonglet's avatar
      Small fix for log line prefix (#7373) · d847c9b0
      Cecile Tonglet authored
      d847c9b0
    • Max Inden's avatar
      client/network: Make NetworkService::set_priority_group async (#7352) · 0fcf9d6c
      Max Inden authored
      As done with `NetworkService::{add_to,remove_from}_priority_group`, make
      `NetworkService::set_priority_group` async as well. This future-proofs
      the API should we ever decide to use a bounded channel between
      `NetworkService` and `NetworkWorker`.
      0fcf9d6c
  8. Oct 21, 2020
  9. Oct 20, 2020
    • Nikolay Volf's avatar
      Runtime worker threads (#7089) · a062bc2f
      Nikolay Volf authored
      
      
      * std variant
      
      * principal work
      
      * format and naming
      
      * format and naming continued
      
      * working nested fork
      
      * add comment
      
      * naming and tabs
      
      * line width
      
      * fix wording
      
      * address review
      
      * refactor dynamic dispatch
      
      * update wasmtime
      
      * some care
      
      * move ext
      
      * more refactor
      
      * doc effort
      
      * simplify
      
      * doc effort
      
      * tests and docs
      
      * address review
      
      * naming
      
      * explain some args
      
      * add example
      
      * unwinding for native and tests
      
      * rename stray
      
      * fix refs
      
      * fix tests
      
      * fix warnings
      
      * stray naming
      
      * fixes and comments
      
      * Update primitives/io/src/tasks.rs
      
      Co-authored-by: default avatarcheme <[email protected]>
      
      * make examples "compile"
      
      * dyn_dispatch -> spawn_call
      
      * fix impl
      
      * address review
      
      * Update primitives/io/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update primitives/io/src/tasks.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update primitives/io/src/async_externalities.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update primitives/io/src/tasks.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/example-parallel/src/lib.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * fix compilation
      
      * Update client/executor/common/src/wasm_runtime.rs
      
      Co-authored-by: default avatarSergei Shulepov <[email protected]>
      
      * address review
      
      * Update client/executor/wasmtime/src/instance_wrapper.rs
      
      Co-authored-by: default avatarSergei Shulepov <[email protected]>
      
      * Update client/executor/src/native_executor.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update primitives/io/src/tasks.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update client/executor/src/native_executor.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update primitives/io/src/tasks.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update client/executor/wasmtime/src/instance_wrapper.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * address some issues
      
      * address more issues
      
      * wasm_only interface
      
      * define sp_tasks
      
      * avoid anyhow
      
      * fix example
      
      Co-authored-by: default avatarcheme <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarSergei Shulepov <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      a062bc2f
    • Bastian Köcher's avatar
      Fix logging from inside the WASM runtime (#7355) · 203acda6
      Bastian Köcher authored
      * Fix logging from inside the WASM runtime
      
      When using `RuntimeLogger` to log something from the runtime, we didn't
      set any logging level. So, we actually did not log anything from the
      runtime as logging is disabled by default. This pr fixes that by setting
      the logging level to `TRACE`. It also adds a test to ensure this does
      not break again ;)
      
      * Update frame/support/src/debug.rs
      203acda6
    • Max Inden's avatar
      *: Bump async-std to v1.6.5 (#7306) · 918a0c80
      Max Inden authored
      * *: Bump async-std to v1.6.5
      
      Prevent users from using v1.6.4 which faces issues receiving incoming
      TCP connections. See https://github.com/async-rs/async-std/issues/888
      for details.
      
      * client/network/src/gossip: Use channel instead of condvar
      
      `async_std::sync::Condvar::wait_timeout` uses
      `gloo_timers::callback::Timeout` when compiled for
      `wasm32-unknown-unknown`. This timeout implementation does not fulfill
      the requirement of being `Send`.
      
      Instead of using a `Condvar` use a `futures::channel::mpsc` to signal
      progress from the `QueuedSender` to the background `Future`.
      
      * client/network/Cargo.toml: Remove async-std unstable feature
      
      * client/network/src/gossip: Forward all queued messages
      
      * client/network/gossip: Have QueuedSender methods take &mut self
      
      * client/network/gossip: Move queue_size_limit into QueuedSender
      
      The `queue_size_limit` field is only accessed by `QueuedSender`, thus
      there is no need to share it between the background future and the
      `QueuedSender`.
      
      * client/network/gossip: Rename background task to future
      
      To be a bit picky the background task is not a task in the sense of an
      asynchonous task, but rather a background future in the sense of
      `futures::future::Future`.
      918a0c80