-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
consensus: use the public constant MaxGasLimit to check the header.GasLimit #24092
Conversation
…to avoid creating new variables repeatedly
The way you did it, instead of being three 'magic' values spread out in the codebase, it's instead three constants spread out in the codebase. Not sure if that's (a lot) better, really? |
I thought of that. But there seems to be no place for public constants in the consensus code files. Maybe we can add a new consensus/const.go file to save public constants. |
We usually keep such constants in package |
You're right, I got it. I'll keep the constant |
* consensus: use the maxGasLimit constant to check the header.GasLimit to avoid creating new variables repeatedly * consensus: check the header.GasLimit by the public constant MaxGasLimit * consensus: check the header.GasLimit by the constant MaxGasLimit
Use the constant
maxGasLimit
to check theheader.GasLimit
to avoid creating new variables repeatedly.It has been tested and passed in the development environment.