You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Deploy an EVM contract with precompile enabled
Query the deployed contract that invokes CosmWasm queries
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
The precompiled contracts are initialized at the end of the NewWasmApp method
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
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.
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:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There should be no error, and a result should be returned from CosmWasm.
Additional context
NewWasmApp
methodc.ms.GetKVStore(key)
storeService.OpenKVStore(ctx)
. This is the new way of retrieving module stores of Cosmos SDKThe text was updated successfully, but these errors were encountered: