Skip to content

Commit

Permalink
Merge PR: bump to v0.19.5 (#1011)
Browse files Browse the repository at this point in the history
* modify v1100

* v1.10.8

* modify go-ethereum-hdwallet version to 56a4d342a6fff2a2e0640066f4363c68ebdc6697 adapting for go-ethereum v1.10.8

* rm useless params

* bump to v0.19.5

Co-authored-by: [email protected] <[email protected]>
Co-authored-by: KamiD <[email protected]>
  • Loading branch information
3 people authored Sep 9, 2021
1 parent 77e6ade commit 909fcef
Show file tree
Hide file tree
Showing 9 changed files with 270 additions and 67 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export GO111MODULE=on
GithubTop=github.com


Version=v0.19.3
Version=v0.19.5
CosmosSDK=v0.39.2
Tendermint=v0.33.9
Iavl=v0.14.3
Expand Down
3 changes: 2 additions & 1 deletion app/ante/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ante

import (
"fmt"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"math/big"

"github.com/cosmos/cosmos-sdk/baseapp"
Expand Down Expand Up @@ -375,7 +376,7 @@ func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
}

gasLimit := msgEthTx.GetGas()
gas, err := ethcore.IntrinsicGas(msgEthTx.Data.Payload, msgEthTx.To() == nil, true, false)
gas, err := ethcore.IntrinsicGas(msgEthTx.Data.Payload, []ethtypes.AccessTuple{}, msgEthTx.To() == nil, true, false)
if err != nil {
return ctx, sdkerrors.Wrap(err, "failed to compute intrinsic gas cost")
}
Expand Down
2 changes: 1 addition & 1 deletion app/crypto/hd/algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func DeriveSecp256k1(mnemonic, bip39Passphrase, path string) ([]byte, error) {

key := masterKey
for _, n := range hdpath {
key, err = key.Child(n)
key, err = key.Derive(n)
if err != nil {
return nil, err
}
Expand Down
27 changes: 13 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,53 @@ require (
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible
github.com/apolloconfig/agollo/v4 v4.0.8
github.com/aristanetworks/goarista v0.0.0-20200331225509-2cc472e8fbd6 // indirect
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
github.com/btcsuite/btcd v0.21.0-beta
github.com/btcsuite/btcutil v1.0.2
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/cespare/cp v1.1.1 // indirect
github.com/cosmos/cosmos-sdk v0.39.2
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/ethereum/go-ethereum v1.9.25
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
github.com/ethereum/go-ethereum v1.10.8
github.com/frankban/quicktest v1.7.2 // indirect
github.com/garyburd/redigo v1.6.2
github.com/go-kit/kit v0.10.0
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-redis/redis v6.15.9+incompatible
github.com/go-sql-driver/mysql v1.5.0
github.com/google/uuid v1.1.1
github.com/google/uuid v1.1.5
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.4.2
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/jinzhu/gorm v1.9.16
github.com/json-iterator/go v1.1.9
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20200123000308-a60dcd172b4c
github.com/kr/pretty v0.2.0 // indirect
github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20210614093730-56a4d342a6ff
github.com/nacos-group/nacos-sdk-go v1.0.0
github.com/pierrec/lz4 v2.4.1+incompatible // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/procfs v0.0.10 // indirect
github.com/prometheus/tsdb v0.9.1 // indirect
github.com/segmentio/kafka-go v0.2.2
github.com/shirou/gopsutil v2.20.9+incompatible // indirect
github.com/shopspring/decimal v1.2.0
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cobra v1.1.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48
github.com/stretchr/testify v1.7.0
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954
github.com/tendermint/go-amino v0.15.1
github.com/tendermint/iavl v0.14.1
github.com/tendermint/tendermint v0.33.9
github.com/tendermint/tm-db v0.5.2
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef
github.com/willf/bitset v1.1.11
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
google.golang.org/grpc v1.30.0 // indirect
gopkg.in/yaml.v2 v2.3.0
gopkg.in/yaml.v2 v2.4.0
)

replace (
Expand Down
281 changes: 236 additions & 45 deletions go.sum

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions x/evm/legacy/v0_16/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ type (
IstanbulBlock sdk.Int `json:"istanbul_block" yaml:"istanbul_block"` // Istanbul switch block (< 0 no fork, 0 = already on istanbul)
MuirGlacierBlock sdk.Int `json:"muir_glacier_block" yaml:"muir_glacier_block"` // Eip-2384 (bomb delay) switch block (< 0 no fork, 0 = already activated)

YoloV2Block sdk.Int `json:"yoloV2_block" yaml:"yoloV2_block"` // YOLO v1: https://github.com/ethereum/EIPs/pull/2657 (Ephemeral testnet)
EWASMBlock sdk.Int `json:"ewasm_block" yaml:"ewasm_block"` // EWASM switch block (< 0 no fork, 0 = already activated)
}

Params struct {
Expand Down
2 changes: 0 additions & 2 deletions x/evm/types/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig {
PetersburgBlock: getBlockValue(cc.PetersburgBlock),
IstanbulBlock: getBlockValue(cc.IstanbulBlock),
MuirGlacierBlock: getBlockValue(cc.MuirGlacierBlock),
YoloV2Block: getBlockValue(cc.YoloV2Block),
EWASMBlock: getBlockValue(cc.EWASMBlock),
}
}

Expand Down
2 changes: 1 addition & 1 deletion x/evm/types/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (exe

contractCreation := st.Recipient == nil

cost, err := core.IntrinsicGas(st.Payload, contractCreation, config.IsHomestead(), config.IsIstanbul())
cost, err := core.IntrinsicGas(st.Payload, []ethtypes.AccessTuple{}, contractCreation, config.IsHomestead(), config.IsIstanbul())
if err != nil {
return exeRes, resData, sdkerrors.Wrap(err, "invalid intrinsic gas for transaction")
}
Expand Down
16 changes: 16 additions & 0 deletions x/evm/types/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,22 @@ func (csdb *CommitStateDB) AddSlotToAccessList(addr ethcmn.Address, slot ethcmn.
})
}
}
func (csdb *CommitStateDB) PrepareAccessList(sender ethcmn.Address, dest *ethcmn.Address, precompiles []ethcmn.Address, txAccesses ethtypes.AccessList) {
csdb.AddAddressToAccessList(sender)
if csdb != nil {
csdb.AddAddressToAccessList(*dest)
// If it's a create-tx, the destination will be added inside evm.create
}
for _, addr := range precompiles {
csdb.AddAddressToAccessList(addr)
}
for _, el := range txAccesses {
csdb.AddAddressToAccessList(el.Address)
for _, key := range el.StorageKeys {
csdb.AddSlotToAccessList(el.Address, key)
}
}
}

// AddressInAccessList returns true if the given address is in the access list.
func (csdb *CommitStateDB) AddressInAccessList(addr ethcmn.Address) bool {
Expand Down

0 comments on commit 909fcef

Please sign in to comment.