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

Feat/fakepow delaysealer #180

Merged
merged 7 commits into from
Dec 1, 2020
Merged

Feat/fakepow delaysealer #180

merged 7 commits into from
Dec 1, 2020

Conversation

meowsbits
Copy link
Contributor

Installs a configurable fake delay for the PoW ModeFake sealer.

Sealing time determined by a Poisson distribution and governed by ethash.threads=<mean seconds (lambda)>.

@meowsbits meowsbits requested a review from iquidus September 12, 2020 12:57
@meowsbits meowsbits force-pushed the feat/fakepow-delaysealer branch from 5e060d4 to 9a62f37 Compare September 12, 2020 12:58
@meowsbits
Copy link
Contributor Author

meowsbits commented Sep 12, 2020

TestSealFakeDelay: sealer_test.go:49: ethash.threads,lamda= 3 [1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 5 6]
TestSealFakeDelay: sealer_test.go:49: ethash.threads,lamda=10 [5 6 6 7 8 8 8 9 9 10 10 10 10 11 11 11 12 13 14 16]
TestSealFakeDelay: sealer_test.go:49: ethash.threads,lamda=19 [12 13 13 14 14 14 15 16 17 19 20 20 21 22 23 25 25 25 26 26]
TestSealFakeDelay: sealer_test.go:49: ethash.threads,lamda=33 [19 22 24 26 27 27 28 28 28 31 34 36 36 37 38 39 40 40 40 47]

0177c08

@meowsbits meowsbits mentioned this pull request Sep 13, 2020
@meowsbits
Copy link
Contributor Author

Closing this for now since we have no immediate intention of merging the feature to master.

Rel #188, though, so if pursuing that feature, keep this feature in mind too.

@meowsbits meowsbits closed this Oct 14, 2020
meowsbits and others added 4 commits November 27, 2020 21:52
Without this, the only fake part of --fakepow
is the VERIFICATION of blocks, not the sealing.

This makes the sealer fake with --fakepow as well.

Signed-off-by: meows <[email protected]>
@ziogaschr ziogaschr reopened this Dec 1, 2020
@ziogaschr
Copy link
Member

This PR is going to be used for #243, so we are re-opening it

@ziogaschr ziogaschr force-pushed the feat/fakepow-delaysealer branch from 0177c08 to 40564ff Compare December 1, 2020 16:32
Date: 2020-12-01 12:50:36-06:00
Signed-off-by: meows <[email protected]>

Conflicts:
      go.mod
Date: 2020-12-01 12:52:44-06:00
Signed-off-by: meows <[email protected]>
@@ -1469,6 +1469,10 @@ func setEthashCacheDir(ctx *cli.Context, cfg *eth.Config) {
}

func setEthash(ctx *cli.Context, cfg *eth.Config) {
if ctx.GlobalBool(FakePoWFlag.Name) {
Copy link
Contributor Author

@meowsbits meowsbits Dec 1, 2020

Choose a reason for hiding this comment

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

@ziogaschr What do you think about including this in this PR?

Although it does indeed seem like something worth doing, I'm inclined to think it should be it's own PR. Maybe we can also think about extending through other possible variations, like maybe --fakepow.poisson...

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed I would prefer this removed from this PR. It might fit well into #243.
I will remove it now

Copy link
Member

@ziogaschr ziogaschr Dec 1, 2020

Choose a reason for hiding this comment

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

About the --fakepow.poisson, I was thinking something like --ethash.mode or --ethash.powmode enum string flag with values fake, fullFake, poissonFake.

Also, if we add it as a generic cli command and not under the --dev.* namespace, I would suggest adding something more fancy like --ethash.[pow]modedangerously.


Not sure how the fakepow will be used, outside of the geth [importChain, exportChain, copyDb, dump, inspect] cmds context, but for now it might make sense to only activating under the --dev flag and not on real chains.

@meowsbits meowsbits requested a review from ziogaschr December 1, 2020 19:02
@meowsbits meowsbits merged commit 774bf52 into master Dec 1, 2020
@meowsbits meowsbits deleted the feat/fakepow-delaysealer branch December 1, 2020 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants