client: Replace `unsafe_rpc_expose` with an `RpcMethods` enum (#5729)
* client: Replace `unsafe_rpc_expose` with an `RpcMethods` enum which can be either Default, Safe or Unsafe. The idea is to have the following: | | --rpc-external=false | --rpc-external=true | |--------------------- |------------------- |----------------- | | --rpc-methods=Default | | unsafe calls denied | | --rpc-methods=Safe | unsafe calls denied | unsafe calls denied | | --rpc-methods=Unsafe | | | Since the previous `unsafe-rpc-expose` option was confusing. * client: Only warn against exposing externally unsafe RPC method set * Apply suggestions from code review Co-Authored-By:Cecile Tonglet <cecile.tonglet@cecton.com> * cli: Rephrase doc comment for rpc_methods config * Improve debuggability of build_spec_works ...by printing to stderr the stderr of the command. This is normally suppressed for succesful tests but not for failing ones - if that's the case then it's useful to see the test failure reason inline rather than having to execute the command separately ourselves. * Rename RpcMethods::{Default => Auto} variant * Update bin/node/cli/tests/build_spec_works.rs Co-authored-by:
Benjamin Kampmann <ben.kampmann@googlemail.com> Co-authored-by:
Cecile Tonglet <cecile.tonglet@cecton.com> Co-authored-by:
Bastian Köcher <bkchr@users.noreply.github.com>
Showing
- substrate/client/cli/src/arg_enums.rs 25 additions, 0 deletionssubstrate/client/cli/src/arg_enums.rs
- substrate/client/cli/src/commands/mod.rs 2 additions, 2 deletionssubstrate/client/cli/src/commands/mod.rs
- substrate/client/cli/src/commands/run_cmd.rs 31 additions, 19 deletionssubstrate/client/cli/src/commands/run_cmd.rs
- substrate/client/cli/src/config.rs 7 additions, 6 deletionssubstrate/client/cli/src/config.rs
- substrate/client/service/src/config.rs 20 additions, 2 deletionssubstrate/client/service/src/config.rs
- substrate/client/service/src/lib.rs 8 additions, 8 deletionssubstrate/client/service/src/lib.rs
- substrate/client/service/test/src/lib.rs 1 addition, 1 deletionsubstrate/client/service/test/src/lib.rs
- substrate/utils/browser/src/lib.rs 1 addition, 1 deletionsubstrate/utils/browser/src/lib.rs
Please register or sign in to comment