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

Ensure gas limit in genesis is consistent #63

Merged
merged 6 commits into from
Mar 17, 2022

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Mar 16, 2022

Return an error when the gasLimit specified in the genesis header does not match the gasLimit specified in the FeeConfig.

core/genesis.go Outdated Show resolved Hide resolved
gyuho added a commit to ava-labs/avalanche-ops that referenced this pull request Mar 16, 2022
ref. ava-labs/subnet-evm#63

Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org>
@@ -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()
Copy link
Contributor Author

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)

Copy link
Contributor Author

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.

Copy link
Collaborator

@aaronbuchwald aaronbuchwald left a comment

Choose a reason for hiding this comment

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

LGTM

@patrick-ogrady patrick-ogrady merged commit 5708f02 into master Mar 17, 2022
@patrick-ogrady patrick-ogrady deleted the ensure-consistent-gasLimit branch March 17, 2022 01:50
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.

2 participants