-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Mining #547
Conversation
@@ -403,8 +417,79 @@ impl Client { | |||
BlockId::Latest => Some(self.chain.read().unwrap().best_block_number()) | |||
} | |||
} | |||
|
|||
/// Set the author that we will seal blocks as. |
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.
"Get the author" probably
Reduce size of default extra-data. Introduce find_uncle_headers.
} | ||
|
||
/// Get the standard version data for this software. | ||
pub fn version_data() -> Bytes { |
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.
no test
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.
given the output is based on environmental factors outside the control of the test environment, any test would simply be a copy'n'paste of the code in the function.
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.
still I believe we need one so that further possible modifications of this code are introduced with confidence
} | ||
|
||
/// Grab the `ClosedBlock` that we want to be sealed. Comes as a mutex that you have to lock. | ||
pub fn sealing_block(&self) -> &Mutex<Option<ClosedBlock>> { |
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.
no test
though it possibly works in this state, no tests actually prove this |
&Ethash::to_ethash(header.mix_hash())))); | ||
&Ethash::to_ethash(header.bare_hash()), | ||
header.nonce().low_u64(), | ||
&Ethash::to_ethash(header.mix_hash()) ))); |
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.
redundant whitespace
will add tests for the
|
version_data
function to misc to get the standard RLP version data.Client
class; whenever the best block changes, or work is queried and noClosedBlock
exists, a newClosedBlock
is authored as a child of the best block. For 1.0 this somewhat monolithic design is ok; with Civility we will refactor this into a separate crate & process.ClosedBlock
no longer retains anEngine
reference;reopen()
thus doesn't work in its old form - nothing was using it so removing is fine.seal()
used theEngine
reference. This is now supplied as a parameter. This allows us to hold onto aClosedBlock
within theClient
as the "currently sealing" block without having to worry about theEngine
's lifetime.try_seal
function toClosedBlock
to check whether seal is any good (seal
does something similar but doesn't check the seal).verify_block_seal
to Engine.v
ofUnverified
andPreverified
to stay consistent with rest of codebase.U256
<->U512
conversions with pass-by-reference.Still todo:
TransactionQueue
merge).