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

UnmarshalJSON error on JSON-RPC #1190

Closed
danburck opened this issue Jul 18, 2022 · 0 comments · Fixed by #1188
Closed

UnmarshalJSON error on JSON-RPC #1190

danburck opened this issue Jul 18, 2022 · 0 comments · Fixed by #1188

Comments

@danburck
Copy link
Contributor

Current Situation

Some JSON-RPC endpoints are responding with the following error:

Jun 16 15:34:28 evmos-clust-ar-pub-testnet evmosd[11828]: 3:34PM INF Served eth_call conn=10.128.0.218:59310 duration=3367.218939 err="rpc error: code =Unknown desc = UnmarshalJSON cannot decode empty bytes: panic" module=geth reqid=4

Possible Solution

We need to change all the GetParams functions to use the method defined below to prevent unnecessary panics.
@fedekunze implemented a fix on the SDK with tests that can be used once the new point release is updated: cosmos/cosmos-sdk#12615

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
	for _, pair := range params.ParamSetPairs() {
		k.paramSpace.GetIfExists(ctx, pair.Key, pair.Value)
	}

	return params
}
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 a pull request may close this issue.

1 participant