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

feat(evmutil): add allow list for evm-convertible sdk denoms #1590

Merged
merged 14 commits into from
May 19, 2023

Conversation

pirtleshell
Copy link
Member

@pirtleshell pirtleshell commented May 15, 2023

Description

adds allowed_native_denoms to evmutil params. the param has validation tests and is included in the module's genesis state but is currently unused. the parameter will be used to allow certain sdk denoms to be converted to erc20s in the evm. in addition to the sdk denom, it includes metadata for the erc20 token that will be deployed.

Checklist

  • Changelog has been updated as necessary.

@pirtleshell pirtleshell requested a review from nddeluca May 15, 2023 21:25
@pirtleshell pirtleshell changed the title feat: add evmutil allow list for evm-convertible sdk denoms feat(evmutil): add allow list for evm-convertible sdk denoms May 15, 2023
@pirtleshell pirtleshell marked this pull request as draft May 15, 2023 21:31
updates to the sections describing functionality will be updated once
that functionality actually exists... :)
@pirtleshell pirtleshell marked this pull request as ready for review May 15, 2023 22:18
Copy link
Member

@nddeluca nddeluca left a comment

Choose a reason for hiding this comment

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

Looks good.

Just the small change of decimal -> decimals might be good. It can be confusing when interfaces don't match exactly, but just a nit.

Do think we should add the check for a value less than 256. Though, I actually don't know what the behavior would be. Will the contract deployment fail, or will solidity do an implicit conversion and overflow?

@pirtleshell pirtleshell requested a review from nddeluca May 16, 2023 20:14
Copy link
Member

@nddeluca nddeluca left a comment

Choose a reason for hiding this comment

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

Decimal changes look great. Like the usage of math.MaxUint8 👍

One more uncertainty here:

We are modifying parameters, which is a consensus breaking change.

What's the behavior of upgrading with default (empty) upgrade handler, is the default set appropriately? Does GetParams work after upgrade?
Do historical GetParams work and handle the missing value gracefully (without panic)?

Can we write unit tests to cover those cases above?

Once we have those tests, should we consider bumping the consensus version in this PR and add a migration?

@pirtleshell
Copy link
Member Author

alrighty @nddeluca, without any migrations the behavior is such that the chain will upgrade, but the param indeed never gets set in the store.

upgrading from v0.23.0 to this branch with an empty upgrade handler results in a successful upgrade, but any query to evmutil params (current or historical) fails. presumably if the params were actually used the chain itself may panic as well (or at least no txs/queries using them would work) 😄

i am working on the setup of migrations in evmutil and add in a param with consensus version bump to this pr.

* adds migrator to evmutil's keeper
* sets up Migrate1To2 migration
* registers migration in module
* updates GetParams to properly handle historic block queries
@pirtleshell pirtleshell requested a review from nddeluca May 17, 2023 21:23
@pirtleshell pirtleshell merged commit ff709d7 into master May 19, 2023
@pirtleshell pirtleshell deleted the rp-sdk-coins-to-evm branch May 19, 2023 23:01
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.

4 participants