Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e91c6f9
test: adjusts GasTipCap to equal GasFeeCap when it exceeds the maximu…
mmsqe Jul 23, 2025
9246752
ensures adequate fees for bank msg send
mmsqe Jul 23, 2025
c9bdb59
Merge 'mmsqe/benchmark': fix BenchmarkAnteHandler
heijiLee Jul 24, 2025
8cd9d64
Optimize CanTransfer AnteHandler
heijiLee Jul 24, 2025
f4d3f20
Merge branch 'main' into feat/delete-evm-instance-ante
Jul 28, 2025
d88562f
refactor(antehandler): remove stateDB allocation
heijiLee Jul 31, 2025
9edcff5
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 6, 2025
a964a8a
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 8, 2025
140e508
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 11, 2025
ecdac01
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 11, 2025
aa33e62
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 13, 2025
ad3c9a0
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 14, 2025
8774f28
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 18, 2025
6f024cf
Merge branch 'main' into feat/delete-evm-instance-ante
vladjdk Aug 18, 2025
01333a5
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 19, 2025
f77b050
chore: replace GlobalEVMMempool by passing to JSONRPC on initiate (#467)
mmsqe Aug 19, 2025
90522db
Problem: eip-2935 is not implemented (#407)
yihuang Aug 20, 2025
2d55682
fix : EVMKeeper GetBalance missed when version upgrades
heijiLee Aug 20, 2025
0ba69b9
add CHANGELOG
heijiLee Aug 20, 2025
9fe9d39
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 20, 2025
abc0c30
Merge branch 'main' into feat/delete-evm-instance-ante
Aug 20, 2025
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 @@ -8,6 +8,7 @@

### IMPROVEMENTS

- [\#352](https://github.com/cosmos/evm/pull/352) Remove the creation of a Geth EVM instance, stateDB during the AnteHandler balance check.
- [\#467](https://github.com/cosmos/evm/pull/467) Ensure SetGlobalEVMMempool is thread-safe and only sets global mempool instance once.

### FEATURES
Expand Down
14 changes: 1 addition & 13 deletions ante/evm/07_can_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package evm
import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"

anteinterfaces "github.com/cosmos/evm/ante/interfaces"
"github.com/cosmos/evm/utils"
"github.com/cosmos/evm/x/vm/statedb"
evmtypes "github.com/cosmos/evm/x/vm/types"

errorsmod "cosmossdk.io/errors"
Expand All @@ -34,23 +32,13 @@ func CanTransfer(
)
}

// NOTE: pass in an empty coinbase address and nil tracer as we don't need them for the check below
cfg := &statedb.EVMConfig{
Params: params,
CoinBase: common.Address{},
BaseFee: baseFee,
}

stateDB := statedb.New(ctx, evmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())))
evm := evmKeeper.NewEVM(ctx, msg, cfg, evmtypes.NewNoOpTracer(), stateDB)

// check that caller has enough balance to cover asset transfer for **topmost** call
// NOTE: here the gas consumed is from the context with the infinite gas meter
convertedValue, err := utils.Uint256FromBigInt(msg.Value)
if err != nil {
return err
}
if msg.Value.Sign() > 0 && !evm.Context.CanTransfer(stateDB, msg.From, convertedValue) {
if msg.Value.Sign() > 0 && evmKeeper.GetAccount(ctx, msg.From).Balance.Cmp(convertedValue) < 0 {
return errorsmod.Wrapf(
errortypes.ErrInsufficientFunds,
"failed to transfer %s from address %s using the EVM block context transfer function",
Expand Down
Loading