-
Notifications
You must be signed in to change notification settings - Fork 181
Add an Ethash Fake sealing option for —dev mode, using —dev.ethash
#243
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
Changes from 4 commits
ef0844f
d6788bd
bc7ad1b
682f14a
9dbbe8d
325248f
f598364
25969d9
6eb9ce9
f4530b2
190920d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ import ( | |
| "github.com/ethereum/go-ethereum/common/hexutil" | ||
| "github.com/ethereum/go-ethereum/crypto" | ||
| "github.com/ethereum/go-ethereum/params/types/genesisT" | ||
| "github.com/ethereum/go-ethereum/params/types/goethereum" | ||
| ) | ||
|
|
||
| // DefaultGenesisBlock returns the Ethereum main net genesis block. | ||
|
|
@@ -86,14 +87,19 @@ func DefaultYoloV1GenesisBlock() *genesisT.Genesis { | |
|
|
||
| // DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must | ||
| // be seeded with the | ||
| func DeveloperGenesisBlock(period uint64, faucet common.Address) *genesisT.Genesis { | ||
| func DeveloperGenesisBlock(period uint64, faucet common.Address, useEthash bool) *genesisT.Genesis { | ||
| // Override the default period to the user requested one | ||
| config := *AllCliqueProtocolChanges | ||
| config.Clique.Period = period | ||
| var config *goethereum.ChainConfig | ||
| if useEthash { | ||
| config = AllEthashProtocolChanges | ||
|
ziogaschr marked this conversation as resolved.
Outdated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 The thought I had in mind with the block rewards was in regards to differences available for ETH vs. ETC. For example,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, check out f4530b2
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| } else { | ||
| config = AllCliqueProtocolChanges | ||
| config.Clique.Period = period | ||
| } | ||
|
|
||
| // Assemble and return the genesis with the precompiles and faucet pre-funded | ||
| return &genesisT.Genesis{ | ||
| Config: &config, | ||
| Config: config, | ||
| ExtraData: append(append(make([]byte, 32), faucet[:]...), make([]byte, crypto.SignatureLength)...), | ||
| GasLimit: 6283185, | ||
| Difficulty: big.NewInt(1), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.