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

Extend x/evm module params with enabled_precompiles #55

Merged
merged 12 commits into from May 3, 2024

Conversation

evgeniy-scherbina
Copy link

@evgeniy-scherbina evgeniy-scherbina commented Apr 30, 2024

  • Extended x/evm params with enabled_precompiles
  • Added validation of enabled_precompiles in InitGenesis

@evgeniy-scherbina evgeniy-scherbina force-pushed the extend-evm-module branch 2 times, most recently from 0539c29 to b9a0598 Compare April 30, 2024 20:42
@evgeniy-scherbina evgeniy-scherbina marked this pull request as ready for review April 30, 2024 20:55
@evgeniy-scherbina evgeniy-scherbina force-pushed the extend-evm-module branch 2 times, most recently from 556bfe6 to 7905fcf Compare May 1, 2024 17:36
x/evm/keeper/params_test.go Outdated Show resolved Hide resolved
x/evm/types/params_test.go Outdated Show resolved Hide resolved
x/evm/types/params_test.go Outdated Show resolved Hide resolved
Copy link
Member

@pirtleshell pirtleshell left a comment

Choose a reason for hiding this comment

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

just a small nit re: method names

great test coverage!

// IsLondon returns if london hardfork is enabled.
func IsLondon(ethConfig *params.ChainConfig, height int64) bool {
return ethConfig.IsLondon(big.NewInt(height))
}

func CheckIfEnabledPrecompilesAreRegistered(registeredModules []precompile_modules.Module, enabledPrecompiles []string) error {
Copy link
Member

Choose a reason for hiding this comment

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

need comment on public method

also maybe a name like ValidateEnabledPrecompiles or ValidatePrecompileRegistration is more idiomatic (and future proof?)

Copy link
Author

Choose a reason for hiding this comment

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

agree, ValidatePrecompileRegistration sounds better

Copy link
Author

Choose a reason for hiding this comment

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

Fixed: c2e188f

return nil
}

func checkIfSortedInBytesRepr(addrs []common.Address) error {
Copy link
Member

Choose a reason for hiding this comment

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

nit: validate might be more consistent naming here and below than checkIf

Copy link
Author

Choose a reason for hiding this comment

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

agree, validateSortingInBytesRepr and validateUniquenessInBytesRepr sounds better

also validateOrderInBytesRepr sounds good, but I went with validateSortingInBytesRepr

Fixed: 27126aa

@evgeniy-scherbina evgeniy-scherbina merged commit 2ada74f into main May 3, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants