Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an Ethash Fake sealing option for —dev mode, using —dev.ethash #243

Merged
merged 11 commits into from
Dec 4, 2020

Conversation

ziogaschr
Copy link
Member

Implement the requested feature at #188.

cmd/utils/flags.go Outdated Show resolved Hide resolved
params/genesis.go Outdated Show resolved Hide resolved
@ziogaschr ziogaschr linked an issue Nov 25, 2020 that may be closed by this pull request
Copy link
Member

@meowsbits meowsbits left a comment

Choose a reason for hiding this comment

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

Requesting changes rel https://github.com/etclabscore/core-geth/pull/243/files#r531618009, where I think this should be 2 change sets. Open to be argued otherwise if opinions differ.

cmd/geth/main.go Outdated Show resolved Hide resolved
config.Clique.Period = period
var config *goethereum.ChainConfig
if useEthash {
config = AllEthashProtocolChanges
Copy link
Member

Choose a reason for hiding this comment

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

Is the AllEthashProtocolChanges config going to be OK to use here? There are some considerations that Clique doesn't have to make for PoW, eg. difficulty (and difficulty bomb), block rewards.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I haven't thought of this. I thought it will work as expected based on initial PoW->Clique change.

Block rewards work fine. I wonder if we should care about difficulty bomb in --dev.pow] mode, or a good use case for it

Copy link
Member

@meowsbits meowsbits Dec 4, 2020

Choose a reason for hiding this comment

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

Dev mode shouldn't ever activate the difficulty bomb, in my opinion. And since core-geth has the ECIP available to permanently disable it, I think it should do so. We'll need to double check the difficulty field in the genesis block, too, to make sure it is at the params.MinimumDifficulty (or whatever it is (that's pseudo-code ;)).

The thought I had in mind with the block rewards was in regards to differences available for ETH vs. ETC. For example, AllEthashProtocolChanges will set the reward to the ETH Istanbul (permanently), while ETC might, say, set it to Era 1 of ECIP1017, and would then need to establish some arbitrary value for the Era Rounds length (ie probably not 500000)... maybe math.MaxUint64.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice one, thanks for analysing that, it really helps me to grasp the whole system.
I will have a look at it. It will be nice if you can give some tips on it @meowsbits , so as I learn and not spending so much time.

Copy link
Member

Choose a reason for hiding this comment

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

Sure, check out f4530b2

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, very informative. EIPs used for block rewards and difficulty bomb noted. Own you a beer

ziogaschr and others added 6 commits December 2, 2020 18:24
This installs an ETC-derived genesis and config
for dev.pow mode.

Block reward disinflation is disabled, so block
rewards will always be at their initial rates.

Difficulty bomb is defused from genesis, so
no need to worry about that, ever, if CPU mining.

Date: 2020-12-04 09:04:57-06:00
Signed-off-by: meows <b5c6@protonmail.com>
Since this flag is only useful for mining (block
emission), we don't need it for copydb, which just
runs the import of chain data.

Fakepow can be used to import more quickly
by cutting corners and not doing ethash field
verification, eg if you really trust the chaindata
that you're copying.

Date: 2020-12-04 09:10:42-06:00
Signed-off-by: meows <b5c6@protonmail.com>
@ziogaschr ziogaschr merged commit 028e166 into master Dec 4, 2020
@ziogaschr ziogaschr deleted the feat/dev-mode-ethash branch December 4, 2020 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: add an ethash sealing option for --dev mode
3 participants