all: remove telemetry (#545)
This commit is contained in:
parent
587cf78b5c
commit
540bd79f7f
2
go.mod
2
go.mod
@ -3,7 +3,6 @@ module github.com/tharsis/ethermint
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/armon/go-metrics v0.3.9
|
||||
github.com/btcsuite/btcd v0.22.0-beta
|
||||
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
|
||||
github.com/cosmos/cosmos-sdk v0.44.0
|
||||
@ -48,6 +47,7 @@ require (
|
||||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
|
||||
github.com/VictoriaMetrics/fastcache v1.5.7 // indirect
|
||||
github.com/Workiva/go-datastructures v1.0.52 // indirect
|
||||
github.com/armon/go-metrics v0.3.9 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bgentry/speakeasy v0.1.0 // indirect
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
|
@ -1,20 +1,15 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/telemetry"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/tharsis/ethermint/x/evm/types"
|
||||
)
|
||||
|
||||
// BeginBlock sets the sdk Context and EIP155 chain id to the Keeper.
|
||||
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)
|
||||
}
|
||||
@ -23,8 +18,6 @@ func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
|
||||
// KVStore. The EVM end block logic doesn't update the validator set, thus it returns
|
||||
// an empty slice.
|
||||
func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
|
||||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)
|
||||
|
||||
// Gas costs are handled within msg handler so costs should be ignored
|
||||
infCtx := ctx.WithGasMeter(sdk.NewInfiniteGasMeter())
|
||||
k.WithContext(infCtx)
|
||||
|
@ -3,15 +3,12 @@ package keeper
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/armon/go-metrics"
|
||||
"github.com/palantir/stacktrace"
|
||||
|
||||
tmbytes "github.com/tendermint/tendermint/libs/bytes"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/telemetry"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/tharsis/ethermint/x/evm/types"
|
||||
@ -24,46 +21,17 @@ var _ types.MsgServer = &Keeper{}
|
||||
// so that it can implements and call the StateDB methods without receiving it as a function
|
||||
// parameter.
|
||||
func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error) {
|
||||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), types.TypeMsgEthereumTx)
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
k.WithContext(ctx)
|
||||
|
||||
sender := msg.From
|
||||
tx := msg.AsTransaction()
|
||||
|
||||
labels := []metrics.Label{telemetry.NewLabel("tx_type", fmt.Sprintf("%d", tx.Type()))}
|
||||
if tx.To() == nil {
|
||||
labels = []metrics.Label{
|
||||
telemetry.NewLabel("execution", "create"),
|
||||
}
|
||||
} else {
|
||||
labels = []metrics.Label{
|
||||
telemetry.NewLabel("execution", "call"),
|
||||
telemetry.NewLabel("to", tx.To().Hex()), // recipient address (contract or account)
|
||||
}
|
||||
}
|
||||
|
||||
response, err := k.ApplyTransaction(tx)
|
||||
if err != nil {
|
||||
return nil, stacktrace.Propagate(err, "failed to apply transaction")
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if tx.Value().IsInt64() {
|
||||
telemetry.SetGauge(
|
||||
float32(tx.Value().Int64()),
|
||||
"tx", "msg", "ethereum_tx",
|
||||
)
|
||||
}
|
||||
|
||||
telemetry.IncrCounterWithLabels(
|
||||
[]string{types.ModuleName, "ethereum_tx"},
|
||||
1,
|
||||
labels,
|
||||
)
|
||||
}()
|
||||
|
||||
attrs := []sdk.Attribute{
|
||||
sdk.NewAttribute(sdk.AttributeKeyAmount, tx.Value().String()),
|
||||
// add event for ethereum transaction hash format
|
||||
|
@ -2,12 +2,10 @@ package keeper
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"time"
|
||||
|
||||
"github.com/palantir/stacktrace"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/telemetry"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
@ -132,8 +130,6 @@ func (k Keeper) GetHashFn() vm.GetHashFunc {
|
||||
//
|
||||
// For relevant discussion see: https://github.com/cosmos/cosmos-sdk/discussions/9072
|
||||
func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumTxResponse, error) {
|
||||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), types.MetricKeyTransitionDB)
|
||||
|
||||
ctx := k.Ctx()
|
||||
params := k.GetParams(ctx)
|
||||
|
||||
|
@ -2,22 +2,16 @@ package keeper
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/telemetry"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/tharsis/ethermint/x/feemarket/types"
|
||||
)
|
||||
|
||||
// EndBlock also retrieves the bloom filter value from the transient store and commits it to the
|
||||
// KVStore. The EVM end block logic doesn't update the validator set, thus it returns
|
||||
// an empty slice.
|
||||
func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) {
|
||||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)
|
||||
|
||||
baseFee := k.CalculateBaseFee(ctx)
|
||||
if baseFee == nil {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user