Skip to content

Commit 9fa327b

Browse files
committed
Merge remote-tracking branch 'origin/develop' into bump_v1.12.x
2 parents c2e465e + 03a1f12 commit 9fa327b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3895
-2780
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- uses: actions/checkout@v3
6565
- uses: cachix/install-nix-action@v26
6666
with:
67-
nix_path: nixpkgs=channel:nixos-23.11
67+
nix_path: nixpkgs=channel:nixos-22.11
6868
extra_nix_config: |
6969
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
7070
- uses: cachix/cachix-action@v14
@@ -84,7 +84,7 @@ jobs:
8484
- uses: actions/checkout@v3
8585
- uses: cachix/install-nix-action@v26
8686
with:
87-
nix_path: nixpkgs=channel:nixos-23.11
87+
nix_path: nixpkgs=channel:nixos-22.11
8888
extra_nix_config: |
8989
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
9090
- uses: cachix/cachix-action@v14

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
- uses: actions/checkout@v3
100100
- uses: cachix/install-nix-action@v26
101101
with:
102-
nix_path: nixpkgs=channel:nixos-23.11
102+
nix_path: nixpkgs=channel:nixos-22.11
103103
extra_nix_config: |
104104
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
105105
- uses: cachix/cachix-action@v14
@@ -120,7 +120,7 @@ jobs:
120120
- name: 'Tar debug files'
121121
if: failure()
122122
run: tar cfz debug_files.tar.gz -C /tmp/pytest-of-runner .
123-
- uses: actions/upload-artifact@v3
123+
- uses: actions/upload-artifact@v4
124124
if: failure()
125125
with:
126126
name: debug-files
@@ -138,7 +138,7 @@ jobs:
138138
- uses: actions/checkout@v3
139139
- uses: cachix/install-nix-action@v26
140140
with:
141-
nix_path: nixpkgs=channel:nixos-23.11
141+
nix_path: nixpkgs=channel:nixos-22.11
142142
extra_nix_config: |
143143
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
144144
- uses: cachix/cachix-action@v14

.golangci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ linters:
2121
- misspell
2222
- nakedret
2323
- prealloc
24-
- exportloopref
2524
- staticcheck
2625
- stylecheck
2726
- typecheck
@@ -30,7 +29,6 @@ linters:
3029
- unused
3130
- nolintlint
3231
- asciicheck
33-
- exportloopref
3432
- gofumpt
3533
- gomodguard
3634
- whitespace

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ Ref: https://keepachangelog.com/en/1.0.0/
6969
* (rpc) [#516](https://github.com/crypto-org-chain/ethermint/pull/516) Avoid method eth_chainId crashed due to nil pointer on IsEIP155 check.
7070
* (cli) [#524](https://github.com/crypto-org-chain/ethermint/pull/524) Allow tx evm raw run for generate only when offline with evm-denom flag.
7171
* (rpc) [#527](https://github.com/crypto-org-chain/ethermint/pull/527) Fix balance consistency between trace-block and state machine.
72+
* (rpc) [#534](https://github.com/crypto-org-chain/ethermint/pull/534), [#540](https://github.com/crypto-org-chain/ethermint/pull/540) Fix opBlockhash when no block header in abci request.
73+
* (rpc) [#536](https://github.com/crypto-org-chain/ethermint/pull/536) Fix validate basic after transaction conversion with raw field.
74+
* (cli) [#537](https://github.com/crypto-org-chain/ethermint/pull/537) Fix unsuppored sign mode SIGN_MODE_TEXTUAL for bank transfer.
75+
* (cli) [#543](https://github.com/crypto-org-chain/ethermint/pull/543) Fix graceful shutdown.
76+
* (rpc) [#545](https://github.com/crypto-org-chain/ethermint/pull/545) Fix state overwrite in debug trace APIs.
77+
* (rpc) [#554](https://github.com/crypto-org-chain/ethermint/pull/554) No trace detail on insufficient balance.
78+
* (rpc) [#558](https://github.com/crypto-org-chain/ethermint/pull/558) New tracer in predecessors to trace balance correctly when `debug_traceTransaction`.
79+
* (rpc) [#559](https://github.com/crypto-org-chain/ethermint/pull/559) Use basefee of transaction height instead of minus one height when `debug_traceTransaction`.
80+
* (ante) [#560](https://github.com/crypto-org-chain/ethermint/pull/560) Check gasWanted only in checkTx mode.
81+
* (rpc) [#562](https://github.com/crypto-org-chain/ethermint/pull/562) Fix nil pointer panic with legacy transaction format.
82+
* (evm) [#567](https://github.com/crypto-org-chain/ethermint/pull/567) Fix nonce management in batch transaction.
83+
* (rpc) [#574](https://github.com/crypto-org-chain/ethermint/pull/574) Fix incorrect spendable balance when debug trace tx.
7284

7385
### Improvements
7486

@@ -90,7 +102,16 @@ Ref: https://keepachangelog.com/en/1.0.0/
90102
* (ante) [#504](https://github.com/crypto-org-chain/ethermint/pull/504) Optimize AnteHandle method to skip checks if disabledMsgs is empty.
91103
* [#517](https://github.com/crypto-org-chain/ethermint/pull/517) Add check for integer overflow to ensure safe conversion.
92104
* [#522](https://github.com/crypto-org-chain/ethermint/pull/522) block-stm executor support optional pre-estimations.
93-
* [#526](https://github.com/crypto-org-chain/ethermint/pull/526) Avoid unnecessary block result in header related api call.
105+
* [#526](https://github.com/crypto-org-chain/ethermint/pull/526), [#535](https://github.com/crypto-org-chain/ethermint/pull/535) Avoid unnecessary block result in header related api call.
106+
* [#533](https://github.com/crypto-org-chain/ethermint/pull/533) Bump cosmos-sdk to v0.50.10, cometbft to v0.38.13 and ibc-go to v8.5.1.
107+
* [#546](https://github.com/crypto-org-chain/ethermint/pull/546) Introduce `--async-check-tx` flag to run check-tx async with consensus.
108+
* [#549](https://github.com/crypto-org-chain/ethermint/pull/549) Support build without cgo.
109+
* [#551](https://github.com/crypto-org-chain/ethermint/pull/551) Start event stream on demand.
110+
* [#555](https://github.com/crypto-org-chain/ethermint/pull/555) Update cometbft to 0.38.14 and rocksdb to 9.7.4.
111+
* [#565](https://github.com/crypto-org-chain/ethermint/pull/565) Add back CacheWrapWithTrace api.
112+
* [#563](https://github.com/crypto-org-chain/ethermint/pull/563) Bump ibc-go to v9.0.2.
113+
* [#576](https://github.com/crypto-org-chain/ethermint/pull/576) Add config `json-rpc.restrict-user-input` to restrict
114+
user input when serving json-rpc in public.
94115

95116
## v0.21.x-cronos
96117

app/ante/eip712.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ import (
2929
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
3030
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
3131
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
32-
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
32+
ibcante "github.com/cosmos/ibc-go/v9/modules/core/ante"
3333

3434
ethcrypto "github.com/ethereum/go-ethereum/crypto"
35-
"github.com/ethereum/go-ethereum/crypto/secp256k1"
3635
"github.com/ethereum/go-ethereum/signer/core/apitypes"
3736
"github.com/evmos/ethermint/crypto/ethsecp256k1"
3837
"github.com/evmos/ethermint/ethereum/eip712"
@@ -301,7 +300,7 @@ func VerifySignature(
301300
feePayerSig[ethcrypto.RecoveryIDOffset] -= 27
302301
}
303302

304-
feePayerPubkey, err := secp256k1.RecoverPubkey(sigHash, feePayerSig)
303+
feePayerPubkey, err := ethcrypto.Ecrecover(sigHash, feePayerSig)
305304
if err != nil {
306305
return errorsmod.Wrap(err, "failed to recover delegated fee payer from sig")
307306
}
@@ -327,7 +326,7 @@ func VerifySignature(
327326

328327
// VerifySignature of ethsecp256k1 accepts 64 byte signature [R||S]
329328
// WARNING! Under NO CIRCUMSTANCES try to use pubKey.VerifySignature there
330-
if !secp256k1.VerifySignature(pubKey.Bytes(), sigHash, feePayerSig[:len(feePayerSig)-1]) {
329+
if !ethcrypto.VerifySignature(pubKey.Bytes(), sigHash, feePayerSig[:len(feePayerSig)-1]) {
331330
return errorsmod.Wrap(errortypes.ErrorInvalidSigner, "unable to verify signer signature of EIP712 typed data")
332331
}
333332

app/ante/eth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func CheckEthGasConsume(
147147

148148
// We can't trust the tx gas limit, because we'll refund the unused gas.
149149
gasLimit := msgEthTx.GetGas()
150-
if maxGasWanted != 0 {
150+
if ctx.IsCheckTx() && maxGasWanted != 0 {
151151
gasLimit = min(gasLimit, maxGasWanted)
152152
}
153153
if gasWanted > math.MaxInt64-gasLimit {

app/ante/handler_options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import (
2626
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
2727
ethtypes "github.com/ethereum/go-ethereum/core/types"
2828

29-
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
30-
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
29+
ibcante "github.com/cosmos/ibc-go/v9/modules/core/ante"
30+
ibckeeper "github.com/cosmos/ibc-go/v9/modules/core/keeper"
3131

3232
evmtypes "github.com/evmos/ethermint/x/evm/types"
3333
)

app/app.go

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"net/http"
2424
"os"
2525
"path/filepath"
26+
"slices"
2627
"sort"
2728

2829
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
@@ -31,6 +32,7 @@ import (
3132
"cosmossdk.io/core/appmodule"
3233
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
3334
"github.com/cosmos/cosmos-sdk/server"
35+
sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
3436
"github.com/cosmos/gogoproto/proto"
3537

3638
"github.com/gorilla/mux"
@@ -75,6 +77,7 @@ import (
7577
"github.com/cosmos/cosmos-sdk/x/auth/posthandler"
7678
authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
7779
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
80+
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
7881
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
7982
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
8083
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
@@ -116,16 +119,16 @@ import (
116119
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
117120
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
118121

119-
"github.com/cosmos/ibc-go/v8/modules/apps/transfer"
120-
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
121-
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
122-
ibc "github.com/cosmos/ibc-go/v8/modules/core"
123-
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck
124-
ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
125-
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
126-
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
127-
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
128-
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
122+
"github.com/cosmos/ibc-go/v9/modules/apps/transfer"
123+
ibctransferkeeper "github.com/cosmos/ibc-go/v9/modules/apps/transfer/keeper"
124+
ibctransfertypes "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types"
125+
ibc "github.com/cosmos/ibc-go/v9/modules/core"
126+
ibcclienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"
127+
ibcconnectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types"
128+
porttypes "github.com/cosmos/ibc-go/v9/modules/core/05-port/types"
129+
ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported"
130+
ibckeeper "github.com/cosmos/ibc-go/v9/modules/core/keeper"
131+
ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint"
129132

130133
"github.com/evmos/ethermint/client/docs"
131134

@@ -380,6 +383,21 @@ func NewEthermintApp(
380383
authAddr,
381384
logger,
382385
)
386+
// optional: enable sign mode textual by overwriting the default tx config (after setting the bank keeper)
387+
enabledSignModes := slices.Clone(authtx.DefaultSignModes)
388+
enabledSignModes = append(enabledSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL)
389+
txConfigOpts := authtx.ConfigOptions{
390+
EnabledSignModes: enabledSignModes,
391+
TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper),
392+
}
393+
txConfig, err := authtx.NewTxConfigWithOptions(
394+
appCodec,
395+
txConfigOpts,
396+
)
397+
if err != nil {
398+
panic(err)
399+
}
400+
app.txConfig = txConfig
383401
app.StakingKeeper = stakingkeeper.NewKeeper(
384402
appCodec,
385403
runtime.NewKVStoreService(keys[stakingtypes.StoreKey]),
@@ -466,7 +484,6 @@ func NewEthermintApp(
466484
app.IBCKeeper = ibckeeper.NewKeeper(
467485
appCodec, keys[ibcexported.StoreKey],
468486
app.GetSubspace(ibcexported.ModuleName),
469-
app.StakingKeeper,
470487
app.UpgradeKeeper,
471488
scopedIBCKeeper,
472489
authAddr,

app/executor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ func (ms msWrapper) CacheWrap() storetypes.CacheWrap {
152152
return ms.CacheMultiStore().(storetypes.CacheWrap)
153153
}
154154

155+
func (ms msWrapper) CacheWrapWithTrace(_ io.Writer, _ storetypes.TraceContext) storetypes.CacheWrap {
156+
return ms.CacheWrap()
157+
}
158+
155159
// GetStoreType returns the type of the store.
156160
func (ms msWrapper) GetStoreType() storetypes.StoreType {
157161
return storetypes.StoreTypeMulti

app/simulation_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import (
3737
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
3838
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
3939
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
40-
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
41-
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
40+
ibctransfertypes "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types"
41+
ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported"
4242
"github.com/evmos/ethermint/app"
4343
"github.com/evmos/ethermint/app/ante"
4444
"github.com/evmos/ethermint/testutil"

0 commit comments

Comments
 (0)