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

Commit

Permalink
Merge branch 'main' into fix-tx-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
fedekunze authored Jul 19, 2022
2 parents b056db9 + 73c9ea2 commit 479a812
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 21 deletions.
8 changes: 8 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ pull_request_rules:
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### 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
Expand Down
7 changes: 5 additions & 2 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ const (
// Ethereum or SDK transaction to an internal ante handler for performing
// transaction-level processing (e.g. fee payment, signature verification) before
// being passed onto it's respective handler.
func NewAnteHandler(options HandlerOptions) sdk.AnteHandler {
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if err := options.validate(); err != nil {
return nil, err
}
return func(
ctx sdk.Context, tx sdk.Tx, sim bool,
) (newCtx sdk.Context, err error) {
Expand Down Expand Up @@ -62,7 +65,7 @@ func NewAnteHandler(options HandlerOptions) sdk.AnteHandler {
}

return anteHandler(ctx, tx, sim)
}
}, nil
}

func Recover(logger tmlog.Logger, err *error) {
Expand Down
2 changes: 1 addition & 1 deletion app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type HandlerOptions struct {
MaxTxGasWanted uint64
}

func (options HandlerOptions) Validate() error {
func (options HandlerOptions) validate() error {
if options.AccountKeeper == nil {
return sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
Expand Down
9 changes: 4 additions & 5 deletions app/ante/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (suite *AnteTestSuite) SetupTest() {

suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig)

options := ante.HandlerOptions{
anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{
AccountKeeper: suite.app.AccountKeeper,
BankKeeper: suite.app.BankKeeper,
EvmKeeper: suite.app.EvmKeeper,
Expand All @@ -114,11 +114,10 @@ func (suite *AnteTestSuite) SetupTest() {
FeeMarketKeeper: suite.app.FeeMarketKeeper,
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
}

suite.Require().NoError(options.Validate())
})
suite.Require().NoError(err)

suite.anteHandler = ante.NewAnteHandler(options)
suite.anteHandler = anteHandler
suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID())
}

Expand Down
10 changes: 4 additions & 6 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func NewEthermintApp(
// use Ethermint's custom AnteHandler

maxGasWanted := cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted))
options := ante.HandlerOptions{
anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
EvmKeeper: app.EvmKeeper,
Expand All @@ -580,13 +580,11 @@ func NewEthermintApp(
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
MaxTxGasWanted: maxGasWanted,
}

if err := options.Validate(); err != nil {
})
if err != nil {
panic(err)
}

app.SetAnteHandler(ante.NewAnteHandler(options))
app.SetAnteHandler(anteHandler)
app.SetEndBlocker(app.EndBlocker)

if loadLatest {
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 479a812

Please sign in to comment.