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

kv store with key KVStoreKey{0x14007520260, wasm} has not been registered in stores #12

Open
ducphamle2 opened this issue Oct 6, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ducphamle2
Copy link
Collaborator

ducphamle2 commented Oct 6, 2024

Context

Oraichain has a custom feature allowing EVM contracts to call CosmWasm contracts directly via Solidity.

This requires deploying a set of precompile contracts with logic written in Golang. These methods would have access to different Cosmos keepers to invoke appropriate queries and execute calls.

However, when running tests, the precompile logic couldn't have access to any module stores with the following similar errors across all modules:

kv store with key KVStoreKey{0x14007520260, wasm} has not been registered in stores

To Reproduce

Steps to reproduce the behavior:

  1. Deploy an EVM contract with precompile enabled
  2. Query the deployed contract that invokes CosmWasm queries
  3. View the full node's log to see the error

Expected behavior

There should be no error, and a result should be returned from CosmWasm.

Additional context

@ducphamle2
Copy link
Collaborator Author

The root cause of this bug remains unknown. It seems that using the Cosmos keepers at the end of NewWasmApp directly is causing the problem. The keepers hold the store keys, and they don't match with the ctx.ms

@ducphamle2
Copy link
Collaborator Author

A workaround is to add a new AnteHandler to register the precompiled contracts with Cosmos Keepers. Because AnteHandler can use keepers without error -> the precompiled contracts can also use them.

@ducphamle2
Copy link
Collaborator Author

ducphamle2 commented Oct 6, 2024

Fixed in #13

@ducphamle2 ducphamle2 added this to the Upgrade Oraichain to 0.50 milestone Oct 30, 2024
@ducphamle2 ducphamle2 added the bug Something isn't working label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant