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/vm, params: ensure order of forks, prevent overflow #29023

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Feb 19, 2024

This PR fixes an overflow which can could happen if inconsistent blockchain rules were configured. Additionally, it tries to prevent such inconsistencies from occurring by making sure that merge cannot be enabled unless previous fork(s) are also enabled.

Without this PR, it is possible to set the overrides on an eth_call over RPC and trigger a method-handler crash (not a full node crash).

Hat-tip to @pleasew8t for reporting this via the bounty via a very well-written submission.

@holiman holiman added this to the 1.13.13 milestone Feb 19, 2024
Copy link
Contributor

@s1na s1na left a comment

Choose a reason for hiding this comment

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

LGTM

params/config.go Outdated
@@ -910,6 +910,11 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules
if chainID == nil {
chainID = new(big.Int)
}
if c.IsShanghai(num, timestamp) {
Copy link
Member

Choose a reason for hiding this comment

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

I think it's pretty weird. It can happen that:

London, Merge, Shanghai forks are all configured, but merge is not activated (ttd is not reached). In this case even the London is activated and pre-configured shanghai timestamp is reached, Shanghai shouldn't be enabled.

params/config.go Outdated Show resolved Hide resolved
@holiman holiman merged commit ac0ff04 into ethereum:master Feb 19, 2024
3 checks passed
Tristan-Wilson pushed a commit to OffchainLabs/go-ethereum that referenced this pull request Apr 3, 2024
This PR fixes an overflow which can could happen if inconsistent blockchain rules were configured. Additionally, it tries to prevent such inconsistencies from occurring by making sure that merge cannot be enabled unless previous fork(s) are also enabled.

(cherry picked from commit ac0ff04) aka ethereum/go-ethereum#29023
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Apr 29, 2024
)

This PR fixes an overflow which can could happen if inconsistent blockchain rules were configured. Additionally, it tries to prevent such inconsistencies from occurring by making sure that merge cannot be enabled unless previous fork(s) are also enabled.
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Apr 29, 2024
core/vm, params: ensure order of forks, prevent overflow (ethereum#29023)
billettc pushed a commit to streamingfast/go-ethereum that referenced this pull request May 13, 2024
Copy link

@Mazzika1 Mazzika1 left a comment

Choose a reason for hiding this comment

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

Ko

jorgemmsilva pushed a commit to iotaledger/go-ethereum that referenced this pull request Jun 17, 2024
)

This PR fixes an overflow which can could happen if inconsistent blockchain rules were configured. Additionally, it tries to prevent such inconsistencies from occurring by making sure that merge cannot be enabled unless previous fork(s) are also enabled.
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.

4 participants