Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Problem: import/export genesis roundtrip test fails for contract storage #590

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Sep 24, 2021

Closes: #589

  • don't hash the key again in InitGenesis

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@yihuang yihuang changed the title Problem: import/export roundtrip test fail contract storage Problem: import/export roundtrip test fail with contract storage Sep 24, 2021
@yihuang yihuang changed the title Problem: import/export roundtrip test fail with contract storage Problem: import/export roundtrip test fails for contract storage Sep 24, 2021
@yihuang yihuang changed the title Problem: import/export roundtrip test fails for contract storage Problem: import/export genesis roundtrip test fails for contract storage Sep 24, 2021
@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #590 (6f8dbff) into main (2088297) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #590      +/-   ##
==========================================
+ Coverage   52.51%   52.60%   +0.09%     
==========================================
  Files          64       64              
  Lines        5273     5260      -13     
==========================================
- Hits         2769     2767       -2     
+ Misses       2350     2339      -11     
  Partials      154      154              
Impacted Files Coverage Δ
x/evm/keeper/keeper.go 75.00% <ø> (+0.43%) ⬆️
x/evm/types/key.go 0.00% <ø> (ø)
x/evm/keeper/statedb.go 73.26% <100.00%> (-0.10%) ⬇️

@yihuang
Copy link
Contributor Author

yihuang commented Sep 24, 2021

Alternatively, can we just remove the hash in SetState?

@yihuang yihuang force-pushed the genesis-import branch 2 times, most recently from 4398c4b to 9589b2f Compare September 24, 2021 14:22
@yihuang
Copy link
Contributor Author

yihuang commented Sep 24, 2021

Alternatively, can we just remove the hash in SetState?

I just removed the hash completely in newer commit.

@yihuang
Copy link
Contributor Author

yihuang commented Sep 24, 2021

Verified in cronos's integration test: https://github.com/crypto-org-chain/cronos/pull/104/files#diff-4bc634280ffa32d380c3cca748c078f199cf11056710fa67713f672133ebfc86R34

the key in storage is not hashed now.

Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

Thanks @yihuang. Can you add a state machine breaking item on the changelog?

@yihuang
Copy link
Contributor Author

yihuang commented Sep 24, 2021

Thanks @yihuang. Can you add a state machine breaking item on the changelog?

done

@fedekunze fedekunze enabled auto-merge (squash) September 27, 2021 06:57
auto-merge was automatically disabled September 27, 2021 09:49

Head branch was pushed to by a user without write access

@yihuang
Copy link
Contributor Author

yihuang commented Sep 27, 2021

it seems the gas estimate issue is fixed too.

@fedekunze fedekunze merged commit d6a64a2 into evmos:main Sep 27, 2021
@yihuang yihuang deleted the genesis-import branch September 27, 2021 14:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem: genesis export/import roundtrip test failed with contract storage
2 participants