-
Notifications
You must be signed in to change notification settings - Fork 141
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
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.
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.
… mode using `—dev.ethash` Implement requested feature at issue #188
missed on last commit
28f9f70
to
682f14a
Compare
params/genesis.go
Outdated
config.Clique.Period = period | ||
var config *goethereum.ChainConfig | ||
if useEthash { | ||
config = AllEthashProtocolChanges |
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.
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.
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.
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
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.
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
.
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.
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.
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.
Sure, check out f4530b2
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.
Thanks, very informative. EIPs used for block rewards and difficulty bomb noted. Own you a beer
…t explicitly set from CLI
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>
Implement the requested feature at #188.