You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Experiencing problems? Have you tried our Stack Exchange first?
This is not a support question.
Motivation
sc_service::config::Configuration is an extremely annoying right now.
It contains a huge number of stuff in general, many of its related fields are in the flat list (for example there are 7 RPC-related fields, also rpc_addr and rpc_port are separate, while only the first one should be needed).
Moreover, it is abused by many components that instead of having arguments that they actually need, require the whole Configuration to be constructed. One example of this is new_wasm_executor that takes &Configuration as an argument, but only needs 4 fields that could have been a part of a small data structure:
default_heap_pages
wasm_method
max_runtime_instances
runtime_cache_size
Request
Group many of the fields of sc_service::config::Configuration in a logical way (kind of like network is grouped right now) and change most of the usage to only require specific fields instead of the whole Configuration data structure.
Solution
No response
Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered:
This improves `sc-service` API by not requiring the whole
`&Configuration`, using specific configuration options instead.
`RpcConfiguration` was also extracted from `Configuration` to group all
RPC options together.
We don't use Substrate's CLI and would rather not use `Configuration`
either, but some key public functions require it even though they
ignored most of the fields anyway.
`RpcConfiguration` is very helpful not just for consolidation of the
fields, but also to finally make RPC optional for our use case, while
Substrate still runs RPC server on localhost even if listening address
is explicitly set to `None`, which is annoying (and I suspect there is a
reason for it, so didn't want to change the default just yet).
While this is a breaking change, most developers will not notice it if
they use higher-level APIs.
Fixes#2897
---------
Co-authored-by: Niklas Adolfsson <[email protected]>
This improves `sc-service` API by not requiring the whole
`&Configuration`, using specific configuration options instead.
`RpcConfiguration` was also extracted from `Configuration` to group all
RPC options together.
We don't use Substrate's CLI and would rather not use `Configuration`
either, but some key public functions require it even though they
ignored most of the fields anyway.
`RpcConfiguration` is very helpful not just for consolidation of the
fields, but also to finally make RPC optional for our use case, while
Substrate still runs RPC server on localhost even if listening address
is explicitly set to `None`, which is annoying (and I suspect there is a
reason for it, so didn't want to change the default just yet).
While this is a breaking change, most developers will not notice it if
they use higher-level APIs.
Fixes#2897
---------
Co-authored-by: Niklas Adolfsson <[email protected]>
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
sc_service::config::Configuration
is an extremely annoying right now.It contains a huge number of stuff in general, many of its related fields are in the flat list (for example there are 7 RPC-related fields, also
rpc_addr
andrpc_port
are separate, while only the first one should be needed).Moreover, it is abused by many components that instead of having arguments that they actually need, require the whole
Configuration
to be constructed. One example of this isnew_wasm_executor
that takes&Configuration
as an argument, but only needs 4 fields that could have been a part of a small data structure:default_heap_pages
wasm_method
max_runtime_instances
runtime_cache_size
Request
Group many of the fields of
sc_service::config::Configuration
in a logical way (kind of like network is grouped right now) and change most of the usage to only require specific fields instead of the wholeConfiguration
data structure.Solution
No response
Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered: