From 90c300523c92d4629554e96bf8db6bffb5c2dfc4 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 26 Mar 2024 09:41:06 +0800 Subject: [PATCH] Problem: ethermint is outdated --- CHANGELOG.md | 4 ++++ app/app.go | 3 +-- app/encoding.go | 4 ++-- cmd/cronosd/cmd/root.go | 7 +++---- go.mod | 2 +- go.sum | 4 ++-- gomod2nix.toml | 4 ++-- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d79d171497..60094bf3f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ - [#1362](https://github.com/crypto-org-chain/cronos/pull/1362) Log blacklist addresses. +### Bug Fixes + +- [#1363](https://github.com/crypto-org-chain/cronos/pull/1363) Update ethermint to fix a panic on overflow and patch gasUsed in the RPC API. + *March 19, 2024* ## v1.1.0 diff --git a/app/app.go b/app/app.go index d4a4675452..987c103492 100644 --- a/app/app.go +++ b/app/app.go @@ -15,7 +15,6 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - appparams "cosmossdk.io/simapp/params" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "golang.org/x/exp/slices" @@ -376,7 +375,7 @@ type App struct { // NewSimApp returns a reference to an initialized SimApp. func New( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest, skipGravity bool, skipUpgradeHeights map[int64]bool, - homePath string, invCheckPeriod uint, encodingConfig appparams.EncodingConfig, + homePath string, invCheckPeriod uint, encodingConfig ethermint.EncodingConfig, // this line is used by starport scaffolding # stargate/app/newArgument appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *App { diff --git a/app/encoding.go b/app/encoding.go index e3c439d1b9..121302826e 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -1,11 +1,11 @@ package app import ( - "cosmossdk.io/simapp/params" evmenc "github.com/evmos/ethermint/encoding" + ethermint "github.com/evmos/ethermint/types" ) // MakeEncodingConfig creates the EncodingConfig for cronos chain -func MakeEncodingConfig() params.EncodingConfig { +func MakeEncodingConfig() ethermint.EncodingConfig { return evmenc.MakeConfig(ModuleBasics) } diff --git a/cmd/cronosd/cmd/root.go b/cmd/cronosd/cmd/root.go index 8e53172f17..0e1d63f5a1 100644 --- a/cmd/cronosd/cmd/root.go +++ b/cmd/cronosd/cmd/root.go @@ -5,7 +5,6 @@ import ( "io" "os" - "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/types/module" @@ -56,7 +55,7 @@ const SkipGravity = true // NewRootCmd creates a new root command for simd. It is called once in the // main function. -func NewRootCmd() (*cobra.Command, params.EncodingConfig) { +func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) { // Set config for prefixes app.SetConfig() @@ -110,7 +109,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { return rootCmd, encodingConfig } -func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { +func initRootCmd(rootCmd *cobra.Command, encodingConfig ethermint.EncodingConfig) { cfg := sdk.GetConfig() cfg.Seal() @@ -235,7 +234,7 @@ func initAppConfig() (string, interface{}) { } type appCreator struct { - encCfg params.EncodingConfig + encCfg ethermint.EncodingConfig } // newApp is an AppCreator diff --git a/go.mod b/go.mod index a18558a4cb..6bda2206d4 100644 --- a/go.mod +++ b/go.mod @@ -239,7 +239,7 @@ replace ( // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231207063621-43cf32d91c3e - github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240305041633-5b153a460e7a + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240326012741-6263a240556c // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 diff --git a/go.sum b/go.sum index 2c5b316141..8c4e4323b6 100644 --- a/go.sum +++ b/go.sum @@ -488,8 +488,8 @@ github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63 h1:R1 github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63/go.mod h1:rocwIfnS+kA060x64gkSIRvWB9StSppIkJuo5MWzL24= github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240228013111-9bd1e035ed1d h1:ihUBUAEwQYHZEqf7lXrJithNCUJTjB8q3oSQA6Nevco= github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240228013111-9bd1e035ed1d/go.mod h1:cmAawe8FV/52oPKbgeHLt4UpNkrNu8R5KD+kw0kxJFc= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240305041633-5b153a460e7a h1:on3vlgLb4BdkojU5Umbh6bvXVtGc/s+jFLkGHG4f8Mk= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240305041633-5b153a460e7a/go.mod h1:T3Tkhw8XMu8rYObcXpeTqGUaKogS+DKsGPD3ulHN/mg= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240326012741-6263a240556c h1:3VKwgmkb/CnjHT8v6bwMl70ferUVLcrefEpQc9Q8/F0= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240326012741-6263a240556c/go.mod h1:zJYmx1D+tDggzvXmdJ0/I62TeIykdCMfJBjBxOcniAU= github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231207063621-43cf32d91c3e h1:vnyepPQ/m25+19xcTuBUdRxmltZ/EjVWNqEjhg7Ummk= github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231207063621-43cf32d91c3e/go.mod h1:+a8pUj1tOyJ2RinsNQD4326YS+leSoKGiG/uVVb0x6Y= github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20230825054824-75403cd90c6e h1:rSTc35OBjjCBx47rHPWBCIHNGPbMnEj8f7fNcK2TjVI= diff --git a/gomod2nix.toml b/gomod2nix.toml index 285ce92a3b..c346bc00ae 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -216,8 +216,8 @@ schema = 3 hash = "sha256-lDIqRLUrXYCb9mmFBY/+WW+ee69+IkxOgqjHVyo4ij0=" replaced = "github.com/crypto-org-chain/go-ethereum" [mod."github.com/evmos/ethermint"] - version = "v0.6.1-0.20240305041633-5b153a460e7a" - hash = "sha256-7g+DEeJ3iKzCMircdljYiy6uQNJNwEky7gJ+ZuA6CB4=" + version = "v0.6.1-0.20240326012741-6263a240556c" + hash = "sha256-MgvJ9Z0zl+oZtMmbSAlqaibQvzKqEvM1016uF9GEHXI=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/felixge/httpsnoop"] version = "v1.0.2"