1. Sep 01, 2020
  2. Aug 20, 2020
    • Web3 Philosopher's avatar
      Merge Subkey into sc-cli (#4954) · 6e098a10
      Web3 Philosopher authored
      * draft
      
      * revert
      
      * WIP
      
      * all that remains is tests
      
      * update Cargo.lock
      
      * tests WIP
      
      * WIP refactor node-template-runtime and node-runtime
      
      * implments sc_cli::RuntimeAdapter for node_template_runtime::Runtime
      
      * final draft
      
      * fix update_config for subcommands
      
      * proper AccountId decoding
      
      * test-runtime tests
      
      * revert
      
      * move RuntimeAdapter to cli-utils
      
      * use &'static str for TryFrom::<&'a str>::Error for Ss58AddressFormat
      
      * tests
      
      * add frame-system to sc-cli dev-dependencies
      
      * add frame-system to sc-cli dev-dependencies
      
      * fix ui test
      
      * wip
      
      * fixed inspect test
      
      * bump impl version
      
      * bump impl version, fixx spaces remove todos
      
      * pallet-balances-cli, rustc for some reason cannot resolve pallet_balances_cli in node-cli 😩
      
      * wip
      
      * Subcommand::run takes &self
      
      * can't believe i missed that 🤦🏾‍♂️
      
      * bump wasm-bindgen for some reason
      
      * adds key subcommand, rename generate-node-key to generate-node-id
      
      * cargo update and crossed fingers 🤞🏽
      
      
      
      * update ui test
      
      * update more ui tests
      
      * should be all good now
      
      * revert subkey change
      
      * revert subkey change
      
      * adds frame-utilities-cli
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBenjamin Kampmann <[email protected]>
      
      * removes frame from sc-cli, fix license
      
      * my editor and ci disagrees on line width
      
      * bump spec version
      
      * turn off default features for parity-scale-codec
      
      * enable full_crypto feature for sp-core in cli-utils
      
      * merge frame-utilities-cli with pallet-balances-cli
      
      * remove full_crypto feature from sp_core in cli-utils
      
      * bump Cargo.lock
      
      * cli-utils -> frame-utils
      
      * rename BlockNumber to GenericNumber, fix spaces
      
      * fix spaces
      
      * construct additional_signed manually
      
      * sign test
      
      * remove unused vars
      
      * implement subkey with frame-utilities-cli and sc_cli
      
      * fix moduleid test
      
      * CI and clion disagree on line widths
      
      * adds associated Params type to SignedExtensionProvider
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBenjamin Kampmann <[email protected]>
      
      * move some code around
      
      * removes unneccesary generic params
      
      * moves module_id back to frame_utilities_cli
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBenjamin Kampmann <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * remove print_ext
      
      * remove MaybeDisplay from pallet_balances::Trait::Balance
      
      * a lot of stuff tbh
      
      * adds ExtrasParamsBuilder
      
      * remove tests for ModuleIdCmd
      
      * address comments from PR
      
      * bump Cargo.lock
      
      * manually insert key into keystore
      
      * remove unnecessary SharedParams
      
      * add validation to vanity pattern, remove unused arg
      
      * remove SharedParams from Sign, Vanity, Verify
      
      * remove SharedParams from ModuleIdCmd, remove expect from Verify, new line to Cargo.toml
      
      * remove SharedParams from InsertCmd
      
      * 🤦🏾
      
      ‍♂️
      
      * deleted prometheus.yml
      
      * move a few things around
      
      * fix vanity test
      
      Co-authored-by: default avatarBenjamin Kampmann <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarBenjamin Kampmann <[email protected]>
      6e098a10
  3. Jul 28, 2020
  4. Jul 22, 2020
    • Wei Tang's avatar
      Better handling of stable-only build (#6569) · 17922fe4
      Wei Tang authored
      
      
      * Better handling of stable-only build
      
      * Fix node template build
      
      * Fix wasm builder node-template version mismatch
      
      * Fix load_spec error
      
      * Add , in parameter
      
      * Add descrptive panic messages in tests
      
      * Add descriptive tests in node/executor benches
      
      * Fix missing compact_code_unwrap
      
      * Add missing wasm_binary_unwrap function for executor integration test
      
      * Only define import_sp_io in no_std
      
      * Small Cargo.toml styling fix
      
      * Bump wasm-builder to 2.0.0
      
      * Fix all `with_wasm_builder_from_crates` version in Substrate
      
      * Use `with_wasm_builder_from_crates` for node-template
      
      Co-authored-by: default avatarGavin Wood <[email protected]>
      17922fe4
    • Ashley's avatar
      Remove the service builder (#6557) · 08c3d65c
      Ashley authored
      
      
      * :)
      
      * Slight tidy
      
      * Remove ServiceBuilderCommand
      
      * Remove whitespace
      
      * Keep task manager alive for check_block/import_blocks
      
      * Pass task_manager to run_until_exit
      
      * WIP
      
      * WIP
      
      * Get rid of the macros
      
      * Simplify a few chain components creation APIs related to the service
      
      * Fix basic-authorship doc tests
      
      * Remove DefaultQueue
      
      * Update client/service/src/builder.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Move ExecutionExtensions comment around
      
      * Remove unused BlakeTwo256
      
      * Add sc-prelude
      
      * Rename sc-prelude to sc-service-prelude
      
      * Rename to sc-service-types
      
      * Improve service types
      
      * Fix line widths
      
      * Remove sc-service-types and move type definitions to crates
      
      * Update bin/node-template/node/src/service.rs
      
      Co-authored-by: default avatarSeun Lanlege <[email protected]>
      
      * Add TLightClientWithHash
      
      * Rework types
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      Co-authored-by: default avatarSeun Lanlege <[email protected]>
      08c3d65c
  5. Jul 02, 2020
  6. Jun 30, 2020
    • Ashley's avatar
      Remove the service, replacing it with a struct of individual chain components (#6352) · ec2ab797
      Ashley authored
      * WIP
      
      * Making progress
      
      * Almost ready
      
      * Get service tests compiling
      
      * Fix node screenshot
      
      * Line widths
      
      * Fix node cli tests
      
      * Fix node cli warning
      
      * ChainComponents -> ServiceComponents, fix tests
      
      * make spawn_handle public
      
      * Remove spawnnamed impl for taskmanager
      
      * Move the keep alive stuff to the task manager
      
      * Move the telemetry, base path, rpc keep_alive to the service builder
      
      * Make the task manager keep alive an internal detail
      
      * Rewrite the browser start_client future
      
      * Remove run_node etc
      
      * Revert my personal changes to browser-demo/build.sh
      
      * use |config|
      
      * Add a runtime_version function to SubstrateCli
      
      * Reexport role and runtime version from sc cli
      
      * Update Cargo.lock
      
      * runtime_version -> native_runtime_version
      
      * Pass chain spec to native_runtime_version for polkadot
      
      * Fix line widths
      
      * Traitify ServiceComponents Client
      ec2ab797
  7. May 15, 2020
  8. Apr 21, 2020
  9. Apr 13, 2020
  10. Apr 07, 2020
    • Cecile Tonglet's avatar
      CLI: refactoring: remove Options from sc_service::Configuration's fields (#5271) · b0efaa2c
      Cecile Tonglet authored
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * Rename IntoConfiguration to CliConfiguration
      
      * Renamed into_configuration to create_configuration
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * Move keystore params to its own module
      
      * Use in-memory keystore even for build-spec
      
      * Enforce proper value for node name
      
      * dev_key_seed
      
      * Telemetry endpoints
      
      * rustfmt
      
      * Converted all RunCmd
      
      * rustfmt
      
      * Added export-blocks
      
      * Missed something
      
      * Removed config_path in NetworkConfiguration (not used)
      
      * Fixed warnings
      
      * public_addresses is used but never set, keeping it
      
      * Merge Configuration.node and NetworkConfiguration.node_name
      
      ...because they are the same thing
      
      * Added: import-blocks
      
      * Adding a proc_macro to help impl SubstrateCli
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * Re-export spec_factory from sc_cli
      
      * Re-added all the commands
      
      * Refactored node_key_params
      
      * Fixed previous refucktoring
      
      * Clean-up and removed full_version()
      
      * Renamed get_is_dev to not confuse with Configuration field
      
      * Fixed sc-cli-derive example
      
      * Fixing tests
      
      * Fixing tests and removing some (will re-add later)
      
      * Fixing more tests
      
      * Removes the need of type parameter
      
      * Converting bin/node and simplifying API
      
      * Converting more
      
      * Converting last command
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * Fixing tests and added default for WasmExecutionMethod
      
      * Fixing stuff
      
      * Fixed something I broke oops
      
      * Update Cargo.lock
      
      * Moving things around
      
      * Convert everything to Result
      
      * Added new macros to simplify the impl of CliConfiguration
      
      * Added a macro to generate CliConfiguration automatically for subcommands
      
      * Revert... too many macros (this one is not really useful)
      
      This reverts commit 9c516dd3
      
      .
      
      * Renamed is_dev to get_is_dev
      
      Good enough for now
      
      * Fixed name roles (this is plural, not singular)
      
      * Clean-up
      
      * Re-export NodeKeyConfig and TelemetryEndpoints from sc_service
      
      * Improve styling/formatting
      
      * Added copyrights
      
      * Added doc and fixed warnings
      
      * Added myself to code owners
      
      * Yes it is needed according to the history
      
      * Revert formatting
      
      * Fixing conflict
      
      * Updated build.rs
      
      * Cargo.lock
      
      * Clean-up
      
      * Update client/cli-derive/Cargo.toml
      
      Co-Authored-By: default avatarSeun Lanlege <[email protected]>
      
      * Fail if using proc_macro and build.rs is not set properly
      
      * Dropped all get_ in front of methods
      
      * Clean-up
      
      * Fixing proc macro missing env var
      
      * Get the configuration inside the Runtime (needed for polkadot)
      
      * Clean-up
      
      * Get is_dev from argument like the others
      
      * Get chain ID instead of chain spec from shared params
      
      * &self is passed to spec_factory/load_spec
      
      * Wrong text
      
      * Fix example
      
      * Officialize macro and made a cool doc
      
      * Renamed spec_factory to load_spec (substrate_cli_configuration)
      
      * Removed not so useful ChainSpec
      
      * Renamed SubstrateCLI to SubstrateCli
      
      * Added changelog for impl_version being full now
      
      * Renamed Runtime to Runner
      
      * Update changelog to show example
      
      * Removed option on database cache size
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * Fix on removal of option
      
      * typo
      
      * Clean-up imports
      
      * Added info in Cargo.toml
      
      * typo
      
      * remarks
      
      * Moved function for build.rs to substrate-build-script-utils
      
      * Fixed example & test of cli-derive
      
      * Moved function for build.rs to substrate-build-script-utils
      
      * Renamed substrate_cli_configuration to substrate_cli oops
      
      It implements SubstrateCli not CliConfiguration!
      
      * Added documentation and wrapper macro
      
      * Removed option on database cache size
      
      * Removed option on database cache size
      
      * Clean-up
      
      * Reduce risk of errors due to typos
      
      * Removed option on database cache size
      
      * Added NOTE as suggested
      
      * Added doc as suggested
      
      * Fixed test
      
      * typo
      
      * renamed runtime to runner
      
      * Fixed weird argument
      
      * More commas
      
      * Moved client/cli-derive to client/cli/derive
      
      * Added 7 tests for the macros
      
      * Improve error message
      
      * Upgrade assert_cmd
      
      * Fixing missing stuff
      
      * Fixed unused import
      
      * Improve SubstrateCli doc
      
      * Applied suggestions
      
      * Fix and clean-up imports
      
      * Started replacing macros WIP
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * Started removing substrate_cli
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * WIP
      
      Forked at: 2afecf81
      Parent branch: origin/master
      
      * WIP
      
      Forked at: 2afecf81
      
      
      Parent branch: origin/master
      
      * fixed bug introduced while refactoring
      
      * Renamed NetworkConfigurationParams to NetworkParams for consistency sake
      
      * Fixed test
      
      * Update client/cli/src/commands/runcmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/commands/runcmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/commands/export_blocks_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/commands/check_block_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update bin/node/cli/src/command.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update bin/node/cli/src/command.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/commands/export_blocks_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Revert "Update client/cli/src/commands/export_blocks_cmd.rs"
      
      This reverts commit 59067769.
      
      * Revert "Update client/cli/src/commands/check_block_cmd.rs"
      
      This reverts commit f705f42b.
      
      * Revert "Update client/cli/src/commands/export_blocks_cmd.rs"
      
      This reverts commit 8d57c055.
      
      * Revert "Update client/cli/src/commands/runcmd.rs"
      
      This reverts commit 93e74cf5.
      
      * Revert "Update client/cli/src/commands/runcmd.rs"
      
      This reverts commit 11d527ba
      
      .
      
      * Update client/cli/src/commands/export_blocks_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/commands/import_blocks_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/commands/purge_chain_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Changed ::sc_cli to $crate in the macro
      
      * fixed tests
      
      * fixed conflicts
      
      * Fixing test
      
      * Update client/cli/src/commands/purge_chain_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/params/pruning_params.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Remove comment as suggested
      
      * Apply suggestion
      
      * Update client/cli/src/commands/purge_chain_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/commands/purge_chain_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/commands/purge_chain_cmd.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update utils/frame/benchmarking-cli/src/command.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/runner.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/runner.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/runner.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/params/pruning_params.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/params/node_key_params.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/params/network_params.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/lib.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/config.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Added doc
      
      * Fixed error introduced after applying suggestion
      
      * Revert "Update client/cli/src/params/pruning_params.rs"
      
      This reverts commit 0574d06a
      
      .
      
      * Print error
      
      * Apply suggestions from code review
      
      * Remove useless Results
      
      * Fixed CI failing on polkadot approval
      
      Co-authored-by: default avatarSeun Lanlege <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      b0efaa2c
  11. Feb 21, 2020
    • Cecile Tonglet's avatar
      Add tests & Service's Configuration has optional fields that shouldn't be optional (#4842) · 97ad8026
      Cecile Tonglet authored
      Related to #4776 
      Related to https://github.com/paritytech/polkadot/pull/832
      
      To summarize the changes:
      1. I did not manage to validate with types the service's Configuration. But I did reduce the possibility of errors by moving all the "fill" functions to their respective structopts
      2. I split params.rs to multiple modules: one module params for just CLI parameters and one module commands for CLI subcommands (and RunCmd). Every command and params are in their own file so things are grouped better together and easier to remove
      3. I removed the run and run_subcommand helpers as they are not helping much anymore. Running a command is always a set of 3 commands: 1. init 2. update config 3. run. This still allow the user to change the config before arguments get parsed or right after.
      4. I added tests for all subcommands.
      5. [deleted]
      
      Overall the aim is to improve the situation with the Configuration and the optional parameters, add tests, make the API more consistent and simpler.
      97ad8026
  12. Feb 07, 2020
  13. Feb 06, 2020
    • Cecile Tonglet's avatar
      CLI improvements & fixes (#4812) · 099cd0f2
      Cecile Tonglet authored
      These are a few changes I missed during the refactoring.
      
      1. Initialization issue and boilerplate
      
          Most importantly: part of the `Configuration` initialization was done in `sc_cli::init`. This means the user can not benefit from this initialization boilerplate if they have multiple `Configuration` since `sc_cli::init` can only be called once.
      
      2. Boilerplate for `VersionInfo` and `Configuration`
      
          I'm also answering to the critic of @bkchr on the initialization using version: https://github.com/paritytech/substrate/pull/4692/files/bea809d4c14a2ede953227ac885e3b3f9771c548#r372047238 This will allow initializing a `Configuration` and provide the version by default.
      
      3. Loading the `chain_spec` explicitly
      
          In the past it was done automatically but in some cases we want to delay this. I moved the code to `Configuration.load_spec()` so it can be called later on. `chain_spec` can also be written directly to the `Configuration` without using this `load_spec` helper.
      
      4. [deleted]
      
      5. Fixing issue that prevents the user to override the port
      
          In the refactoring I introduced a bug by mistake that could potentially prevent the CLI user to override the ports if defaults where provided for these ports (only on cumulus).
      
      6. Change task_executor from Box to Arc
      
          This is useful for cumulus where we have 2 nodes with 2 separate Configuration that need to spawn tasks to the same runtime.
      
      7. Renamed TasksExecutorRequired to TaskExecutor
      
          For consistency.
      
      This is related to https://github.com/paritytech/cumulus/issues/24
      
      This is the continuation (and hopefully the end of) #4692 
      099cd0f2
    • Jimmy Chu's avatar
      Node template folders restructuring (#4811) · 3fc91c76
      Jimmy Chu authored
      * Restructure node-template so it is clear that node, runtime, and pallets are separated
      * Separating to mock and tests
      * restructuring runtime to top-level
      * updated release script
      * updated Cargo.lock
      3fc91c76
  14. Jan 30, 2020
    • Cecile Tonglet's avatar
      CLI API refactoring and improvement (#4692) · 26e37ff6
      Cecile Tonglet authored
      It changes the way we extended the CLI functionalities of substrate to allow more flexibility. (If this was not clear, here is another version: it changes the `sc_cli` API to allow more flexibility).
      
      This touches a few important things:
       - the startup of the async task with tokei:
          This was in node and node-template and I moved it to substrate. The idea is to have 1 time the code that handles unix signals (SIGTERM and SIGINT) properly. It is however possible to make this more generic to wait for a future instead and provide only a helper for the basic handling of SIGTERM and SIGINT.
       - increased the version of structopt and tokei
       - no more use of structopt internal's API
       - less use of generics
      
      Related to #4643 and https://github.com/paritytech/cumulus/pull/42: the implementation of "into_configuration" and "get_config" are similar but with better flexibility so it is now possible in cumulus to have the command-line arguments only of the run command for polkadot if we want
      
      Related to https://github.com/paritytech/cumulus/issues/24 and https://github.com/paritytech/cumulus/issues/34 : it will now be possible to make a configuration struct for polkadot with some overrides of the default parameters much more easily.
      26e37ff6
  15. Jan 05, 2020
  16. Nov 22, 2019
  17. Nov 21, 2019
  18. Nov 14, 2019
    • Benjamin Kampmann's avatar
      Reorganising the repository - external renames and moves (#4074) · f44873dc
      Benjamin Kampmann authored
      * Adding first rough ouline of the repository structure
      
      * Remove old CI stuff
      
      * add title
      
      * formatting fixes
      
      * move node-exits job's script to scripts dir
      
      * Move docs into subdir
      
      * move to bin
      
      * move maintainence scripts, configs and helpers into its own dir
      
      * add .local to ignore
      
      * move core->client
      
      * start up 'test' area
      
      * move test client
      
      * move test runtime
      
      * make test move compile
      
      * Add dependencies rule enforcement.
      
      * Fix indexing.
      
      * Update docs to reflect latest changes
      
      * Moving /srml->/paint
      
      * update docs
      
      * move client/sr-* -> primitives/
      
      * clean old readme
      
      * remove old broken code in rhd
      
      * update lock
      
      * Step 1.
      
      * starting to untangle client
      
      * Fix after merge.
      
      * start splitting out client interfaces
      
      * move children and blockchain interfaces
      
      * Move trie and state-machine to primitives.
      
      * Fix WASM builds.
      
      * fixing broken imports
      
      * more interface moves
      
      * move backend and light to interfaces
      
      * move CallExecutor
      
      * move cli off client
      
      * moving around more interfaces
      
      * re-add consensus crates into the mix
      
      * fix subkey path
      
      * relieve client from executor
      
      * starting to pull out client from grandpa
      
      * move is_decendent_of out of client
      
      * grandpa still depends on client directly
      
      * lemme tests pass
      
      * rename srml->paint
      
      * Make it compile.
      
      * rename interfaces->client-api
      
      * Move keyring to primitives.
      
      * fixup libp2p dep
      
      * fix broken use
      
      * allow dependency enforcement to fail
      
      * move fork-tree
      
      * Moving wasm-builder
      
      * make env
      
      * move build-script-utils
      
      * fixup broken crate depdencies and names
      
      * fix imports for authority discovery
      
      * fix typo
      
      * update cargo.lock
      
      * fixing imports
      
      * Fix paths and add missing crates
      
      * re-add missing crates
      f44873dc
  19. Oct 10, 2019
  20. Oct 09, 2019
    • Bastian Köcher's avatar
      Move `Externalities` into its own crate (#3775) · 79c776af
      Bastian Köcher authored
      * Move `Externalities` into `substrate-externalities`
      
      - `Externalities` now support generic extensions
      - Split of `primtives-storage` for storage primitive types
      
      * Move the externalities scoping into `substrate-externalities`
      
      * Fix compilation
      
      * Review feedback
      
      * Adds macro for declaring extensions
      
      * Fix benchmarks
      
      * Introduce `ExtensionStore` trait
      
      * Last review comments
      
      * Implement it for `ExtensionStore`
      79c776af
  21. Aug 16, 2019
    • Tomasz Drwięga's avatar
      Offences reporting and slashing (#3322) · 5d992d80
      Tomasz Drwięga authored
      
      
      * Remove offline slashing logic from staking.
      
      * Initial version of reworked offence module, can report offences
      
      * Clean up staking example.
      
      * Commit SlashingOffence
      
      * Force new era on slash.
      
      * Add offenders in the SlashingOffence trait.
      
      * Introduce the ReportOffence trait.
      
      * Rename `Offence`.
      
      * Add on_before_session_ending handler.
      
      * Move offence related stuff under sr-primitives.
      
      * Fix cargo check.
      
      * Import new im-online implementation.
      
      * Adding validator count to historical session storage as it's needed for slash calculations
      
      * Add a comment about offence.
      
      * Add BabeEquivocationOffence
      
      * GrandpaEquivocationOffence
      
      * slash_fraction and fix
      
      * current_era_start_session_index
      
      * UnresponsivnessOffence
      
      * Finalise OnOffenceHandler traits, and stub impl for staking.
      
      * slash_fraction doesn't really need &self
      
      * Note that offenders count is greater than 0
      
      * Add a test to ensure that I got the math right
      
      * Use FullIdentification in offences.
      
      * Use FullIndentification.
      
      * Hook up the offences module.
      
      * Report unresponsive validators
      
      * Make sure eras have the same length.
      
      * Slashing and rewards.
      
      * Fix compilation.
      
      * Distribute rewards.
      
      * Supply validators_count
      
      * Use identificationTuple in Unresponsivness report
      
      * Fix merge.
      
      * Make sure we don't slash if amount is zero.
      
      * We don't return an error from report_offence anymo
      
      * We actually can use vec!
      
      * Prevent division by zero if the reporters is empty
      
      * offence_forces_new_era/nominators_also_get_slashed
      
      * advance_session
      
      * Fix tests.
      
      * Update srml/staking/src/lib.rs
      
      Co-Authored-By: default avatarRobert Habermeier <[email protected]>
      
      * slashing_performed_according_exposure
      
      * Check that reporters receive their slice.
      
      * Small clean-up.
      
      * invulnerables_are_not_slashed
      
      * Minor clean ups.
      
      * Improve docs.
      
      * dont_slash_if_fraction_is_zero
      
      * Remove session dependency from offences.
      
      * Introduce sr-staking-primitives
      
      * Move offence under sr_staking_primitives
      
      * rename session_index
      
      * Resolves todos re using SessionIndex
      
      * Fix staking tests.
      
      * Properly scale denominator.
      
      * Fix UnresponsivnessOffence
      
      * Fix compilation.
      
      * Tests for offences.
      
      * Clean offences tests.
      
      * Fix staking doc test.
      
      * Bump spec version
      
      * Fix aura tests.
      
      * Fix node_executor
      
      * Deposit an event on offence.
      
      * Fix compilation of node-runtime
      
      * Remove aura slashing logic.
      
      * Remove HandleReport
      
      * Update docs for timeslot.
      
      * rename with_on_offence_fractions
      
      * Add should_properly_count_offences
      
      * Replace ValidatorIdByIndex with CurrentElectedSet
      
      ValidatorIdByIndex was querying the current_elected set in each call, doing loading (even though its from cache), deserializing and cloning of element.
      
      Instead of this it is more efficient to use `CurrentElectedSet`. As a small bonus, the invariant became a little bit easier: now we just rely on the fact that `keys` and `current_elected` set are of the same length rather than relying on the fact that `validator_id_by_index` would work similar to `<[T]>::get`.
      
      * Clarify babe equivocation
      
      * Fix offences.
      
      * Rename validators_count to validator_set_count
      
      * Fix squaring.
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Docs for CurrentElectedSet.
      
      * Don't punish only invulnerables
      
      * Use `get/insert` instead of `mutate`.
      
      * Fix compilation
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Update srml/offences/src/lib.rs
      
      Co-Authored-By: default avatarRobert Habermeier <[email protected]>
      
      * Update srml/im-online/src/lib.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update srml/im-online/src/lib.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update srml/im-online/src/lib.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update srml/babe/src/lib.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Add aura todo.
      
      * Allow multiple reports for single offence report.
      
      * Fix slash_fraction calculation.
      
      * Fix typos.
      
      * Fix compilation and tests.
      
      * Fix staking tests.
      
      * Update srml/im-online/src/lib.rs
      
      Co-Authored-By: default avatarLogan Saether <[email protected]>
      
      * Fix doc on time_slot
      
      * Allow slashing only on current era (#3411)
      
      * only slash in current era
      
      * prune journal for last era
      
      * comment own_slash
      
      * emit an event when old slashing events are discarded
      
      * Pave the way for pruning
      
      * Address issues.
      
      * Try to refactor collect_offence_reports
      
      * Other fixes.
      
      * More fixes.
      5d992d80
  22. Jul 29, 2019
    • Kian Paimani's avatar
      Refactor sr_primitives. (#3214) · 1fcd1286
      Kian Paimani authored
      * refactor sr_primitives.
      
      * Fix try build error.
      
      * Line-width
      
      * Ui test.
      
      * Final fixes.
      
      * Fix build again.
      
      * bring back ui test.
      
      * Fix unsigned import.
      
      * Another ui fix.
      
      * Also refactor substrate-primitives
      
      * Fix benchmarks.
      
      * Fix doc test.
      
      * fix doc tests
      1fcd1286
  23. May 29, 2019
    • DemiMarie-parity's avatar
      Introduce inherent digests (#2466) · 6e253c89
      DemiMarie-parity authored
      
      
      * Introduce inherent digests
      
      * Implement inherent digests
      
      * fix silly error
      
      * Implementation of inherent digests in BABE
      
      All tests pass. There are still limitations:
      
      1. The runtime strips out inherent digests, so BABE must re-add them.
      2. The test runtime checks that it can re-compute all digests.  It
         can’t, so I had to comment out that test.
      
      * Fix compilation and seal import
      
      Seals were not imported correctly: the pre-digest was imported twice,
      instead of both it and the seal being imported.  Also, other parts of
      the code did not compile due to incomplete refactoring.
      
      * Remove bogus assertion
      
      * Fix testsuite compilation
      
      * Remove unused import
      
      * Fix compiler diagnostics
      
      * Add inherent digest parameters to block constructors
      
      This enforces that inherent digests are added first.
      
      * Fixup Cargo.lock
      
      * Fix build errors
      
      * Re-add an incorrectly removed import
      
      * Bump primitive-types version
      
      * Update Cargo.lock
      
      * Refactoring
      
      * Use inherent digests for AuRa
      
      They do reach the runtime, but get stripped.  I have not figured out
      where.
      
      * Fix compilation errors
      
      * Fix compilation errors due to incorrect types
      
      * Fix whitespace
      
      Suggested-by: default avatarTomasz Drwiega <[email protected]>
      
      * Add preamble
      
      Suggested-by: default avatarTomasz Drwiega <[email protected]>
      
      * Fix silly compile error
      
      * Refactor pre-digest finding code into a separate function
      
      * Remove unwanted assertion
      
      It is too likely to bring down the entire blockchain.
      
      Suggested-by: default avatarTomasz Drwiega <[email protected]>
      
      * Use `find_pre_digest` after runtime, too
      
      Also, use `Member` trait rather than rolling our own requirements.
      
      Suggested-by: default avatarTomasz Drwiega <[email protected]>
      
      * Fix various warnings
      
      mostly due to upgrading the dependency on `error_chain`.
      
      * Pre-digests nearly complete
      
      This nearly completes the implementation of pre-runtime digests.
      
      * `Seal2` → `Seal` and fix test suite
      
      * Try to fix the storage error
      
      * Try to fix storage (again)
      
      * Fix tests
      
      * Hopefully finish pre-runtime digests
      
      The key is to pass *only* the pre-runtime digests to the runtime.  The
      others must be stripped out by `initialize_block`.
      
      * Fix silly typo
      
      * Fix another silly mistake
      
      * Remove unnecessary filtering of BABE pre-digests
      
      We no longer get duplicate BABE pre-digests, so if they appear, the
      header should be rejected outright.
      
      * Update Cargo.lock files
      
      * Reformatting
      
      * Fix silly typo in inherent digest code
      
      Also, revert `error.rs` files that contained calls to the `error_chain!`
      macro.
      
      * Try to keep the runtime from stripping pre-digests
      
      Currently runs into the “Storage root must match that calculated”
      assertion.
      
      * Don’t compute storage root until storage changes are done.
      
      Also, fix a compilation error.
      
      * Fix compile-time error
      
      * Fix compilation errors
      
      * Fix more compile errors
      
      * Hopefully it compiles this time…
      
      * Fix compilation and add docs
      
      * Prevent BABE from adding duplicate pre-runtime digests
      
      Found by comparing with the AuRa code.  I also did some refactoring.
      
      * Respond to review and fix some warnings
      
      * Delete some dead code introduced earlier
      
      * More dead code goes away
      
      * `ref mut` → `&mut`
      
      * Respond to review and fix some warnings
      
      * Fix compilation error
      
      * Remove unneeded `HashT` type parameter
      
      Suggested-by: default avatarRobert Habermeier <[email protected]>
      
      * Remove spurious #[allow(deprecated)]
      
      * Document inherent digest parameter to `build_block`
      
      * Delete `Simple` trait
      
      It wasn’t needed
      
      * delete wrongly added files
      
      * Fix trait bounds
      
      * Digest serialization tests
      
      I also did some reformatting and cleanup.
      
      * Apply suggestions from code review
      
      Reformatting
      
      Co-Authored-By: default avatarAndré Silva <[email protected]>
      
      * Swap two arguments to `propose` and `propose_with`
      
      Also, remove some needless unsafe code.
      
      * Remove bogus `#![allow(deprecated)]` annotations
      
      With the removal of the deprecated `Seal` variant, these are not needed.
      
      * Add a missing `#[allow(deprecated)]` in the AuRa tests
      
      * Fix silly compile error
      
      * Fix silly compiler error
      
      RLS did not tell me that I hadn’t fixed `babe/lib.rs`, so I missed it.
      
      * Fixes made automatically by Cargo
      6e253c89
  24. Mar 29, 2019
  25. Mar 06, 2019
  26. Feb 05, 2019
  27. Dec 10, 2018
    • asynchronous rob's avatar
      Punish offline validators, aura-style (#1216) · 691e6e8f
      asynchronous rob authored
      * make offline-reporting infrastructure more generic
      
      * add a listener-trait for watching when the timestamp has been set
      
      * prevent inclusion of empty offline reports
      
      * add test for exclusion
      
      * generate aura-offline reports
      
      * ability to slash many times for being offline "multiple" times
      
      * Logic for punishing validators for missing aura steps
      
      * stub tests
      
      * pave way for verification of timestamp vs slot
      
      * alter aura import queue to wait for timestamp
      
      * check timestamp matches seal
      
      * do inherent check properly
      
      * service compiles
      
      * all tests compile
      
      * test srml-aura logic
      
      * aura tests pass
      
      * everything builds
      
      * some more final tweaks to block authorship for aura
      
      * switch to manual delays before step
      
      * restore substrate-consensus-aura to always std and address grumbles
      
      * update some state roots in executor tests
      
      * node-executor tests pass
      
      * get most tests passing
      
      * address grumbles
      691e6e8f