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

core: fix when db empty on startup overrides for TTD and gray glacier do not work #25146

Closed

Conversation

leolara
Copy link

@leolara leolara commented Jun 22, 2022

Fixes #25133

My first go-ethereum contribution, but I done some on prysm: https://github.com/prysmaticlabs/prysm/pulls?q=+is%3Apr+author%3Aleolara+

Please, let me know how to improve this PR.

@@ -250,6 +250,7 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override
if err != nil {
return genesis.Config, common.Hash{}, err
}
performConfigOverride(genesis.Config, overrideGrayGlacier, overrideTerminalTotalDifficulty)
Copy link
Author

Choose a reason for hiding this comment

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

perhaps we should clone genesis.Config before overriding it?

Choose a reason for hiding this comment

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

0x62044d2cab405388891ee6d53747817f34c0f00341cde548c0ce9834e9718f27

@@ -322,6 +313,15 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override
return newcfg, stored, nil
}

func performConfigOverride(cfg *params.ChainConfig, overrideGrayGlacier *big.Int, overrideTerminalTotalDifficulty *big.Int) {
Copy link
Author

Choose a reason for hiding this comment

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

perhaps there is a better place for this function? should I make it a unexported method of Genesis? Does it need documentation, other private methods don't have?

Choose a reason for hiding this comment

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

0x62044d2cab405388891ee6d53747817f34c0f00341cde548c0ce9834e9718f27

@karalabe
Copy link
Member

Thanks, but there's already a PR open to tackle this #25136

@karalabe karalabe closed this Jun 22, 2022
@leolara
Copy link
Author

leolara commented Jun 22, 2022

@karalabe ok, no worries.

Is there a specific discord channel to discuss geth contributions, so I can talk about what I am doing before doing it?

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.

Override TTD sometimes doesn't work
3 participants