Skip to content

Commit

Permalink
fix(rpc): fix panic on breaking EVM and feemarket params (evmos#1188)
Browse files Browse the repository at this point in the history
* release: v0.17.0 changelog (evmos#1153)

* release: v0.17.0 changelog

* rm newline

* update link

* fix(rpc): fix panic on breaking EVM and feemarket params

* changelog

* fix gosec
  • Loading branch information
fedekunze authored and devon-chain committed Aug 2, 2022
1 parent 69b0aba commit 788818b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
15 changes: 15 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ pull_request_rules:
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}
- name: backport patches to main branch
conditions:
- label=backport/main
actions:
backport:
branches:
- main
- name: backport patches to v0.17.x branch
conditions:
- base=main
- label=backport/0.17.x
actions:
backport:
branches:
- release/v0.17.x
- name: backport patches to v0.16.x branch
conditions:
- base=main
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (deps) [\#1159](https://github.com/evmos/ethermint/pull/1159) Bump Geth version to `v1.10.19`.
* (deps) [#1167](https://github.com/evmos/ethermint/pull/1167) Upgrade ibc-go to v4.
* (evm) [\#1174](https://github.com/evmos/ethermint/pull/1174) Don't allow eth txs with 0 in mempool.

### Improvements

* (feemarket) [\#1165](https://github.com/evmos/ethermint/pull/1165) Add hint in specs about different gas terminology for gas in Cosmos and Ethereum.
* (rpc) [\#1169](https://github.com/evmos/ethermint/pull/1169) Remove unnecessary queries from `getBlockNumber` function

### Bug Fixes

* (rpc) [\#1190](https://github.com/evmos/ethermint/issues/1190) Fix `UnmarshalJSON` panig of breaking EVM and fee market `Params`.
* (rpc) [#1179](https://github.com/evmos/ethermint/pull/1179) Fix gas used in traceTransaction response.

## [v0.17.0] - 2022-06-27

### State Machine Breaking
Expand Down
11 changes: 6 additions & 5 deletions server/json_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ func StartJSONRPC(ctx *server.Context, clientCtx client.Context, tmRPCAddr, tmEn
}

httpSrv := &http.Server{
Addr: config.JSONRPC.Address,
Handler: handlerWithCors.Handler(r),
ReadTimeout: config.JSONRPC.HTTPTimeout,
WriteTimeout: config.JSONRPC.HTTPTimeout,
IdleTimeout: config.JSONRPC.HTTPIdleTimeout,
Addr: config.JSONRPC.Address,
Handler: handlerWithCors.Handler(r),
ReadHeaderTimeout: config.JSONRPC.HTTPTimeout,
ReadTimeout: config.JSONRPC.HTTPTimeout,
WriteTimeout: config.JSONRPC.HTTPTimeout,
IdleTimeout: config.JSONRPC.HTTPIdleTimeout,
}
httpSrvDone := make(chan struct{}, 1)

Expand Down
7 changes: 6 additions & 1 deletion x/evm/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import (

// GetParams returns the total set of evm parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, &params)
// TODO: update once https://github.com/cosmos/cosmos-sdk/pull/12615 is merged
// and released
for _, pair := range params.ParamSetPairs() {
k.paramSpace.GetIfExists(ctx, pair.Key, pair.Value)
}

return params
}

Expand Down
6 changes: 5 additions & 1 deletion x/feemarket/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import (

// GetParams returns the total set of fee market parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, &params)
// TODO: update once https://github.com/cosmos/cosmos-sdk/pull/12615 is merged
// and released
for _, pair := range params.ParamSetPairs() {
k.paramSpace.GetIfExists(ctx, pair.Key, pair.Value)
}
return params
}

Expand Down

0 comments on commit 788818b

Please sign in to comment.