-
Notifications
You must be signed in to change notification settings - Fork 205
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
Governable block gas limit #522
Conversation
…imum-client-version
@mrsmkl when this is ready to review would you mind assigning me (or someone else?) |
@@ -249,7 +249,7 @@ func makeHeader(parent *types.Block, config *istanbul.Config) *types.Header { | |||
header := &types.Header{ | |||
ParentHash: parent.Hash(), | |||
Number: parent.Number().Add(parent.Number(), common.Big1), | |||
GasLimit: core.CalcGasLimit(parent, parent.GasLimit(), parent.GasLimit()), | |||
GasLimit: core.CalcGasLimit(parent, nil, parent.GasLimit(), parent.GasLimit()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to store this in the block header at all anymore, since it can be read from the state trie?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well there is still the time before the contracts are deployed, how should that be handled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Should we have a fallback value that we define in protocol_params.go?
@@ -270,7 +270,7 @@ func makeHeader(parent *types.Block, config *istanbul.Config) *types.Header { | |||
header := &types.Header{ | |||
ParentHash: parent.Hash(), | |||
Number: parent.Number().Add(parent.Number(), common.Big1), | |||
GasLimit: core.CalcGasLimit(parent, parent.GasLimit(), parent.GasLimit()), | |||
GasLimit: core.CalcGasLimit(parent, nil), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove this field from the block header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be in another PR, changing the header seems to break many things in the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me!
It looks like there's an end-to-end test failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the monorepo PR in the description the correct corresponding PR? It seems slightly unrelated.
@@ -270,7 +270,7 @@ func makeHeader(parent *types.Block, config *istanbul.Config) *types.Header { | |||
header := &types.Header{ | |||
ParentHash: parent.Hash(), | |||
Number: parent.Number().Add(parent.Number(), common.Big1), | |||
GasLimit: core.CalcGasLimit(parent, parent.GasLimit(), parent.GasLimit()), | |||
GasLimit: core.CalcGasLimit(parent, nil), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me!
Description
Reads the block gas limit from a governable contract.
Tested
I'll add test to the corresponding PR celo-org/celo-monorepo#1253
Other changes
Related issues
Backwards compatibility