Skip to content

Commit 56d558c

Browse files
committed
upgrade to go-ethereum 1.12
1 parent 8db76d7 commit 56d558c

Some content is hidden

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

44 files changed

+473
-335
lines changed

app/ante/eth.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"
3232

3333
"github.com/ethereum/go-ethereum/common"
34-
ethtypes "github.com/ethereum/go-ethereum/core/types"
3534
)
3635

3736
// EthAccountVerificationDecorator validates an account balance checks
@@ -258,7 +257,7 @@ func NewCanTransferDecorator(evmKeeper EVMKeeper) CanTransferDecorator {
258257
func (ctd CanTransferDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
259258
params := ctd.evmKeeper.GetParams(ctx)
260259
ethCfg := params.ChainConfig.EthereumConfig(ctd.evmKeeper.ChainID())
261-
signer := ethtypes.MakeSigner(ethCfg, big.NewInt(ctx.BlockHeight()))
260+
signer := ethermint.MakeSigner(ethCfg, big.NewInt(ctx.BlockHeight()))
262261

263262
for _, msg := range tx.GetMsgs() {
264263
msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx)
@@ -283,11 +282,11 @@ func (ctd CanTransferDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
283282
"base fee is supported but evm block context value is nil",
284283
)
285284
}
286-
if coreMsg.GasFeeCap().Cmp(baseFee) < 0 {
285+
if coreMsg.GasFeeCap.Cmp(baseFee) < 0 {
287286
return ctx, errorsmod.Wrapf(
288287
errortypes.ErrInsufficientFee,
289288
"max fee per gas less than block base fee (%s < %s)",
290-
coreMsg.GasFeeCap(), baseFee,
289+
coreMsg.GasFeeCap, baseFee,
291290
)
292291
}
293292
}
@@ -305,12 +304,12 @@ func (ctd CanTransferDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
305304

306305
// check that caller has enough balance to cover asset transfer for **topmost** call
307306
// NOTE: here the gas consumed is from the context with the infinite gas meter
308-
if coreMsg.Value().Sign() > 0 && !evm.Context.CanTransfer(stateDB, coreMsg.From(), coreMsg.Value()) {
307+
if coreMsg.Value.Sign() > 0 && !evm.Context.CanTransfer(stateDB, coreMsg.From, coreMsg.Value) {
309308
return ctx, errorsmod.Wrapf(
310309
errortypes.ErrInsufficientFunds,
311310
"failed to transfer %s from address %s using the EVM block context transfer function",
312-
coreMsg.Value(),
313-
coreMsg.From(),
311+
coreMsg.Value,
312+
coreMsg.From,
314313
)
315314
}
316315
}

app/ante/interfaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type EVMKeeper interface {
4242
statedb.Keeper
4343
DynamicFeeEVMKeeper
4444

45-
NewEVM(ctx sdk.Context, msg core.Message, cfg *statedb.EVMConfig, tracer vm.EVMLogger, stateDB vm.StateDB) *vm.EVM
45+
NewEVM(ctx sdk.Context, msg *core.Message, cfg *statedb.EVMConfig, tracer vm.EVMLogger, stateDB vm.StateDB) *vm.EVM
4646
DeductTxCostsFromUserBalance(ctx sdk.Context, fees sdk.Coins, from common.Address) error
4747
GetBalance(ctx sdk.Context, addr common.Address) *big.Int
4848
ResetTransientGasUsed(ctx sdk.Context)

app/ante/sigverify.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
errorsmod "cosmossdk.io/errors"
2222
sdk "github.com/cosmos/cosmos-sdk/types"
2323
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
24-
ethtypes "github.com/ethereum/go-ethereum/core/types"
24+
"github.com/zeta-chain/ethermint/types"
2525
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"
2626
)
2727

@@ -48,7 +48,7 @@ func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, s
4848
chainCfg := evmParams.GetChainConfig()
4949
ethCfg := chainCfg.EthereumConfig(chainID)
5050
blockNum := big.NewInt(ctx.BlockHeight())
51-
signer := ethtypes.MakeSigner(ethCfg, blockNum)
51+
signer := types.MakeSigner(ethCfg, blockNum)
5252

5353
for _, msg := range tx.GetMsgs() {
5454
msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx)

go.mod

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/cosmos/gogoproto v1.7.0
1919
github.com/cosmos/ibc-go/v7 v7.2.0
2020
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
21-
github.com/ethereum/go-ethereum v1.10.26
21+
github.com/ethereum/go-ethereum v1.12.2
2222
github.com/golang/protobuf v1.5.4
2323
github.com/gorilla/mux v1.8.0
2424
github.com/gorilla/websocket v1.5.0
@@ -32,7 +32,7 @@ require (
3232
github.com/spf13/cast v1.6.0
3333
github.com/spf13/cobra v1.8.0
3434
github.com/spf13/viper v1.18.2
35-
github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969
35+
github.com/status-im/keycard-go v0.2.0
3636
github.com/stretchr/testify v1.9.0
3737
github.com/tidwall/btree v1.6.0
3838
github.com/tidwall/gjson v1.14.4
@@ -55,15 +55,18 @@ require (
5555
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
5656
cosmossdk.io/log v1.4.1 // indirect
5757
filippo.io/edwards25519 v1.0.0 // indirect
58+
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
5859
github.com/99designs/keyring v1.2.1 // indirect
5960
github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect
61+
github.com/DataDog/zstd v1.5.2 // indirect
6062
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
6163
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
6264
github.com/allegro/bigcache v1.2.1 // indirect
6365
github.com/aws/aws-sdk-go v1.44.203 // indirect
6466
github.com/beorn7/perks v1.0.1 // indirect
6567
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
6668
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
69+
github.com/bits-and-blooms/bitset v1.7.0 // indirect
6770
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
6871
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
6972
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
@@ -73,28 +76,32 @@ require (
7376
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
7477
github.com/cockroachdb/errors v1.10.0 // indirect
7578
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
79+
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect
7680
github.com/cockroachdb/redact v1.1.5 // indirect
7781
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
7882
github.com/confio/ics23/go v0.9.0 // indirect
83+
github.com/consensys/bavard v0.1.13 // indirect
84+
github.com/consensys/gnark-crypto v0.10.0 // indirect
7985
github.com/cosmos/btcutil v1.0.5 // indirect
8086
github.com/cosmos/gogogateway v1.2.0 // indirect
8187
github.com/cosmos/iavl v0.20.1 // indirect
8288
github.com/cosmos/ics23/go v0.10.0 // indirect
8389
github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect
8490
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
91+
github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect
8592
github.com/creachadair/taskgroup v0.4.2 // indirect
8693
github.com/danieljoos/wincred v1.1.2 // indirect
87-
github.com/deckarep/golang-set v1.8.0 // indirect
94+
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
8895
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
8996
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
9097
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
9198
github.com/dgraph-io/ristretto v0.1.1 // indirect
9299
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
93-
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 // indirect
94-
github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf // indirect
100+
github.com/dlclark/regexp2 v1.7.0 // indirect
101+
github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3 // indirect
95102
github.com/dustin/go-humanize v1.0.1 // indirect
96103
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
97-
github.com/edsrzf/mmap-go v1.0.0 // indirect
104+
github.com/ethereum/c-kzg-4844 v0.3.1 // indirect
98105
github.com/felixge/httpsnoop v1.0.4 // indirect
99106
github.com/fsnotify/fsnotify v1.7.0 // indirect
100107
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
@@ -106,17 +113,19 @@ require (
106113
github.com/go-logr/stdr v1.2.2 // indirect
107114
github.com/go-ole/go-ole v1.2.6 // indirect
108115
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
109-
github.com/go-stack/stack v1.8.0 // indirect
116+
github.com/go-stack/stack v1.8.1 // indirect
110117
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
118+
github.com/gofrs/flock v0.8.1 // indirect
111119
github.com/gogo/googleapis v1.4.1 // indirect
112120
github.com/gogo/protobuf v1.3.2 // indirect
113121
github.com/golang/glog v1.2.0 // indirect
114122
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
115123
github.com/golang/mock v1.6.0 // indirect
116-
github.com/golang/snappy v0.0.4 // indirect
124+
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
117125
github.com/google/btree v1.1.2 // indirect
118126
github.com/google/go-cmp v0.6.0 // indirect
119127
github.com/google/orderedcode v0.0.1 // indirect
128+
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
120129
github.com/google/s2a-go v0.1.7 // indirect
121130
github.com/google/uuid v1.6.0 // indirect
122131
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
@@ -135,14 +144,13 @@ require (
135144
github.com/hashicorp/hcl v1.0.0 // indirect
136145
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
137146
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
138-
github.com/holiman/uint256 v1.2.1 // indirect
147+
github.com/holiman/uint256 v1.2.3 // indirect
139148
github.com/huandu/skiplist v1.2.0 // indirect
140149
github.com/huin/goupnp v1.0.3 // indirect
141150
github.com/inconshreveable/mousetrap v1.1.0 // indirect
142151
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
143152
github.com/jmespath/go-jmespath v0.4.0 // indirect
144153
github.com/jmhodges/levigo v1.0.0 // indirect
145-
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect
146154
github.com/klauspost/compress v1.17.0 // indirect
147155
github.com/kr/pretty v0.3.1 // indirect
148156
github.com/kr/text v0.2.0 // indirect
@@ -160,6 +168,7 @@ require (
160168
github.com/mitchellh/go-homedir v1.1.0 // indirect
161169
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
162170
github.com/mitchellh/mapstructure v1.5.0 // indirect
171+
github.com/mmcloughlin/addchain v0.4.0 // indirect
163172
github.com/mtibben/percent v0.2.1 // indirect
164173
github.com/olekukonko/tablewriter v0.0.5 // indirect
165174
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
@@ -169,9 +178,7 @@ require (
169178
github.com/prometheus/client_model v0.3.0 // indirect
170179
github.com/prometheus/common v0.42.0 // indirect
171180
github.com/prometheus/procfs v0.9.0 // indirect
172-
github.com/prometheus/tsdb v0.7.1 // indirect
173181
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
174-
github.com/rjeczalik/notify v0.9.1 // indirect
175182
github.com/rogpeppe/go-internal v1.11.0 // indirect
176183
github.com/rs/zerolog v1.33.0 // indirect
177184
github.com/sagikazarmark/locafero v0.4.0 // indirect
@@ -183,6 +190,7 @@ require (
183190
github.com/spf13/pflag v1.0.5 // indirect
184191
github.com/stretchr/objx v0.5.2 // indirect
185192
github.com/subosito/gotenv v1.6.0 // indirect
193+
github.com/supranational/blst v0.3.11 // indirect
186194
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
187195
github.com/tendermint/go-amino v0.16.0 // indirect
188196
github.com/tidwall/match v1.1.1 // indirect
@@ -218,11 +226,10 @@ require (
218226
gopkg.in/yaml.v3 v3.0.1 // indirect
219227
nhooyr.io/websocket v1.8.6 // indirect
220228
pgregory.net/rapid v1.1.0 // indirect
229+
rsc.io/tmplfunc v0.0.3 // indirect
221230
)
222231

223232
replace (
224-
// use cosmos keyring
225-
github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
226233
github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
227234
github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.37.2
228235
// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
@@ -232,4 +239,4 @@ replace (
232239
)
233240

234241
// ZetaChain maintained replacements
235-
replace github.com/ethereum/go-ethereum => github.com/zeta-chain/go-ethereum v1.10.26-spc
242+
replace github.com/ethereum/go-ethereum => github.com/zeta-chain/go-ethereum v1.12.3-0.20241015175757-891ef9f51367

0 commit comments

Comments
 (0)