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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (rpc) [#870](https://github.com/crypto-org-chain/ethermint/pull/870) fix(rpc): fix eth_getBlockReceipts crash
* (ante) [#829](https://github.com/crypto-org-chain/ethermint/pull/829) fix: validate payload messages in legacy EIP-712
* (rpc) [#869](https://github.com/crypto-org-chain/ethermint/pull/869) feat(RPC): implement `eth_simulateV1` RPC

## [v0.23.0] - 2026-01-13

Expand All @@ -59,7 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (evm) [#809](https://github.com/crypto-org-chain/ethermint/pull/809) fix: relax preinstall rules
* (rpc) [#814](https://github.com/crypto-org-chain/ethermint/pull/814) fix: estimate gas not accurate
* (evm) [#815](https://github.com/crypto-org-chain/ethermint/pull/815) fix: nonce increments on EIP-7702 contract creation
* (evm) [#822](https://github.com/crypto-org-chain/ethermint/pull/822) refactor:replace MsgEthereumTxResponse with EthCallResponse in EVM calls
* (evm) [#822](https://github.com/crypto-org-chain/ethermint/pull/822) refactor: replace MsgEthereumTxResponse with EthCallResponse in EVM calls

## [v0.22.0] - 2025-08-12

Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -540,3 +540,21 @@ localnet-show-logstream:
docker-compose logs --tail=1000 -f

.PHONY: build-docker-local-ethermint localnet-start localnet-stop

###############################################################################
### Mocks ###
###############################################################################

MOCKERY := go run github.com/vektra/mockery/v2@v2.53.0
COMETBFT_DIR := $(shell go list -m -f '{{.Dir}}' github.com/cometbft/cometbft)

mocks:
$(MOCKERY) --name "QueryClient" --structname "EVMQueryClient" \
--dir x/evm/types --output rpc/backend/mocks --outpkg mocks --filename evm_query_client.go
$(MOCKERY) --name "QueryClient" --structname "FeeMarketQueryClient" \
--dir x/feemarket/types --output rpc/backend/mocks --outpkg mocks --filename feemarket_query_client.go
$(MOCKERY) --name "Client" \
--dir $(COMETBFT_DIR)/rpc/client \
--output rpc/backend/mocks --outpkg mocks --filename client.go

.PHONY: mocks
29 changes: 28 additions & 1 deletion proto/ethermint/evm/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ service Query {
rpc CreateAccessList(EthCallRequest) returns (CreateAccessListResponse) {
option (google.api.http).get = "/ethermint/evm/v1/create_access_list";
}

// SimulateV1 implements the `eth_simulateV1` rpc api
rpc SimulateV1(SimulateV1Request) returns (SimulateV1Response) {
option (google.api.http).post = "/ethermint/evm/v1/simulate_v1";
}
}

// QueryAccountRequest is the request type for the Query/Account RPC method.
Expand Down Expand Up @@ -365,4 +370,26 @@ message QueryBaseFeeResponse {
message CreateAccessListResponse {
// data is the response serialized in bytes
bytes data = 1;
}
}

// SimulateV1Request defines the request for eth_simulateV1
message SimulateV1Request {
// args is the JSON-encoded rpc/types.SimulateV1Args (SimOpts plus resolved base header)
bytes args = 1;
// gas_cap defines the default gas cap to be used
uint64 gas_cap = 2;
// proposer_address of the requested block in hex format
bytes proposer_address = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"];
// chain_id is the eip155 chain id parsed from the requested block header
int64 chain_id = 4;
}

// SimulateV1Response defines the response for eth_simulateV1
message SimulateV1Response {
// result is the JSON-encoded simulation results (set on success, empty on error)
bytes result = 1;
// error_message is a human-readable description of the simulation error (empty on success)
string error_message = 2;
// error_code is the machine-readable simulation error code (0 on success)
int32 error_code = 3;
}
3 changes: 3 additions & 0 deletions rpc/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ type EVMBackend interface {
TraceTransaction(hash common.Hash, config *rpctypes.TraceConfig) (interface{}, error)
TraceBlock(height rpctypes.BlockNumber, config *rpctypes.TraceConfig, block *tmrpctypes.ResultBlock) ([]*evmtypes.TxTraceResult, error)
TraceCall(args evmtypes.TransactionArgs, blockNr rpctypes.BlockNumberOrHash, config *rpctypes.TraceConfig) (interface{}, error)

// Simulation
SimulateV1(opts rpctypes.SimOpts, blockNr rpctypes.BlockNumber) (json.RawMessage, error)
}

var _ BackendI = (*Backend)(nil)
Expand Down
2 changes: 1 addition & 1 deletion rpc/backend/call_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func (b *Backend) DoCall(
}
length := len(res.Ret)
if length > int(b.cfg.JSONRPC.ReturnDataLimit) && b.cfg.JSONRPC.ReturnDataLimit != 0 {
return nil, fmt.Errorf("call retuned result on length %d exceeding limit %d", length, b.cfg.JSONRPC.ReturnDataLimit)
return nil, fmt.Errorf("call returned result of length %d exceeding limit %d", length, b.cfg.JSONRPC.ReturnDataLimit)
}

if err = b.handleRevertError(res.VmError, res.Ret); err != nil {
Expand Down
Loading
Loading