-
Notifications
You must be signed in to change notification settings - Fork 222
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
Ensure gas limit in genesis is consistent #63
Conversation
ref. ava-labs/subnet-evm#63 Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org>
5044ba6
to
a79cddd
Compare
@@ -184,6 +184,11 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig | |||
if genesis.Config == nil { | |||
return nil, errGenesisNoConfig | |||
} | |||
// Make sure genesis gas limit is consistent | |||
gasLimitConfig := genesis.Config.FeeConfig.GasLimit.Uint64() |
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.
We could choose to only do this on a go-forward basis. (i.e. if genesis doesn't exist)
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.
This is obviously not a great solution because old validators can continue fine but new validators won't be able to join.
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.
LGTM
Return an error when the
gasLimit
specified in the genesis header does not match thegasLimit
specified in theFeeConfig
.