-
Notifications
You must be signed in to change notification settings - Fork 1.7k
RPC method for clearing the engine signer #10920
RPC method for clearing the engine signer #10920
Conversation
It looks like @vkomenda signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
443825f
to
64d6cb5
Compare
Please review. |
2851b0d
to
74fcb11
Compare
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.
Apologies for the late re-review. I think we're real close!
ethcore/src/miner/mod.rs
Outdated
@@ -133,6 +133,9 @@ pub trait MinerService : Send + Sync { | |||
/// On chains where sealing is done externally (e.g. PoW) we provide only reward beneficiary. | |||
fn set_author(&self, author: Author); | |||
|
|||
/// Clears the engine signer and stops signing. | |||
fn clear_author(&self); |
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.
Do you think the same "trick" would work here too? I.e. avoid adding a new trait method and instead change set_author
to take an Option<Author>
instead?
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.
Done.
I made it a T: Into<Option<Author>>
, so that you can pass in just an Author
, and we don't have to update all the call sites.
Also, I added *self.signer.write() = None
to MinerService::set_author
, which seemed like an omission. Or am I misreading this?
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.
(And: Greetings from Solna! 🙂 🇸🇪)
74fcb11
to
58ddaee
Compare
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
@niklasad1 can you take a look at this as well please? |
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, except the removed log in clique::set_signer
Add RPC method parity_clearEngineSigner Fixes #113
58ddaee
to
869c3b3
Compare
Another test failure I can't reproduce locally. |
@afck Yeah, it's a CI issue. Restarted and it succeeded. |
e6715b1
to
2249974
Compare
Original commit messages: RPC method parity_clearEngineSigner Add RPC method parity_clearEngineSigner Fixes #113 corrected the return type of clear_author review comment responses and a rebase fix removed a spurrious warning moved clear_signer functionality to set_signer Merge clear_author into MinerService::set_author. Add trace logs to Clique::set_signer. Clique: Don't lock signer multiple times.
Original commit messages: RPC method parity_clearEngineSigner Add RPC method parity_clearEngineSigner Fixes #113 corrected the return type of clear_author review comment responses and a rebase fix removed a spurrious warning moved clear_signer functionality to set_signer Merge clear_author into MinerService::set_author. Add trace logs to Clique::set_signer. Clique: Don't lock signer multiple times.
This PR adds a new RPC method for clearing the engine signer value.
Original PR: poanetwork#114
See also gnosischain/posdao-test-setup#41 (comment)