Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into begin-block-base-fee
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Dec 14, 2021
2 parents 9fc0d7b + 423944b commit eb6f510
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 243 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ linters:
- staticcheck
- structcheck
- stylecheck
- typecheck
# - typecheck #TODO: enable
- unconvert
- unparam
- unused
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ Ref: https://keepachangelog.com/en/1.0.0/

- (feemarket) [tharsis#822](https://github.com/tharsis/ethermint/pull/822) Update base fee in begin blocker

### Improvements

* (evm) [tharsis#826](https://github.com/tharsis/ethermint/issues/826) Improve allocation of bytes of `tx.To` address.
* (evm) [tharsis#827](https://github.com/tharsis/ethermint/issues/827) Speed up creation of event logs by using the slice insertion idiom with indices.

### Bug Fixes

* (rpc) [tharsis#831](https://github.com/tharsis/ethermint/pull/831) Fix BaseFee value when height is specified.

## [v0.9.0] - 2021-12-01

### State Machine Breaking
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ require (
github.com/rs/zerolog v1.26.0
github.com/spf13/cast v1.4.1
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.9.0
github.com/spf13/viper v1.10.0
github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969
github.com/stretchr/testify v1.7.0
github.com/tendermint/tendermint v0.34.14
github.com/tendermint/tm-db v0.6.4
github.com/tyler-smith/go-bip39 v1.1.0
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 // indirect
google.golang.org/genproto v0.0.0-20211116182654-e63d96a377c4
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
google.golang.org/grpc v1.42.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -50,12 +50,12 @@ require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
github.com/Workiva/go-datastructures v1.0.52 // indirect
github.com/armon/go-metrics v0.3.9 // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coinbase/rosetta-sdk-go v0.6.10 // indirect
github.com/confio/ics23/go v0.6.6 // indirect
github.com/cosmos/btcutil v1.0.4 // indirect
Expand Down Expand Up @@ -90,7 +90,7 @@ require (
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect
Expand All @@ -108,7 +108,7 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
github.com/minio/highwayhash v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
Expand Down Expand Up @@ -138,11 +138,11 @@ require (
github.com/zondax/hid v0.9.0 // indirect
golang.org/x/net v0.0.0-20211111160137-58aab5ef257a // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211111213525-f221eed1c01e // indirect
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.7 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
Expand Down
95 changes: 78 additions & 17 deletions go.sum

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions gometalinter.json

This file was deleted.

35 changes: 0 additions & 35 deletions log/benchmark_test.go

This file was deleted.

88 changes: 0 additions & 88 deletions log/handler.go

This file was deleted.

62 changes: 0 additions & 62 deletions log/handler_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion rpc/ethereum/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ func (e *EVMBackend) BaseFee(height int64) (*big.Int, error) {
}

// Checks the feemarket param NoBaseFee settings, return 0 if it is enabled.
resParams, err := e.queryClient.FeeMarket.Params(e.ctx, &feemarkettypes.QueryParamsRequest{})
resParams, err := e.queryClient.FeeMarket.Params(types.ContextWithHeight(height), &feemarkettypes.QueryParamsRequest{})
if err != nil {
return nil, err
}
Expand Down
5 changes: 1 addition & 4 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

ethlog "github.com/ethereum/go-ethereum/log"
"github.com/tharsis/ethermint/log"
ethdebug "github.com/tharsis/ethermint/rpc/ethereum/namespaces/debug"
"github.com/tharsis/ethermint/server/config"
srvflags "github.com/tharsis/ethermint/server/flags"
Expand Down Expand Up @@ -405,12 +403,11 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty
}
}

ethlog.Root().SetHandler(log.NewHandler(logger))

var (
httpSrv *http.Server
httpSrvDone chan struct{}
)

if config.JSONRPC.Enable {
genDoc, err := genDocProvider()
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions x/evm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyTxHash, hash.String()))
}

if tx.To() != nil {
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyRecipient, tx.To().Hex()))
if to := tx.To(); to != nil {
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyRecipient, to.Hex()))
}

if response.Failed() {
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyEthereumTxFailed, response.VmError))
}

txLogAttrs := make([]sdk.Attribute, 0)
for _, log := range response.Logs {
txLogAttrs := make([]sdk.Attribute, len(response.Logs))
for i, log := range response.Logs {
value, err := json.Marshal(log)
if err != nil {
return nil, sdkerrors.Wrap(err, "failed to encode log")
}
txLogAttrs = append(txLogAttrs, sdk.NewAttribute(types.AttributeKeyTxLog, string(value)))
txLogAttrs[i] = sdk.NewAttribute(types.AttributeKeyTxLog, string(value))
}

// emit events
Expand Down
4 changes: 2 additions & 2 deletions x/evm/types/access_list_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func newAccessListTx(tx *ethtypes.Transaction) (*AccessListTx, error) {
}

v, r, s := tx.RawSignatureValues()
if tx.To() != nil {
txData.To = tx.To().Hex()
if to := tx.To(); to != nil {
txData.To = to.Hex()
}

if tx.Value() != nil {
Expand Down
4 changes: 2 additions & 2 deletions x/evm/types/dynamic_fee_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func newDynamicFeeTx(tx *ethtypes.Transaction) (*DynamicFeeTx, error) {
}

v, r, s := tx.RawSignatureValues()
if tx.To() != nil {
txData.To = tx.To().Hex()
if to := tx.To(); to != nil {
txData.To = to.Hex()
}

if tx.Value() != nil {
Expand Down
4 changes: 2 additions & 2 deletions x/evm/types/legacy_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func newLegacyTx(tx *ethtypes.Transaction) (*LegacyTx, error) {
}

v, r, s := tx.RawSignatureValues()
if tx.To() != nil {
txData.To = tx.To().Hex()
if to := tx.To(); to != nil {
txData.To = to.Hex()
}

if tx.Value() != nil {
Expand Down

0 comments on commit eb6f510

Please sign in to comment.