From 4ca7c43b6274841645a3d12eff41d04b274cc585 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Tue, 22 Jun 2021 04:25:38 -0400 Subject: [PATCH] deps: bump SDK and Tendermint versions (#165) * deps: bump SDK and Tendermint versions * use header hash from context * c++ * typo --- CHANGELOG.md | 4 ++-- go.mod | 8 ++++---- go.sum | 7 ++++--- tests/tooling/ethers/ethers.js | 8 ++++++++ x/evm/keeper/abci.go | 2 -- x/evm/keeper/keeper.go | 4 ---- x/evm/keeper/state_transition.go | 3 +-- x/evm/keeper/statedb.go | 2 +- 8 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 tests/tooling/ethers/ethers.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2deddb59..38d67f5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,9 +54,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (deps) [tharsis#165](https://github.com/tharsis/ethermint/pull/165) Bump Cosmos SDK and Tendermint versions to [v0.42.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.6) and [v0.34.11](https://github.com/tendermint/tendermint/releases/tag/v0.34.11), respectively. * (evm) [tharsis#66](https://github.com/tharsis/ethermint/issues/66) Support legacy transaction types for signing. -* (evm) [tharsis#24](https://github.com/tharsis/ethermint/pull/24) Implement metrics for `MsgEthereumTx`, state transtitions, `BeginBlock` and `EndBlock`. -* (deps) [\#602](https://github.com/cosmos/ethermint/pull/856) Bump tendermint version to [v0.39.3](https://github.com/tendermint/tendermint/releases/tag/v0.39.3) +* (evm) [tharsis#24](https://github.com/tharsis/ethermint/pull/24) Implement metrics for `MsgEthereumTx`, state transitions, `BeginBlock` and `EndBlock`. * (rpc) [#124](https://github.com/tharsis/ethermint/issues/124) Implement `txpool_content`, `txpool_inspect` and `txpool_status` RPC methods ### Bug Fixes diff --git a/go.mod b/go.mod index abf8f969..85765fce 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/bugsnag/bugsnag-go v2.1.0+incompatible // indirect github.com/bugsnag/panicwrap v1.3.2 // indirect github.com/cespare/cp v1.1.1 // indirect - github.com/cosmos/cosmos-sdk v0.42.5 + github.com/cosmos/cosmos-sdk v0.42.6 github.com/cosmos/go-bip39 v1.0.0 github.com/deckarep/golang-set v1.7.1 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect @@ -19,7 +19,7 @@ require ( github.com/gofrs/uuid v4.0.0+incompatible // indirect github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 - github.com/google/uuid v1.2.0 + github.com/google/uuid v1.2.0 // indirect github.com/gorilla/mux v1.8.0 github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -38,9 +38,9 @@ require ( github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.1.3 github.com/spf13/viper v1.8.0 - github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 + github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 // indirect github.com/stretchr/testify v1.7.0 - github.com/tendermint/tendermint v0.34.10 + github.com/tendermint/tendermint v0.34.11 github.com/tendermint/tm-db v0.6.4 github.com/tyler-smith/go-bip39 v1.1.0 github.com/xlab/closer v0.0.0-20190328110542-03326addb7c2 diff --git a/go.sum b/go.sum index c235790a..bd89011e 100644 --- a/go.sum +++ b/go.sum @@ -209,8 +209,8 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/cosmos-sdk v0.42.5 h1:tXttRklrAUUrFopfe9aMXpfiArF6MH2QRRqq0Lxyd5w= -github.com/cosmos/cosmos-sdk v0.42.5/go.mod h1:3JyT+Ud7QRTO1/ikncNqVhaF526ZKNqh2HGMqXn+QHE= +github.com/cosmos/cosmos-sdk v0.42.6 h1:ps1QWfvaX6VLNcykA7wzfii/5IwBfYgTIik6NOVDq/c= +github.com/cosmos/cosmos-sdk v0.42.6/go.mod h1:kh37gwYQoWdgR7N/9zeqW2rJ7cnP2W4A7nqIaf6m3zg= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -934,8 +934,9 @@ github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoM github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= -github.com/tendermint/tendermint v0.34.10 h1:wBOc/It8sh/pVH9np2V5fBvRmIyFN/bUrGPx+eAHexs= github.com/tendermint/tendermint v0.34.10/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= +github.com/tendermint/tendermint v0.34.11 h1:q1Yh76oG4QbS07xhmIJh5iAE0fYpJ8P8YKYtjnWfJRY= +github.com/tendermint/tendermint v0.34.11/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= diff --git a/tests/tooling/ethers/ethers.js b/tests/tooling/ethers/ethers.js new file mode 100644 index 00000000..4e4d6b2a --- /dev/null +++ b/tests/tooling/ethers/ethers.js @@ -0,0 +1,8 @@ +import { ethers } from "ethers"; + +// connects to localhost:8545 +const provider = new ethers.providers.JsonRpcProvider() + +// const signer = provider.getSigner(); + +const blockNumber = await provider.getBlockNumber() \ No newline at end of file diff --git a/x/evm/keeper/abci.go b/x/evm/keeper/abci.go index 21bfbfa1..5e286802 100644 --- a/x/evm/keeper/abci.go +++ b/x/evm/keeper/abci.go @@ -4,7 +4,6 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" abci "github.com/tendermint/tendermint/abci/types" @@ -21,7 +20,6 @@ func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) k.WithContext(ctx) k.WithChainID(ctx) - k.headerHash = common.BytesToHash(req.Hash) } // EndBlock updates the accounts and commits state objects to the KV Store, while diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 586081ba..59302000 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -26,7 +26,6 @@ type Keeper struct { // - storing Account's Code // - storing transaction Logs // - storing block height -> bloom filter map. Needed for the Web3 API. - // - storing block hash -> block height map. Needed for the Web3 API. TODO: remove storeKey sdk.StoreKey // key to access the transient store, which is reset on every block during Commit @@ -41,9 +40,6 @@ type Keeper struct { // chain ID number obtained from the context's chain id eip155ChainID *big.Int debug bool - - // hash header for the current height. Reset during abci.RequestBeginBlock - headerHash common.Hash } // NewKeeper generates new evm module keeper diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 31489145..fcabbdfa 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -67,8 +67,7 @@ func (k Keeper) GetHashFn() vm.GetHashFunc { case k.ctx.BlockHeight() == h: // Case 1: The requested height matches the one from the context so we can retrieve the header // hash directly from the context. - // TODO: deprecate field from the keeper on next SDK release - return k.headerHash + return common.BytesToHash(k.ctx.HeaderHash()) case k.ctx.BlockHeight() > h: // Case 2: if the chain is not the current height we need to retrieve the hash from the store for the diff --git a/x/evm/keeper/statedb.go b/x/evm/keeper/statedb.go index 2ea7f552..3533ceb0 100644 --- a/x/evm/keeper/statedb.go +++ b/x/evm/keeper/statedb.go @@ -578,7 +578,7 @@ func (k *Keeper) AddLog(log *ethtypes.Log) { log.TxHash = tx.Hash() } - log.BlockHash = k.headerHash + log.BlockHash = common.BytesToHash(k.ctx.HeaderHash()) log.TxIndex = uint(k.GetTxIndexTransient()) logs := k.GetTxLogs(log.TxHash)