sedaprotocol / seda-chain

SEDA chain network
GNU General Public License v3.0
17 stars 9 forks source link

🐛 Could not load params from store #276

Closed DeshErBojhaa closed 2 months ago

DeshErBojhaa commented 4 months ago

🐛 Bug Report

params, err := m.Params.Get(ctx) this line returns error.

Steps to Reproduce

  1. Checkout tamjid/gas-to-store-drwasm
  2. Build and run the chain.
  3. Exec the following command: ./build/sedad tx wasm-storage store-data-request-wasm ./x/wasm-storage/keeper/test_utils/cowsay.wasm --wasm-type data-request --trace --from acc1 --keyring-backend test --gas auto --gas-adjustment 20000000000
  4. This command should return the following error: Error: rpc error: code = Unknown desc = rpc error: code = Unknown desc = failed to execute message; message index: 0: collections: not found: key 'no_key' of type github.com/cosmos/gogoproto/sedachain.wasm_storage.v1.Params [cosmos/cosmos-sdk@v0.50.6/baseapp/baseapp.go:1012] with gas used: '2887337': unknown request
hacheigriega commented 4 months ago

I cannot replicate the issue. This command worked for me:

./build/sedad tx wasm-storage store-data-request-wasm ./x/wasm-storage/keeper/test_utils/cowsay.wasm --wasm-type data-request --trace --from acc1 --keyring-backend test --gas auto --gas-adjustment 1.5 --gas-prices 10000000000aseda -y
hacheigriega commented 4 months ago

This error seems to occur when the stores are not initialized during InitGenesis. Even if a genesis state is empty, its collection should be initialized with an empty value. I think we are handling wasm-storage's Params correctly, but please correct me if you think I'm mistaken. I added a fix for ProxyContractRegistry in #272.

hacheigriega commented 2 months ago

I believe this was just an issue with incorrectly initializing the stores in InitGenesis(). Should be fixed now.