-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Use hyper 0.11 in ethcore-miner and improvements in parity-reactor #8335
Conversation
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.
looks good to me. @0x7CFE can you also look into it?
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.
LGTM
miner/src/work_notify.rs
Outdated
|
||
let mut future: Box<Future<Item=(), Error=()>> = Box::new(future::ok(())); | ||
for url in urls { | ||
let mut req = Request::new(Method::Post, url.clone()); |
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.
Wouldn't it be better to use fetch
instead of raw hyper
?
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.
I'm not sure whether we can use fetch
to send POST request. The fetch
crates looks like to use a background thread and is hard coded to only send GET request? https://github.com/paritytech/parity/blob/master/util/fetch/src/client.rs#L216
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.
this is changed in #6422 which will be merged in a second https://github.com/paritytech/parity/pull/6422/files#diff-3eef53ff37b934cea2e67f6f251a2377R131
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.
Got it. I'll try to get a version based on fetch
once that PR is merged.
rpc/src/v1/tests/eth.rs
Outdated
@@ -35,6 +35,7 @@ use kvdb_memorydb; | |||
use miner::external::ExternalMiner; | |||
use miner::transaction_queue::PrioritizationStrategy; | |||
use parking_lot::Mutex; | |||
use parity_reactor::Remote; |
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.
I'm not sure if parity_reactor
abstraction is something we want/should keep.
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.
I totally agree that some day we should remove the reactor wrapper and just use the new plain Tokio Runtime (which also gets a better ThreadPool executer, and allows us not to pass Handle/Remote everywhere!). However, it looks like currently libraries haven't matured enough to do that. For example, hyper
still doesn't support solely using Tokio Runtime as of now. So I think currently we still need to keep using reactor abstraction and fix stuff based on that, before we can remove it?
Okay I have done a new version using Improvements/fixes done on
Regarding
|
This aligns
ethcore-miner
'shyper
dependency with the rest of the crates. However, we still havesecret-store
depending onhyper
0.10 and I'm planning to fix that in a separate PR.parity-reactor
'sRemote::spawn_fn
now exposes the rawRemote
's handle. This allows the EventLoop to be used in many tokio contexts.parity-miner
is updated to use async hyper request. This, probably until we get tokio runtime, would need to pass the Remote handle around.