Skip to content

Feature Request: Expand account compatible #55

@VictorTrustyDev

Description

@VictorTrustyDev

Evermint is fork of Evmos v12.1.6 for research & development purpose

Update Sep 2024: implemented in Evermint by #129


Currently, Evermint is using EthAccount as the default proto account and the only type of account supported.
That causes some limit:

  • Use Cosmos-SDK x/vesting module
  • Limit potential of integrate new features from CosmosSDK
  • Wasting storage to store evmtypes.EmptyCodeHash 32 bytes value that also exists in every non-contract EthAccount (see prove).

Request:

  • Remove EthAccount
  • Make authtypes.BaseAccount as default proto account, compatible with EVM module.
  • All current testcases must be kept to make sure the implementation is fully compatible.
  • x/evm non-genesis account now only support export/import only accounts with either code or storage
  • Optimize store by only store code hash which len(code_hash) > 0 && code_hash <> evmtypes.EmptyCodeHash instead of saving it into every EthAccount record. This change will slightly lower gas fee required to read from store in non-evm Txs

Aware:

  • x/auth keeper RemoveAccount
  • Account bytes compatible: currently Cosmos supports 20 & 32 bytes address (ICA)

Mindset changes:

  • Contract account is now accounts that has CodeHash record (len(code_hash) == 0 || code_hash == evmtypes.EmptyCodeHash will be removed from store)
  • ETH-compatible account is now accounts those are not contract accounts, plus len(address_bytes) == 20. If it is in blockedAddrs by x/bank, will be an error in stateDb.Commit() phrase.
  • When doing account migration, remember to consider migrate code hash, if needed.

Migration aware (if any chain planned to implement this):

  • Must define migration to be able to upgrade Ethermint/Evmos chains.
  • Must test query historical data and data must be matched pre and after upgrade.

Metadata

Metadata

Labels

enhancementEnhancement / bug-fixes or re-work on old featureoptimizeOptimize business or code performance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions