Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Add reseal max period #4903

Merged
merged 3 commits into from
Mar 15, 2017
Merged

Add reseal max period #4903

merged 3 commits into from
Mar 15, 2017

Conversation

keorn
Copy link

@keorn keorn commented Mar 14, 2017

Useful for chains where you do not want block bloat but want to see blocks from time to time to establish liveness.

@keorn keorn added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Mar 14, 2017
@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Mar 15, 2017
@gavofyork gavofyork merged commit 1f7fb15 into master Mar 15, 2017
@gavofyork gavofyork deleted the max-reseal branch March 15, 2017 13:04
@@ -482,6 +489,7 @@ impl Miner {
// Save proposal for later seal submission and broadcast it.
Seal::Proposal(seal) => {
trace!(target: "miner", "Received a Proposal seal.");
*self.next_mandatory_reseal.write() = Instant::now() + self.options.reseal_max_period;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: do "partially-sealed" blocks awaiting PoW submission follow this (Seal::Proposal) code path?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PoW blocks awaiting work are not sealed. So PoW only uses the Seal::Regular code path.
Both PoW blocks and proposal blocks go into the "work" queue to be later released with a final seal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then when mining Ethash chains, the next_mandatory_reseal will only be updated when you're actually successful in producing a solution? It's quite rare that you would do that every 2 minutes, so wouldn't miners end up periodically discarding non-stale candidates because of the max reseal period?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it would start sealing on transactions after 2 min. Either can make this period very large or make it specific for internal sealing, which I think makes more sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just reset the period on prepare_sealing_work?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sealing may sometimes fail when the Engine does not generate a seal, so it would be good to keep trying.

@keorn keorn added the B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. label Mar 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants