core: gracefully handle missing homestead block config#2790
Closed
karalabe wants to merge 1 commit intoethereum:developfrom
karalabe:allow-nil-homestead
Closed
core: gracefully handle missing homestead block config#2790karalabe wants to merge 1 commit intoethereum:developfrom karalabe:allow-nil-homestead
karalabe wants to merge 1 commit intoethereum:developfrom
karalabe:allow-nil-homestead
Conversation
Updated: Sat Jul 16 10:10:01 UTC 2016 |
2 tasks
Contributor
|
👍 |
| // IsHomestead returns whether num is either equal to the homestead block or greater. | ||
| func (c *ChainConfig) IsHomestead(num *big.Int) bool { | ||
| if num == nil { | ||
| if c.HomesteadBlock == nil || num == nil { |
Contributor
There was a problem hiding this comment.
Or not. It might be easier to just leave the behaviour as is.
Member
Author
|
Superseeded and merged in #2814. |
sduchesneau
pushed a commit
to streamingfast/go-ethereum
that referenced
this pull request
Feb 10, 2025
release: prepare for release v1.5.1-alpha (ethereum#2789)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our nodes didn't handle an interesting corner case until now: having a chain configuration (in the genesis.json), but not having a
homesteadBlockset in it (i.e.{..., "config": {}}). Since our configs until now only featured the homestead block number, either it (block number) was present or the entire config section was missing (resulting the the defaults being used).With the DAO fork being worked on and requiring an additional config section, it becomes entirely possible to have the DAO fork number set, but the homestead number not set. This PR ensures that it the homestead block number is missing, it's assumed not forked.
Note, there's almost no end user use case to set the DAO hard fork in a private network (so skipping the entire config section or only setting the homestead block is still entirely workable), but it is needed to properly test it n automated ways so better to fix it up properly now.