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

Is the GasLimit should be a fixed value after London hardfork? #23268

Closed
Nanyan opened this issue Jul 26, 2021 · 4 comments
Closed

Is the GasLimit should be a fixed value after London hardfork? #23268

Nanyan opened this issue Jul 26, 2021 · 4 comments

Comments

@Nanyan
Copy link

Nanyan commented Jul 26, 2021

Hi, there

version: 1.10.6

According to the CalcGasLimit1559 function:

// CalcGasLimit1559 calculates the next block gas limit under 1559 rules.
func CalcGasLimit1559(parentGasLimit, desiredLimit uint64) uint64 {
	delta := parentGasLimit/params.GasLimitBoundDivisor - 1
	limit := parentGasLimit
	if desiredLimit < params.MinGasLimit {
		desiredLimit = params.MinGasLimit
	}
	// If we're outside our allowed gas range, we try to hone towards them
	if limit < desiredLimit {
		limit = parentGasLimit + delta
		if limit > desiredLimit {
			limit = desiredLimit
		}
		return limit
	}
	if limit > desiredLimit {
		limit = parentGasLimit - delta
		if limit < desiredLimit {
			limit = desiredLimit
		}
	}
	return limit
}

The returned limit should be eventually equal to desiredLimit, and then it will no longer change anymore.

So the block's GasLimit will be a fixed value once it hit the config.GasCeil :

header.GasLimit = core.CalcGasLimit1559(parentGasLimit, w.config.GasCeil)

Is that the purpose by design?

@rjl493456442
Copy link
Member

rjl493456442 commented Jul 27, 2021

This GasLimit can be adjusted by the miners via --miner.gaslimit. Miners can vote for bumping or decreasing the gaslimit by demand.

@Nanyan
Copy link
Author

Nanyan commented Jul 27, 2021

So if all miners use a same gasLimit, then it will be no any dynamic adjustment, no matter the network is busy or not.

Does it a really better choice then the old one with a range of [gasFloor, gasCeil] ?

@rjl493456442
Copy link
Member

gasFloor is unnecessary complexity we think. I have a PR to remove the gasFloor flag. #23213

@rjl493456442
Copy link
Member

Close it now. Feel free to reopen if you have any other thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants