Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [\#774](https://github.com/cosmos/evm/pull/774) Emit proper allowance amount in erc20 event.
- [\#790](https://github.com/cosmos/evm/pull/790) fix panic in historical query due to missing EvmCoinInfo.
- [\#800](https://github.com/cosmos/evm/pull/800) Fix denom exponent validation in virtual fee deduct in vm module.
- [\#812](https://github.com/cosmos/evm/pull/812) Patch evm tx index and log indexes, cleanup EmitTxHashEvent and ResetTransientGasUsed.
- [\#817](https://github.com/cosmos/evm/pull/817) Align GetCoinbaseAddress to handle empty proposer address in contexts like CheckTx where proposer doesn't exist.
- [\#814](https://github.com/cosmos/evm/pull/814) Fix duplicated events in post tx processor.
- [\#816](https://github.com/cosmos/evm/pull/816) Avoid nil pointer when RPC requests execute before evmCoinInfo initialization in PreBlock with defaultEvmCoinInfo fallback.
Expand Down
4 changes: 2 additions & 2 deletions ante/cosmos/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
)

var evmCodec codec.ProtoCodecMarshaler
var evmCodec codec.ProtoCodecMarshaler //nolint: staticcheck

func init() {
registry := codectypes.NewInterfaceRegistry()
Expand Down Expand Up @@ -177,7 +177,7 @@ func VerifySignature(
return errorsmod.Wrap(errortypes.ErrNoSignatures, "tx doesn't contain any msgs to verify signature")
}

txBytes := legacytx.StdSignBytes(
txBytes := legacytx.StdSignBytes( //nolint: staticcheck
signerData.ChainID,
signerData.AccountNumber,
signerData.Sequence,
Expand Down
25 changes: 0 additions & 25 deletions ante/evm/11_emit_event.go

This file was deleted.

2 changes: 1 addition & 1 deletion ante/evm/fee_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func FeeChecker(
}

feeCoins := feeTx.GetFee()
feeAmtDec := sdkmath.LegacyNewDecFromInt(feeCoins.AmountOfNoDenomValidation(denom))
feeAmtDec := sdkmath.LegacyNewDecFromInt(feeCoins.AmountOfNoDenomValidation(denom)) //nolint: staticcheck

feeCap := feeAmtDec.QuoInt(gas)
if feeCap.LT(baseFee) {
Expand Down
3 changes: 0 additions & 3 deletions ante/evm/mono_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne
return ctx, err
}

// Emit event unconditionally - ctx.TxIndex() will be valid during block execution
EmitTxHashEvent(ctx, ethMsg, uint64(ctx.TxIndex())) // #nosec G115 -- no overlfow here

if err := CheckTxFee(txFeeInfo, decUtils.TxFee, decUtils.TxGasLimit); err != nil {
return ctx, err
}
Expand Down
4 changes: 2 additions & 2 deletions ethereum/eip712/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

var (
protoCodec codec.ProtoCodecMarshaler
protoCodec codec.ProtoCodecMarshaler //nolint: staticcheck
aminoCodec *codec.LegacyAmino
eip155ChainID uint64
)
Expand Down Expand Up @@ -166,7 +166,7 @@ func decodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error) {
}

// WrapTxToTypedData expects the payload as an Amino Sign Doc
signBytes := legacytx.StdSignBytes(
signBytes := legacytx.StdSignBytes( //nolint: staticcheck
signDoc.ChainId,
signDoc.AccountNumber,
signerInfo.Sequence,
Expand Down
2 changes: 1 addition & 1 deletion ethereum/eip712/encoding_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func legacyDecodeProtobufSignDoc(signDocBytes []byte, eip155ChainID uint64) (api
}

// WrapTxToTypedData expects the payload as an Amino Sign Doc
signBytes := legacytx.StdSignBytes(
signBytes := legacytx.StdSignBytes( //nolint: staticcheck
signDoc.ChainId,
signDoc.AccountNumber,
signerInfo.Sequence,
Expand Down
34 changes: 32 additions & 2 deletions evmd/app.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package evmd

import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"os"

goruntime "runtime"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism

cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"

"github.com/spf13/cast"

// Force-load the tracer engines to trigger registration due to Go-Ethereum v1.10.15 changes
Expand Down Expand Up @@ -73,6 +78,7 @@
upgradetypes "cosmossdk.io/x/upgrade/types"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/blockstm"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
Expand Down Expand Up @@ -201,6 +207,18 @@
configurator module.Configurator
}

type customRunner struct {
*blockstm.STMRunner
}

func (r *customRunner) Run(ctx context.Context, ms storetypes.MultiStore, txs [][]byte, deliverTx sdk.DeliverTxFunc) ([]*abci.ExecTxResult, error) {
results, err := r.STMRunner.Run(ctx, ms, txs, deliverTx)
if err != nil {
return nil, err
}
return evmtypes.PatchTxResponses(results), nil
}

// NewExampleApp returns a reference to an initialized EVMD.
func NewExampleApp(
logger log.Logger,
Expand All @@ -217,13 +235,13 @@
legacyAmino := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
txConfig := encodingConfig.TxConfig

txDecoder := encodingConfig.TxConfig.TxDecoder()
bApp := baseapp.NewBaseApp(
appName,
logger,
db,
// use transaction decoder to support the sdk.Tx interface instead of sdk.StdTx
encodingConfig.TxConfig.TxDecoder(),
txDecoder,
baseAppOptions...,
)
bApp.SetCommitMultiStoreTracer(traceStore)
Expand Down Expand Up @@ -770,6 +788,18 @@
}
}

bApp.SetBlockSTMTxRunner(&customRunner{
STMRunner: blockstm.NewSTMRunner(
encodingConfig.TxConfig.TxDecoder(),
nonTransientKeys,
min(goruntime.GOMAXPROCS(0), goruntime.NumCPU()),
true,
func(ms storetypes.MultiStore) string {
return app.EVMKeeper.GetParams(sdk.NewContext(ms, cmtproto.Header{}, false, log.NewNopLogger())).EvmDenom
},
),
})

return app
}

Expand Down
31 changes: 15 additions & 16 deletions evmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
cosmossdk.io/x/upgrade v0.2.0
github.com/cometbft/cometbft v0.39.0-beta.2
github.com/cosmos/cosmos-db v1.1.3
github.com/cosmos/cosmos-sdk v0.54.0-beta.0
github.com/cosmos/cosmos-sdk v0.54.0-rc.1.0.20251126034423-346c59f6e4f6
github.com/cosmos/evm v0.2.0
github.com/cosmos/gogoproto v1.7.2
github.com/cosmos/ibc-go/v10 v10.0.0-beta.0.0.20251027215440-22f0033d0aee
Expand All @@ -29,15 +29,15 @@ require (
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
golang.org/x/sync v0.18.0
google.golang.org/grpc v1.76.0
google.golang.org/grpc v1.77.0
)

require (
cel.dev/expr v0.24.0 // indirect
cloud.google.com/go v0.122.0 // indirect
cloud.google.com/go/auth v0.16.5 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.8.0 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
cloud.google.com/go/iam v1.5.2 // indirect
cloud.google.com/go/monitoring v1.24.2 // indirect
cloud.google.com/go/storage v1.56.1 // indirect
Expand All @@ -50,7 +50,7 @@ require (
github.com/99designs/keyring v1.2.2 // indirect
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
github.com/DataDog/zstd v1.5.7 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
Expand All @@ -76,7 +76,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.2.0 // indirect
github.com/bits-and-blooms/bitset v1.24.3 // indirect
github.com/bits-and-blooms/bitset v1.24.4 // indirect
github.com/btcsuite/btcd v0.24.2 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.5 // indirect
github.com/btcsuite/btcd/btcutil v1.1.6 // indirect
Expand All @@ -88,7 +88,7 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect
github.com/cncf/xds/go v0.0.0-20251022180443-0feb69152e9f // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.12.0 // indirect
github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect
Expand Down Expand Up @@ -121,7 +121,7 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.7.0 // indirect
github.com/emicklei/dot v1.8.0 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.35.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/ethereum/c-kzg-4844/v2 v2.1.0 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
Expand All @@ -130,7 +130,7 @@ require (
github.com/ferranbt/fastssz v0.1.4 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/getsentry/sentry-go v0.35.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.2 // indirect
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.1 // indirect
Expand Down Expand Up @@ -214,7 +214,7 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.1 // indirect
github.com/prometheus/common v0.67.3 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
Expand All @@ -226,7 +226,7 @@ require (
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.16 // indirect
Expand All @@ -243,13 +243,12 @@ require (
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zeebo/errs v1.4.0 // indirect
github.com/zondax/golem v0.27.0 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v1.0.1 // indirect
go.etcd.io/bbolt v1.4.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.38.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
go.opentelemetry.io/otel v1.38.0 // indirect
Expand All @@ -267,16 +266,16 @@ require (
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/oauth2 v0.31.0 // indirect
golang.org/x/oauth2 v0.32.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/time v0.13.0 // indirect
golang.org/x/tools v0.38.0 // indirect
google.golang.org/api v0.247.0 // indirect
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
google.golang.org/protobuf v1.36.10 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading