-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Remove runtime from secret_store. #9888
Remove runtime from secret_store. #9888
Conversation
It looks like @c0gent signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PR makes sense to me, in general, but couldn't you provide the actual use-case (example) also and some more rationale on why it is important to merge essentially?
BTW, how necessary it is to update the |
@fckt basically this PR changes secret_store to use |
This PR is a follow up to #9657 and simply removes an unnecessary extra runtime. (I had been waiting to submit this until #9807 was resolved.) It's possible that there is a tiny performance benefit but this change primarily falls under the category of simplification. The only changes to usage are that a In terms of potential impact, by consolidating the runtime usage, secret_store tasks now share threads with other tasks spawned within Parity which is, if anything, a slight optimization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't compile
$ cargo check --features secretstore
error[E0412]: cannot find type `Executor` in this scope
--> parity/secretstore.rs:140:69
|
140 | pub fn new(mut conf: Configuration, deps: Dependencies, executor: Executor) -> Result<Self, String> {
| ^^^^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
119 | use futures::executor::Executor;
|
119 | use parity_rpc::informant::Executor;
|
119 | use parity_rpc::ws::tokio::executor::Executor;
|
119 | use parity_rpc::ws::tokio::prelude::future::Executor;
|
and 2 other candidates
error: aborting due to previous error
Please fix by adding
use super::{Configuration, Dependencies, NodeSecretKey, ContractAddress, Executor};
on https://github.com/paritytech/parity-ethereum/blob/master/parity/secretstore.rs#L123
Is this this parameter still actual after this PR? Could you please remove it if not? |
I'll sort out the outstanding issues first thing tomorrow. |
c23edcf
to
7fa64ea
Compare
Updated. All items should be addressed. I went ahead removed one other extra runtime that I was going to leave for a later PR but it's cleaner to do all at once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM. A small grumble.
* Remove the independent runtimes from `KeyServerHttpListener` and `KeyServerCore` and instead require a `parity_runtime::Executor` to be passed upon creation of each. * Remove the `threads` parameter from both `ClusterConfiguration` structs. * Implement the `future::Executor` trait for `parity_runtime::Executor`. * Update tests. - Update the `loop_until` function to instead use a oneshot to signal completion. - Modify the `make_key_servers` function to create and return a runtime.
7fa64ea
to
791f855
Compare
Made a minor documentation tweak. |
Remove the independent runtimes from
KeyServerHttpListener
andKeyServerCore
and instead require aparity_runtime::Executor
to be passed upon creation of each.
Remove the
threads
parameter from bothClusterConfiguration
structs.Implement the
future::Executor
trait forparity_runtime::Executor
.Update tests.
loop_until
function to instead use a oneshot to signalcompletion.
make_key_servers
function to create and return a runtime.