yjh
d5e460b3bf
refactor(sc-executor): use wasm executor builder instead of old apis ( #13740 )
...
* 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
2023-04-09 23:48:40 +00:00
Vivek Pandya
bc53b9a03a
Remove years from copyright notes. ( #13415 )
...
* 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
2023-02-21 18:46:41 +00:00
Michal Kucharczyk
548955a73f
BlockId removal: refactor: HeaderBackend::header (#12874 )
...
* BlockId removal: refactor: HeaderBackend::header
It changes the arguments of:
- `HeaderBackend::header`,
- `Client::header`,
- `PeersClient::header`
- `ChainApi::block_header`
methods from: `BlockId<Block>` to: `Block::Hash`
This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292 )
* non-trivial usages of haeder(block_id) refactored
This may required introduction of dedicated function:
header_for_block_num
* fmt
* fix
* doc fixed
* ".git/.scripts/fmt.sh"
* BlockId removal: refactor: HeaderBackend::expect_header
It changes the arguments of `HeaderBackend::expect_header` method from: `BlockId<Block>` to: `Block::Hash`
* ".git/.scripts/fmt.sh"
* readme updated
* ".git/.scripts/fmt.sh"
* fix
Co-authored-by: parity-processbot <>
2022-12-20 09:43:31 +00:00
Michal Kucharczyk
1ed70004e7
BlockId removal: &Hash to Hash ( #12626 )
...
It changes &Block::Hash argument to Block::Hash.
This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292 )
2022-11-07 21:42:16 +00:00
Michal Kucharczyk
76bcbd09a5
BlockId removal: refactor: Backend::body ( #12587 )
...
It changes the arguments of `Backend::body` method from: `BlockId<Block>` to: `&Block::Hash`
This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292 )
Co-authored-by: parity-processbot <>
2022-11-01 16:24:09 +00:00
Sebastian Kunert
f687db40f7
Bump clap to 4.0.x and adjust to best practices ( #12381 )
...
* Bump clap to 3.2.22
* Replace `from_os_str` with `value_parser`
* Replace `from_str` and `try_from_str` with `value_parser`
* Move possible_values to the new format
* Remove unwanted print
* Add missing match branch
* Update clap to 4.0.9 and make it compile
* Replace deprecated `clap` macro with `command` and `value`
* Move remaining `clap` attributes to `arg`
* Remove no-op value_parsers
* Adjust value_parser for state_version
* Remove "deprecated" feature flag and bump to 4.0.11
* Improve range
Co-authored-by: Bastian Köcher <git@kchr.de >
* Apply suggestions
* Trigger CI
* Fix unused error warning
* Fix doc errors
* Fix ArgGroup naming conflict
* Change default_value to default_value_t
* Use 1.. instead of 0..
Co-authored-by: Bastian Köcher <git@kchr.de >
2022-10-18 06:52:46 +00:00
Andronik
9e423925f6
update kvdb & co ( #12312 )
...
* upgrade kvdb & co
* remove patch
* update Cargo.lock
* upgrade impl-serde
* fix parsing test
* actually fix it
* FFS
2022-10-05 21:07:15 +00:00
Qinxuan Chen
e956c2e1c7
use thiserror instead of derive_more for error handling ( #10696 )
...
* use thiserror instead of derive_more for error handling
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* Update utils/prometheus/src/lib.rs
* Update utils/prometheus/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2022-01-25 19:48:46 +00:00
Qinxuan Chen
e327b734bc
use clap3 instead of structopt ( #10632 )
...
* use clap3 instead of structopt
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* format
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* update ss58-registry and revert some nits
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* Fix clippy and doc
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* update clap to 3.0.7
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* Apply review suggestions
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* remove useless option long name
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* cargo fmt
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
2022-01-24 16:28:46 +00:00
Squirrel
3dd32d5255
Make clippy _a little_ more annoying ( #10570 )
...
* Clippy: +complexity
* Update client/cli/src/arg_enums.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update bin/node/inspect/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update primitives/keystore/src/testing.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/elections/src/lib.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* Update primitives/npos-elections/fuzzer/src/reduce.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* Incorporating feedback
* No need for Ok
* Additional
* Needed slice
* Wigy's suggestions on less derefs
* fix count
* reverting changes brought in by option_map_unit_fn
* add --all-targets
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
2022-01-05 14:35:30 +00:00
Bastian Köcher
f3662b4bba
Happy new year 2022 ( #10573 )
2022-01-03 09:22:14 +01:00
Éloïs
3acd335a8d
Make wasm runtime cache size configurable ( #10177 )
...
* Make wasm runtime cache size configurable
* apply review comments
* remove VersionedRuntimeValue
* fix compilation
* VersionedRuntime: replace clone by Arc
* fmt
* fix warnings
* fix tests compilation
* fmt
2021-12-09 16:10:16 +01:00
Ashley
bad4544507
Make choosing an executor (native/wasm) an explicit part of service construction ( #9525 )
...
* Split native executor stuff from wasm executor stuff
* Remove `native_runtime_version` in places
* Fix warning
* Fix test warning
* Remove redundant NativeRuntimeInfo trait
* Add a warning for use_native
* Run cargo fmt
* Revert "Add a warning for use_native"
This reverts commit 9494f765a06037e991dd60524f2ed1b14649bfd6.
* Make choosing an executor (native/wasm) an explicit part of service construction
* Add Cargo.lock
* Rename Executor to ExecutorDispatch
* Update bin/node/executor/src/lib.rs
Co-authored-by: Squirrel <gilescope@gmail.com >
* Fix tests
* Fix minor node-executor error
* Fix node cli command thing
Co-authored-by: Squirrel <gilescope@gmail.com >
2021-08-18 14:26:41 +02:00
Bastian Köcher
7b56ab15b4
Run cargo fmt on the whole code base ( #9394 )
...
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com >
2021-07-21 14:32:32 +00:00
Dan Shields
d89a01cd96
revert changes: InspectKeyCmd back to InspectCmd where appropriate ( #8787 )
2021-05-12 07:47:10 +02:00
Dan Shields
3cd9cfd57a
Change to use the same subcommand syntax as subkey ( #8678 )
...
* Change to use the same subcommand syntax as subkey
* Update client/cli/src/commands/inspect_key.rs
* revert to InspectKeyCmd struct
2021-05-04 11:50:31 +02:00
Cecile Tonglet
8031b6eacb
Rework telemetry to replace the use of tracing with an object we pass around ( #8143 )
...
polkadot companion: paritytech/polkadot#2535
2021-03-11 11:05:45 +01:00
Tomasz Drwięga
3309c4366b
Display nicer inspect results. ( #8198 )
2021-02-24 20:00:00 +01:00
Bastian Köcher
e3e651f72c
Happy new year ( #7814 )
...
* Happy new year
Updates the copyright years and fixes wrong license headers.
* Fix the template
* Split HEADER into HEADER-APACHE & HEADER-GPL
2021-01-04 09:03:13 +00:00
Cecile Tonglet
e3fc4f7fba
Add a feature to create automatically a random temporary directory for base path & remove Clone ( #6221 )
...
* Initial commit
Forked at: 4adac40c07
Parent branch: origin/master
* Add a feature to create automatically a temporary directory for base path
* doc fix and todos
* use parking_lot instead
* use refcell instead since we stay in the main thread
* remove Clone derives
* add test
* solving dependency issue
* clarifying doc
* conflict argument with base-path
* WIP
Forked at: 4adac40c07
Parent branch: origin/master
* revert dep deletion
* fixing test and making base_path optional
* hold basepath while the service is running
* fixes
* Update client/cli/src/params/shared_params.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/service/Cargo.toml
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/mod.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/service/src/config.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* WIP
Forked at: 4adac40c07
Parent branch: origin/master
* improve doc
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-06-10 13:13:25 +02:00
Nikolay Volf
d5411969ac
fix whitespace ( #6062 )
2020-05-18 13:51:28 +02:00
Benjamin Kampmann
be8c96adec
Relax substrate licensing scheme ( #5947 )
2020-05-15 13:21:56 +02:00
Cecile Tonglet
3da069e359
CLI: refactoring: remove Options from sc_service::Configuration's fields ( #5271 )
...
* WIP
Forked at: d6aa8e954c
Parent branch: origin/master
* Rename IntoConfiguration to CliConfiguration
* Renamed into_configuration to create_configuration
* WIP
Forked at: d6aa8e954c
Parent branch: origin/master
* WIP
Forked at: d6aa8e954c
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: d6aa8e954c
Parent branch: origin/master
* WIP
Forked at: d6aa8e954c
Parent branch: origin/master
* WIP
Forked at: d6aa8e954c
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: d6aa8e954c
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 9c516dd38b40fbc420b02c1f8e61d5b2b1a4e434.
* 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: Seun Lanlege <seunlanlege@gmail.com >
* 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: d6aa8e954c
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: d6aa8e954c
Parent branch: origin/master
* WIP
Forked at: d6aa8e954c
Parent branch: origin/master
* WIP
Forked at: d6aa8e954c
Parent branch: origin/master
* Started removing substrate_cli
* WIP
Forked at: d6aa8e954c
Parent branch: origin/master
* WIP
Forked at: d6aa8e954c
Parent branch: origin/master
* WIP
Forked at: d6aa8e954c
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: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/runcmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/export_blocks_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/check_block_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update bin/node/cli/src/command.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update bin/node/cli/src/command.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/export_blocks_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Revert "Update client/cli/src/commands/export_blocks_cmd.rs"
This reverts commit 5906776953392c02beac6bc0bf50f8cbe1a12a01.
* Revert "Update client/cli/src/commands/check_block_cmd.rs"
This reverts commit f705f42b7f3d732be001141afee210fe46a1ef47.
* Revert "Update client/cli/src/commands/export_blocks_cmd.rs"
This reverts commit 8d57c0550164449e6eb2d3bacb04c750c714fcea.
* Revert "Update client/cli/src/commands/runcmd.rs"
This reverts commit 93e74cf5d2e1c0dc49cdff8608d59fc40fc59338.
* Revert "Update client/cli/src/commands/runcmd.rs"
This reverts commit 11d527ba345c0d79f0d3b5b071933d95474d0614.
* Update client/cli/src/commands/export_blocks_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/import_blocks_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/purge_chain_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* 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: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/params/pruning_params.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Remove comment as suggested
* Apply suggestion
* Update client/cli/src/commands/purge_chain_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/purge_chain_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/commands/purge_chain_cmd.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update utils/frame/benchmarking-cli/src/command.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/runner.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/runner.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/runner.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/params/pruning_params.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/params/node_key_params.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/params/network_params.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/lib.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/cli/src/config.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Added doc
* Fixed error introduced after applying suggestion
* Revert "Update client/cli/src/params/pruning_params.rs"
This reverts commit 0574d06a4f1efd86e94c1214420a12e7a4be0099.
* Print error
* Apply suggestions from code review
* Remove useless Results
* Fixed CI failing on polkadot approval
Co-authored-by: Seun Lanlege <seunlanlege@gmail.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-04-07 11:38:07 +02:00
Pierre Krieger
8c03a4fcef
Split the Roles in three types ( #5520 )
...
* Split the Roles bitfield in three
* Forgot to include some changes
* Fix cli test
* More test fixes
* Oh God, merging master broke other tests
* Didn't run the doctests
* Address review
* I'm trying to fix the build blindly because it's taking a good hour to compile on my machine
* Address some review
* Also update the peerset's API to make sense
* Fix peerset tests
* Fix browser node
* client: distinguish between local and network authority
Co-authored-by: André Silva <andre.beat@gmail.com >
2020-04-03 19:08:14 +02:00
Seun Lanlege
9898fc7e81
removes use of sc_client::Client from sc_network ( #5147 )
...
* removes use of sc_client::Client from sc_network
* rename BlockProvider to BlockBackend
* fix broken test
2020-03-12 14:02:04 +01:00
Arkadiy Paronyan
dc0bf210fb
ChainSpec trait ( #5185 )
...
* ChainSpec trait
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Added docs
* Fixed build
* Fixed build
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-03-12 00:00:10 +01:00
Cecile Tonglet
e8000e7429
Add tests & Service's Configuration has optional fields that shouldn't be optional ( #4842 )
...
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.
2020-02-21 13:53:01 +01:00
Tomasz Drwięga
a14d28150d
Inspection extension to node CLI ( #4697 )
...
* Initial inspect.
* WiP
* Add parsing tests.
* Finalize CLI.
* Update to latest substrate.
* Remove unused imports.
* Support ImportParams as well, to get the right pruning setting.
* Mention in docs that hash is no 0x.
* Move bytes above extrinsics.
* Switch to fill helper from sc_cli.
* Remove overwrite.
* Fix error.
* Fix error message.
* Remove extra allow.
* init_config
2020-02-18 17:56:52 +01:00