Skip to content

chore(all): use upstream protocol params #1563

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

qdm12
Copy link
Collaborator

@qdm12 qdm12 commented Apr 16, 2025

Why this should be merged

Move protocol params code from subnet-evm to libevm since it's the same.

Initially proposed in #1552

How this works

  • Use upstream protocol params (all except MaximumExtraDataSize which is modified in coreth) and delete params/protocol_params.go and params/extras/protcol_params.go.
  • TestUpstreamParamsValues is a change detector test to detect a geth params change in a future upgrade to make sure we take it into account.

How this was tested

Existing CI passing

Need to be documented?

No

Need to update RELEASES.md?

No

@qdm12 qdm12 marked this pull request as ready for review April 16, 2025 15:55
@qdm12 qdm12 requested review from ceyonur and a team as code owners April 16, 2025 15:55
Copy link
Contributor

@alarso16 alarso16 left a comment

Choose a reason for hiding this comment

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

lgtm, adding the config test was a great idea

const (
GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations.
MaxGasLimit uint64 = 0x7fffffffffffffff // Maximum the gas limit (2^63-1).
MaximumExtraDataSize uint64 = 64 // Maximum size extra data may be after Genesis.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is the only params changed from upstream right? Let's keep those changed constants here so we know what's changed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved MaximumExtraDataSize to plugin/evm/header/extra.go as an unexported constant, given it's the only place where it's used. I think it's fine as it is? The other params are the same as upstream

const (
GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations.
MaxGasLimit uint64 = 0x7fffffffffffffff // Maximum the gas limit (2^63-1).
MaximumExtraDataSize uint64 = 64 // Maximum size extra data may be after Genesis.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved MaximumExtraDataSize to plugin/evm/header/extra.go as an unexported constant, given it's the only place where it's used. I think it's fine as it is? The other params are the same as upstream

@qdm12 qdm12 requested a review from ceyonur April 18, 2025 13:19
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.

3 participants