forked from cerc-io/laconicd-deprecated
evm: treat all vm errors the same as reverted (#276)
Closes: #274 evm: fix `ExtraEIP` activation (#288) Closes: #287 Update x/evm/types/utils.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Add `Failed` utility function and changelog
This commit is contained in:
1 parent
9d1ce30ecd
commit
297a35dbdd
12 files changed
+416
-201
No files matched your search
@@ -44,6 +44,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
* (rpc, evm) [tharsis#81](https://github.com/tharsis/ethermint/pull/81) Remove tx `Receipt` from store and replace it with fields obtained from the Tendermint RPC client.
|
||||
* (evm) [tharsis#72](https://github.com/tharsis/ethermint/issues/72) Update `AccessList` to use `TransientStore` instead of map.
|
||||
* (evm) [tharsis#68](https://github.com/tharsis/ethermint/issues/68) Replace block hash storage map to use staking `HistoricalInfo`.
|
||||
* (evm) [tharsis#276](https://github.com/tharsis/ethermint/pull/276) Vm errors don't result in cosmos tx failure, just
|
||||
different tx state and events.
|
||||
|
||||
### API Breaking
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
|
||||
func init() {
|
||||
data := "PK\x03\x04\x14\x00\x08\x00\x08\x00\xccS\xd6R\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00 \x00favicon-16x16.pngUT\x05\x00\x01\xc1\xbb\xd1`\x00\xbd\x01B\xfe\x89PNG\x0d\n\x1a\n\x00\x00\x00\x0dIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\x00\x00\x01\x84IDATx\x01\x95S\x03Luq\x1c\xfd\x8c\xf1\xc3\xec0\xa7)\xcda\xb6k6\xb2\x9b\xf9\xb2k\xc85/\xdb\x8dqx\xc6\x94m\xcc{\xef\x7fO\xff\xf3l\xdc\xed\xf2\xe0\xfe\xf8\xc9\xffP\x14\x11/\x14[\xa3P\xc4\xa1\xbc?\xf1t>7\x12s\x13\x03\x85\xca7IR a\xb5j\x8f\xa71\xbe]\x88\xf6\xb9L\xf0\x1c\x93\xcf\xda\xe3)\x10\x93f\x8d\xe4\x06\x13\xcf\xde<\x9b\xd14\x95\x8a\x92\x81OA\xcfF\x89\xdd<\x9b M\xe6}L\xe4\x07\x15\xc5\xf5\xe3\xffI\x0c{\xd6\x8d\xffs\x994\xbasfh\xae?\xafk\x1aprw\x10 <\xb9\xdb\xc7\x86\xa6\xd1\x19I\n\xa8\xb1\xd7\x84y3g\x171T$\xb5c\x7fq\xfbbq\xbfk\x8e'\x1dQ\xb0\xc2,\x92\x0bx|;F\xe5\xf0\xef\x00\x83\xf2\xa1\x1fx|?q\xbd\xcb\xc2\x16\x80ZF\xf0\xc4J\xf3\xe3\xe4n1\xcc\x17k`:}\xcby\xe8\x98\xcbB\xc7|6z\x97r\xd14\x9d\x06\xd3\xf9\x8a\xe4\x94\x90\x8b\xb6\xd9\x0cP\xebc@\xd0|\xbe*\xc94\xc8\xa7\x98'\xcdh\x00\xe3\xd92\xa6vK}\x0cB\xa4\xf0+D\n\xc7\x81)\xb0\x10\x9a\xe3\xa9\xd8\x8bx\xe4(\xa2\xbb\x8dl\x0d\x01\xb6\x8a-\xf378\xbe\xdd\xc7\xa6\xb6\xc9\xd9\xc6d\xd8\\m\xf4\x0c\x92 uQ\x0e\xd2\xf5\xb3\xd1\xf1w\xdfQ\x16\xb34a$\xa1\xc4\xc4(V\xbcF\xd9\xdf\xa4\x91\xe9\xb0&,\x12+\xcd\x93\xcf\x1c\x1cb\xdc\xca\x00qt\xeb\xcc-\x14\x89\xfe\xfc\x0fm2j\x88\xec\xccs\x18\x00\x00\x00\x00IEND\xaeB`\x82\x01\x00\x00\xff\xffPK\x07\x08\xd4`4t\xc7\x01\x00\x00\xbd\x01\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\xccS\xd6R\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00 \x00favicon-32x32.pngUT\x05\x00\x01\xc1\xbb\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xb6\xe6\x84\x13\xc2 \xcfr\xda \xfb'+-;a\x8bpB)fw\xc20\xc0f\x18\"]\x0b\x01\x10\x86\x92A\"\xbas\x0f\x12\xd1\xed\x06\x89HzZ\x9b\x8a\xe5>,\xe46\x1e5\xbbP\xdd\x15J\x80}\xce\xa4\xe2\xc8{m\xa4\xe2\xc3\xc2\x01\x07\xc0\xdb\xa4\x18-\xa1\x931\xba\x10S\xfa%\xb6P`\x10\x19v\x99#|Gg\x9b \x10W\xf6\x8dI1\xba\x92\xd66\x17E\x12\xfa\xd9\xa8\xf3UTe\n\x1b\x95\x9d\x81f\xe5\x18\xa5umc\x81\x86\xa6\xeb\xec \x804\xcbg\x17\xa19\xfa\xc6\xf7<\xa3\xbd\xf2\x0e\x7f\x02\x80\x97Y\xc7\xac\x184$h\xa3v\xba! \xcc{\xcd\xb4!\xb1\xd8\x92%h\xe3\x93\xdc\xd3_\xda1\xe6\xaei\xcf\x83\xa6p\xbc$\xf0\xb2\xda\x94\xa2q\x14B@\x13\xdb\xff\xf3\xd7\x0d\xfaA\xb9\xc5n{\x8e\xd6Y\x08\x01u\xc1'~\x16\x8e\xe9\x04\xa2\xfbA+\xc74\x0c\x98\xab\xd7:\xfc0\xd1v\xaf$\xa2#\xb7\xf1\x08\xfdm!OXh8\x10j|g\xd1\xe0a\xb2\x99\x04\x9a[y\x9a\xbdk\xf24C$\xa0\x9e#\x9f\xa3\xa8\x001\xc6\x1a\"\xc0\xe4i\xa6\xcc0\xf3\xf7\xb7\xf5XE\xb8\xe0\xa1\xc9\xc2\x0c\x90\x83\x80$\x838\xdf\xd6\xe3\xd4\x82FNG\x0f\x876\x8a\xbf1\xa8d(\xa7@\x8cQX\x90\xdb\x19\x9f\xc5YG\xe9\x9e\x00\xa5y3]\x9aJ\xe1\"\x00\x00\x00\x00IEND\xaeB`\x82\x01\x00\x00\xff\xffPK\x07\x086B\xc8\xd7\x7f\x04\x00\x0Line truncated
|
||||
data := "PK\x03\x04\x14\x00\x08\x00\x08\x00\xacU\xd7R\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00 \x00favicon-16x16.pngUT\x05\x00\x01\xc5\x10\xd3`\x00\xbd\x01B\xfe\x89PNG\x0d\n\x1a\n\x00\x00\x00\x0dIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\x00\x00\x01\x84IDATx\x01\x95S\x03Luq\x1c\xfd\x8c\xf1\xc3\xec0\xa7)\xcda\xb6k6\xb2\x9b\xf9\xb2k\xc85/\xdb\x8dqx\xc6\x94m\xcc{\xef\x7fO\xff\xf3l\xdc\xed\xf2\xe0\xfe\xf8\xc9\xffP\x14\x11/\x14[\xa3P\xc4\xa1\xbc?\xf1t>7\x12s\x13\x03\x85\xca7IR a\xb5j\x8f\xa71\xbe]\x88\xf6\xb9L\xf0\x1c\x93\xcf\xda\xe3)\x10\x93f\x8d\xe4\x06\x13\xcf\xde<\x9b\xd14\x95\x8a\x92\x81OA\xcfF\x89\xdd<\x9b M\xe6}L\xe4\x07\x15\xc5\xf5\xe3\xffI\x0c{\xd6\x8d\xffs\x994\xbasfh\xae?\xafk\x1aprw\x10 <\xb9\xdb\xc7\x86\xa6\xd1\x19I\n\xa8\xb1\xd7\x84y3g\x171T$\xb5c\x7fq\xfbbq\xbfk\x8e'\x1dQ\xb0\xc2,\x92\x0bx|;F\xe5\xf0\xef\x00\x83\xf2\xa1\x1fx|?q\xbd\xcb\xc2\x16\x80ZF\xf0\xc4J\xf3\xe3\xe4n1\xcc\x17k`:}\xcby\xe8\x98\xcbB\xc7|6z\x97r\xd14\x9d\x06\xd3\xf9\x8a\xe4\x94\x90\x8b\xb6\xd9\x0cP\xebc@\xd0|\xbe*\xc94\xc8\xa7\x98'\xcdh\x00\xe3\xd92\xa6vK}\x0cB\xa4\xf0+D\n\xc7\x81)\xb0\x10\x9a\xe3\xa9\xd8\x8bx\xe4(\xa2\xbb\x8dl\x0d\x01\xb6\x8a-\xf378\xbe\xdd\xc7\xa6\xb6\xc9\xd9\xc6d\xd8\\m\xf4\x0c\x92 uQ\x0e\xd2\xf5\xb3\xd1\xf1w\xdfQ\x16\xb34a$\xa1\xc4\xc4(V\xbcF\xd9\xdf\xa4\x91\xe9\xb0&,\x12+\xcd\x93\xcf\x1c\x1cb\xdc\xca\x00qt\xeb\xcc-\x14\x89\xfe\xfc\x0fm2j\x88\xec\xccs\x18\x00\x00\x00\x00IEND\xaeB`\x82\x01\x00\x00\xff\xffPK\x07\x08\xd4`4t\xc7\x01\x00\x00\xbd\x01\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\xacU\xd7R\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00 \x00favicon-32x32.pngUT\x05\x00\x01\xc5\x10\xd3`\x00u\x04\x8a\xfb\x89PNG\x0d\n\x1a\n\x00\x00\x00\x0dIHDR\x00\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x04<IDATx\x01\xbdW\x03\xcceY\x0c~k\xdb\xb6m\xc4^\xc7^\xdb\xb6=F\xf0\xdb\xb6m\xdb\xb6m\xf3\xa2\xd3o\xf2\xce3\x7f5i\xeea\xdb[\x1f\x8d\xa3\xa0\xaa\xea\xa9\xb2\xb2\xf9\xa4\xacH?\xf27B\x92\xd7\xabx<\x02\x94\xe4\x8d\x1a\xfeFa\x0fgpV\xb3S\xa0\xa8\xf2\x85L\xf8{E\x91\xfa\x88Tr\x04p\x96\x05\xf9\x91\xef^l\x8f\xbe\x9d?\x96\xdef\"S\x820\xaf\xd1\xf0t\x03\x95\xb4zRb\xe5\xcf\x14^\xf4!\x90\xc7?Qq\xab\x07\xef\xd5\x13\xce\x08\xc0]\xa6\xf1.h9\xc9\\\xb9\x98\xff N\x10[\xdf\\\xa6\xbc\xa6\xe3\xf4o\xc4\xdd\xf4\x99\xa7\xc6&\xfe\x13q\x17\xe56\x1e\xe3;K:\xa1Y\x88\x04\xd0t\x94\xf9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fqx\xd2\xf2\xda4\x1d\x8a}\x1ck\xd4>\x9cI+\xeb\xb3\xf4k\xc8u`L\x93\xf3]4\xb5\xd0\xc3\xe33\xd9\xee\xd7\xf2\xd9\x19\xea\x18\xc9\xc1Y:\x18\xfb(-\xadN\x82\x06e\xd5\x1f0\xa2\x1dV\xf8\xbe0\xc1\x985\x01\xf8\xd2~\\\xa6\xa5\xb5)&\xf6\x98V\x80l\xe4\x03\xf8\x03\x04\x00s\x9a^\xec\x85\x00\xf4+\x0b\x00\xe1:G\xf2p\x96\x0e\xc4<B\x8b\xab\x13\xa0\x81\xd0\xb4.\x00\xab\xd8\xaa \xf6\xc7<\xac5A \xe6\xf4\x05\xab\xf7k#\x13\x9c 42\xc1\x17:\x13\xe4\xc3\x04\x10\xde\xae \"0)\xb6\xe6\x84\x13\xc2 \xcfr\xda \xfb'+-;a\x8bpB)fw\xc20\xc0f\x18\"]\x0b\x01\x10\x86\x92A\"\xbas\x0f\x12\xd1\xed\x06\x89HzZ\x9b\x8a\xe5>,\xe46\x1e5\xbbP\xdd\x15J\x80}\xce\xa4\xe2\xc8{m\xa4\xe2\xc3\xc2\x01\x07\xc0\xdb\xa4\x18-\xa1\x931\xba\x10S\xfa%\xb6P`\x10\x19v\x99#|Gg\x9b \x10W\xf6\x8dI1\xba\x92\xd66\x17E\x12\xfa\xd9\xa8\xf3UTe\n\x1b\x95\x9d\x81f\xe5\x18\xa5umc\x81\x86\xa6\xeb\xec \x804\xcbg\x17\xa19\xfa\xc6\xf7<\xa3\xbd\xf2\x0e\x7f\x02\x80\x97Y\xc7\xac\x184$h\xa3v\xba! \xcc{\xcd\xb4!\xb1\xd8\x92%h\xe3\x93\xdc\xd3_\xda1\xe6\xaei\xcf\x83\xa6p\xbc$\xf0\xb2\xda\x94\xa2q\x14B@\x13\xdb\xff\xf3\xd7\x0d\xfaA\xb9\xc5n{\x8e\xd6Y\x08\x01u\xc1'~\x16\x8e\xe9\x04\xa2\xfbA+\xc74\x0c\x98\xab\xd7:\xfc0\xd1v\xaf$\xa2#\xb7\xf1\x08\xfdm!OXh8\x10j|g\xd1\xe0a\xb2\x99\x04\x9a[y\x9a\xbdk\xf24C$\xa0\x9e#\x9f\xa3\xa8\x001\xc6\x1a\"\xc0\xe4i\xa6\xcc0\xf3\xf7\xb7\xf5XE\xb8\xe0\xa1\xc9\xc2\x0c\x90\x83\x80$\x838\xdf\xd6\xe3\xd4\x82FNG\x0f\x876\x8a\xbf1\xa8d(\xa7@\x8cQX\x90\xdb\x19\x9f\xc5YG\xe9\x9e\x00\xa5y3]\x9aJ\xe1\"\x00\x00\x00\x00IEND\xaeB`\x82\x01\x00\x00\xff\xffPK\x07\x086B\xc8\xd7\x7f\x04\x00\x0Line truncated
|
||||
fs.Register(data)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -433,7 +433,7 @@ MsgEthereumTxResponse defines the Msg/EthereumTx response type.
|
||||
| `hash` | [string](#string) | | ethereum transaction hash in hex format. This hash differs from the Tendermint sha256 hash of the transaction bytes. See https://github.com/tendermint/tendermint/issues/6539 for reference |
|
||||
| `logs` | [Log](#ethermint.evm.v1alpha1.Log) | repeated | logs contains the transaction hash and the proto-compatible ethereum logs. |
|
||||
| `ret` | [bytes](#bytes) | | returned data from evm function (result or data supplied with revert opcode) |
|
||||
| `reverted` | [bool](#bool) | | reverted flag is set to true when the call has been reverted |
|
||||
| `vm_error` | [string](#string) | | vm error is the error returned by vm execution |
|
||||
| `gas_used` | [uint64](#uint64) | | gas consumed by the transaction |
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
|
||||
"github.com/tharsis/ethermint/crypto/hd"
|
||||
@@ -525,10 +526,6 @@ func (e *PublicAPI) Call(args evmtypes.CallArgs, blockNr rpctypes.BlockNumber, _
|
||||
return []byte{}, err
|
||||
}
|
||||
|
||||
if data.Reverted {
|
||||
return []byte{}, evmtypes.NewExecErrorWithReason(data.Ret)
|
||||
}
|
||||
|
||||
return (hexutil.Bytes)(data.Ret), nil
|
||||
}
|
||||
|
||||
@@ -547,6 +544,13 @@ func (e *PublicAPI) doCall(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if res.Failed() {
|
||||
if res.VmError == vm.ErrExecutionReverted.Error() {
|
||||
return nil, evmtypes.NewExecErrorWithReason(res.Ret)
|
||||
}
|
||||
return nil, errors.New(res.VmError)
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@@ -562,10 +566,6 @@ func (e *PublicAPI) EstimateGas(args evmtypes.CallArgs) (hexutil.Uint64, error)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
if data.Reverted {
|
||||
return 0, evmtypes.NewExecErrorWithReason(data.Ret)
|
||||
}
|
||||
|
||||
return hexutil.Uint64(data.GasUsed), nil
|
||||
}
|
||||
|
||||
@@ -781,7 +781,7 @@ func (e *PublicAPI) GetTransactionReceipt(hash common.Hash) (map[string]interfac
|
||||
|
||||
// Get the transaction result from the log
|
||||
var status hexutil.Uint
|
||||
if strings.Contains(res.TxResult.GetLog(), evmtypes.AttributeKeyEthereumTxReverted) {
|
||||
if strings.Contains(res.TxResult.GetLog(), evmtypes.AttributeKeyEthereumTxFailed) {
|
||||
status = hexutil.Uint(ethtypes.ReceiptStatusFailed)
|
||||
} else {
|
||||
status = hexutil.Uint(ethtypes.ReceiptStatusSuccessful)
|
||||
|
||||
@@ -121,8 +121,8 @@ message MsgEthereumTxResponse {
|
||||
repeated Log logs = 2;
|
||||
// returned data from evm function (result or data supplied with revert opcode)
|
||||
bytes ret = 3;
|
||||
// reverted flag is set to true when the call has been reverted
|
||||
bool reverted = 4;
|
||||
// vm error is the error returned by vm execution
|
||||
string vm_error = 4;
|
||||
// gas consumed by the transaction
|
||||
uint64 gas_used = 5;
|
||||
}
|
||||
}
|
||||
@@ -385,14 +385,11 @@ func (k Keeper) EthCall(c context.Context, req *types.EthCallRequest) (*types.Ms
|
||||
}
|
||||
|
||||
evm := k.NewEVM(msg, ethCfg, params, coinbase)
|
||||
res, err := k.ApplyMessage(evm, msg, ethCfg)
|
||||
// pass true means execute in query mode, which don't do actual gas refund.
|
||||
res, err := k.ApplyMessage(evm, msg, ethCfg, true)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
// ApplyMessage don't handle gas refund, let's do it here
|
||||
refund := k.GasToRefund(res.GasUsed)
|
||||
res.GasUsed -= refund
|
||||
|
||||
return res, nil
|
||||
}
|
||||
@@ -75,8 +75,8 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
|
||||
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyRecipient, tx.To().Hex()))
|
||||
}
|
||||
|
||||
if response.Reverted {
|
||||
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyEthereumTxReverted, "true"))
|
||||
if response.Failed() {
|
||||
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyEthereumTxFailed, response.VmError))
|
||||
}
|
||||
|
||||
// emit events
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"math/big"
|
||||
"os"
|
||||
"time"
|
||||
@@ -140,7 +139,8 @@ func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumT
|
||||
|
||||
k.SetTxHashTransient(tx.Hash())
|
||||
k.IncreaseTxIndexTransient()
|
||||
res, err := k.ApplyMessage(evm, msg, ethCfg)
|
||||
// pass false to execute in real mode, which do actual gas refunding
|
||||
res, err := k.ApplyMessage(evm, msg, ethCfg, false)
|
||||
if err != nil {
|
||||
return nil, stacktrace.Propagate(err, "failed to apply ethereum core message")
|
||||
}
|
||||
@@ -150,14 +150,14 @@ func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumT
|
||||
logs := k.GetTxLogs(txHash)
|
||||
|
||||
// Commit and switch to original context
|
||||
if !res.Reverted {
|
||||
if !res.Failed() {
|
||||
commit()
|
||||
}
|
||||
k.ctx = originalCtx
|
||||
|
||||
// Logs needs to be ignored when tx is reverted
|
||||
// Set the log and bloom filter only when the tx is NOT REVERTED
|
||||
if !res.Reverted {
|
||||
if !res.Failed() {
|
||||
res.Logs = types.NewLogsFromEth(logs)
|
||||
// Update block bloom filter in the original context because blockbloom is set in EndBlock
|
||||
bloom := k.GetBlockBloomTransient()
|
||||
@@ -165,14 +165,7 @@ func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumT
|
||||
k.SetBlockBloomTransient(bloom)
|
||||
}
|
||||
|
||||
// refund gas prior to handling the vm error in order to set the updated gas meter
|
||||
leftoverGas := msg.Gas() - res.GasUsed
|
||||
leftoverGas, err = k.RefundGas(msg, leftoverGas)
|
||||
if err != nil {
|
||||
return nil, stacktrace.Propagate(err, "failed to refund gas leftover gas to sender %s", msg.From())
|
||||
}
|
||||
// update the gas used after refund
|
||||
res.GasUsed = msg.Gas() - leftoverGas
|
||||
k.resetGasMeterAndConsumeGas(res.GasUsed)
|
||||
return res, nil
|
||||
}
|
||||
@@ -217,7 +210,12 @@ func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumT
|
||||
// The preprocessing steps performed by the AnteHandler are:
|
||||
//
|
||||
// 1. set up the initial access list (iff fork > Berlin)
|
||||
func (k *Keeper) ApplyMessage(evm *vm.EVM, msg core.Message, cfg *params.ChainConfig) (*types.MsgEthereumTxResponse, error) {
|
||||
//
|
||||
// Query mode
|
||||
//
|
||||
// The grpc query endpoint EthCall calls this in query mode, and since the query handler don't call AnteHandler,
|
||||
// so we don't do real gas refund in that case.
|
||||
func (k *Keeper) ApplyMessage(evm *vm.EVM, msg core.Message, cfg *params.ChainConfig, query bool) (*types.MsgEthereumTxResponse, error) {
|
||||
var (
|
||||
ret []byte // return bytes from evm execution
|
||||
vmErr error // vm errors do not effect consensus and are therefore not assigned to err
|
||||
@@ -231,7 +229,11 @@ func (k *Keeper) ApplyMessage(evm *vm.EVM, msg core.Message, cfg *params.ChainCo
|
||||
// should have already been checked on Ante Handler
|
||||
return nil, stacktrace.Propagate(err, "intrinsic gas failed")
|
||||
}
|
||||
// should be > 0 as it is checked on Ante Handler
|
||||
// Should check again even if it is checked on Ante Handler, because eth_call don't go through Ante Handler.
|
||||
if msg.Gas() < intrinsicGas {
|
||||
// eth_estimateGas will check for this exact error
|
||||
return nil, stacktrace.Propagate(core.ErrIntrinsicGas, "intrinsic gas too low")
|
||||
}
|
||||
leftoverGas := msg.Gas() - intrinsicGas
|
||||
|
||||
if contractCreation {
|
||||
@@ -240,20 +242,28 @@ func (k *Keeper) ApplyMessage(evm *vm.EVM, msg core.Message, cfg *params.ChainCo
|
||||
ret, leftoverGas, vmErr = evm.Call(sender, *msg.To(), msg.Data(), leftoverGas, msg.Value())
|
||||
}
|
||||
|
||||
var reverted bool
|
||||
if vmErr != nil {
|
||||
if !errors.Is(vmErr, vm.ErrExecutionReverted) {
|
||||
// wrap the VM error
|
||||
return nil, stacktrace.Propagate(sdkerrors.Wrap(types.ErrVMExecution, vmErr.Error()), "vm execution failed")
|
||||
if query {
|
||||
// query handlers don't call ante handler to deduct gas fee, so don't do actual refund here, because the
|
||||
// module account balance might not be enough
|
||||
leftoverGas += k.GasToRefund(msg.Gas() - leftoverGas)
|
||||
} else {
|
||||
// refund gas prior to handling the vm error in order to set the updated gas meter
|
||||
leftoverGas, err = k.RefundGas(msg, leftoverGas)
|
||||
if err != nil {
|
||||
return nil, stacktrace.Propagate(err, "failed to refund gas leftover gas to sender %s", msg.From())
|
||||
}
|
||||
reverted = true
|
||||
}
|
||||
|
||||
var vmError string
|
||||
if vmErr != nil {
|
||||
vmError = vmErr.Error()
|
||||
}
|
||||
|
||||
gasUsed := msg.Gas() - leftoverGas
|
||||
return &types.MsgEthereumTxResponse{
|
||||
Ret: ret,
|
||||
Reverted: reverted,
|
||||
GasUsed: gasUsed,
|
||||
GasUsed: gasUsed,
|
||||
VmError: vmError,
|
||||
Ret: ret,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -4,12 +4,13 @@ package types
|
||||
const (
|
||||
EventTypeEthereumTx = TypeMsgEthereumTx
|
||||
|
||||
AttributeKeyContractAddress = "contract"
|
||||
AttributeKeyRecipient = "recipient"
|
||||
AttributeKeyTxHash = "txHash"
|
||||
AttributeKeyEthereumTxHash = "ethereumTxHash"
|
||||
AttributeKeyEthereumTxReverted = "ethereumTxReverted"
|
||||
AttributeValueCategory = ModuleName
|
||||
AttributeKeyContractAddress = "contract"
|
||||
AttributeKeyRecipient = "recipient"
|
||||
AttributeKeyTxHash = "txHash"
|
||||
AttributeKeyEthereumTxHash = "ethereumTxHash"
|
||||
// tx failed in eth vm execution
|
||||
AttributeKeyEthereumTxFailed = "ethereumTxFailed"
|
||||
AttributeValueCategory = ModuleName
|
||||
|
||||
MetricKeyTransitionDB = "transition_db"
|
||||
MetricKeyStaticCall = "static_call"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package types
|
||||
|
||||
// Failed returns if the contract execution failed in vm errors
|
||||
func (m *MsgEthereumTxResponse) Failed() bool {
|
||||
return len(m.VmError) > 0
|
||||
}
|
||||
+75
-65
@@ -274,8 +274,8 @@ type MsgEthereumTxResponse struct {
|
||||
Logs []*Log `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"`
|
||||
// returned data from evm function (result or data supplied with revert opcode)
|
||||
Ret []byte `protobuf:"bytes,3,opt,name=ret,proto3" json:"ret,omitempty"`
|
||||
// reverted flag is set to true when the call has been reverted
|
||||
Reverted bool `protobuf:"varint,4,opt,name=reverted,proto3" json:"reverted,omitempty"`
|
||||
// vm error is the error returned by vm execution
|
||||
VmError string `protobuf:"bytes,4,opt,name=vm_error,json=vmError,proto3" json:"vm_error,omitempty"`
|
||||
// gas consumed by the transaction
|
||||
GasUsed uint64 `protobuf:"varint,5,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`
|
||||
}
|
||||
@@ -325,54 +325,54 @@ func init() {
|
||||
func init() { proto.RegisterFile("ethermint/evm/v1alpha1/tx.proto", fileDescriptor_6a305e80b084ab0e) }
|
||||
|
||||
var fileDescriptor_6a305e80b084ab0e = []byte{
|
||||
// 748 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x41, 0x6f, 0xd3, 0x4a,
|
||||
0x10, 0xce, 0x26, 0x4e, 0xe2, 0x6c, 0xf2, 0xaa, 0xa7, 0x55, 0x5f, 0xe5, 0xe6, 0x49, 0x76, 0x94,
|
||||
0xa7, 0x87, 0x22, 0xa4, 0xd8, 0x6a, 0xcb, 0xa9, 0x27, 0x6a, 0x5a, 0x55, 0x45, 0xa9, 0x40, 0xab,
|
||||
0x20, 0x24, 0x38, 0x54, 0x1b, 0x67, 0xeb, 0x58, 0xc4, 0xde, 0xc8, 0xbb, 0x89, 0x12, 0x7e, 0x01,
|
||||
0x37, 0xf8, 0x09, 0x9c, 0xe1, 0x08, 0x3f, 0xa2, 0xc7, 0x8a, 0x13, 0xe2, 0x60, 0x50, 0x7a, 0xeb,
|
||||
0x91, 0x0b, 0x57, 0xe4, 0xb5, 0x93, 0x34, 0x40, 0x50, 0x11, 0x9c, 0x3c, 0xe3, 0xf9, 0x76, 0x67,
|
||||
0xf6, 0xfb, 0x66, 0x06, 0x1a, 0x54, 0xf4, 0x68, 0xe8, 0x7b, 0x81, 0xb0, 0xe8, 0xc8, 0xb7, 0x46,
|
||||
0x5b, 0xa4, 0x3f, 0xe8, 0x91, 0x2d, 0x4b, 0x8c, 0xcd, 0x41, 0xc8, 0x04, 0x43, 0x1b, 0x73,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0x93, 0x64, 0x2f,
|
||||
0xd9, 0x37, 0x3f, 0x44, 0xc6, 0x0d, 0xd7, 0x13, 0xbd, 0x61, 0xc7, 0x74, 0x98, 0x9f, 0xd2, 0x90,
|
||||
0x7e, 0x9a, 0xbc, 0xfb, 0xc4, 0x12, 0x93, 0x01, 0xe5, 0xe6, 0x51, 0x20, 0xb0, 0xea, 0x12, 0x7e,
|
||||
0x3f, 0x3e, 0x8b, 0x74, 0x98, 0x73, 0x09, 0x97, 0x55, 0x2a, 0x76, 0x65, 0x1a, 0x19, 0xea, 0x21,
|
||||
0xe1, 0x2d, 0xcf, 0xf7, 0x04, 0x8e, 0x03, 0x68, 0x0d, 0x66, 0x05, 0x4b, 0x6b, 0xcc, 0x0a, 0x86,
|
||||
0xee, 0xc2, 0xfc, 0x88, 0xf4, 0x87, 0x54, 0xcb, 0xcb, 0xa4, 0xb7, 0xae, 0x9f, 0x74, 0x1a, 0x19,
|
||||
0x85, 0x3d, 0x9f, 0x0d, 0x03, 0x81, 0x93, 0x2b, 0x62, 0x06, 0x24, 0xcf, 0x85, 0x1a, 0x68, 0x54,
|
||||
0x52, 0x46, 0x2b, 0x10, 0x8c, 0xb4, 0xa2, 0xfc, 0x01, 0x46, 0xb1, 0x17, 0x6a, 0x6a, 0xe2, 0x85,
|
||||
0xb1, 0xc7, 0xb5, 0x52, 0xe2, 0xf1, 0xdd, 0xb5, 0x98, 0xab, 0x77, 0x6f, 0x9b, 0x85, 0xf6, 0x78,
|
||||
0x9f, 0x08, 0x52, 0xff, 0x92, 0x83, 0x95, 0x3d, 0xc7, 0xa1, 0x9c, 0xb7, 0x3c, 0x2e, 0xda, 0x63,
|
||||
0xf4, 0x18, 0xaa, 0x4e, 0x8f, 0x78, 0xc1, 0x89, 0xd7, 0x95, 0xe4, 0x95, 0xec, 0xdb, 0xbf, 0x54,
|
||||
0x6d, 0xf1, 0x4e, 0x7c, 0xfa, 0x68, 0xff, 0x32, 0x32, 0x8a, 0x4e, 0x62, 0x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0x43, 0x4e, 0xbb, 0x52, 0x63,
|
||||
0x05, 0x17, 0x5d, 0xc2, 0x1f, 0x70, 0xda, 0x4d, 0xaa, 0xdd, 0xf6, 0x60, 0xee, 0x98, 0xbb, 0xa8,
|
||||
0x03, 0xe1, 0x95, 0xb5, 0xf5, 0xff, 0xaa, 0x32, 0x96, 0xde, 0x55, 0x6d, 0x5e, 0x0b, 0x36, 0x7b,
|
||||
0xbe, 0x6d, 0x9f, 0x4d, 0x75, 0x70, 0x3e, 0xd5, 0xc1, 0xa7, 0xa9, 0x0e, 0x5e, 0x5c, 0xe8, 0x99,
|
||||
0xf3, 0x0b, 0x3d, 0xf3, 0xfe, 0x42, 0xcf, 0x3c, 0x6a, 0x5c, 0x69, 0x30, 0xd1, 0x23, 0x21, 0xf7,
|
||||
0xb8, 0xb5, 0xd8, 0xb6, 0x63, 0xb9, 0x6f, 0x65, 0x9b, 0x75, 0x0a, 0x72, 0x75, 0xee, 0x7c, 0x0d,
|
||||
0x00, 0x00, 0xff, 0xff, 0x19, 0x9b, 0x13, 0xd4, 0x12, 0x06, 0x00, 0x00,
|
||||
// 750 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x41, 0x6b, 0xdb, 0x48,
|
||||
0x14, 0xf6, 0xd8, 0xb2, 0x2d, 0x8f, 0xbd, 0x61, 0x19, 0xb2, 0x41, 0xf1, 0x82, 0x64, 0xbc, 0xec,
|
||||
0x62, 0x16, 0x2c, 0x91, 0x64, 0x4f, 0x39, 0x6d, 0xb4, 0x09, 0x21, 0x8b, 0xc3, 0x2e, 0xc2, 0xa5,
|
||||
0xd0, 0x1e, 0xc2, 0x58, 0x9e, 0xc8, 0xa2, 0x96, 0xc6, 0x68, 0xc6, 0xc2, 0xee, 0x2f, 0xe8, 0xad,
|
||||
0xfd, 0x09, 0x3d, 0xe7, 0xda, 0xfe, 0x88, 0x1c, 0x43, 0x4f, 0xa5, 0x07, 0xb5, 0x38, 0xb7, 0x1c,
|
||||
0x7b, 0xe9, 0xb5, 0xcc, 0x48, 0xb6, 0xe3, 0xb6, 0x2e, 0x29, 0xed, 0x49, 0xef, 0xe9, 0x7d, 0x33,
|
||||
0xef, 0xcd, 0xf7, 0xbd, 0xf7, 0xa0, 0x41, 0xf8, 0x80, 0x44, 0x81, 0x1f, 0x72, 0x8b, 0xc4, 0x81,
|
||||
0x15, 0xef, 0xe0, 0xe1, 0x68, 0x80, 0x77, 0x2c, 0x3e, 0x31, 0x47, 0x11, 0xe5, 0x14, 0x6d, 0x2d,
|
||||
0x00, 0x26, 0x89, 0x03, 0x73, 0x0e, 0xa8, 0x6f, 0x7a, 0xd4, 0xa3, 0x12, 0x62, 0x09, 0x2b, 0x45,
|
||||
0xd7, 0xb7, 0x3d, 0x4a, 0xbd, 0x21, 0xb1, 0xa4, 0xd7, 0x1b, 0x9f, 0x5b, 0x38, 0x9c, 0xce, 0x43,
|
||||
0x2e, 0x65, 0x01, 0x65, 0x67, 0xe9, 0x99, 0xd4, 0xc9, 0x42, 0x8d, 0x35, 0x45, 0x88, 0x84, 0x12,
|
||||
0xd1, 0x7c, 0x0a, 0xe0, 0x4f, 0xa7, 0xcc, 0x3b, 0x12, 0x38, 0x32, 0x0e, 0xba, 0x13, 0xd4, 0x82,
|
||||
0x4a, 0x1f, 0x73, 0xac, 0x81, 0x06, 0x68, 0x55, 0x77, 0x37, 0xcd, 0x34, 0xb1, 0x39, 0x4f, 0x6c,
|
||||
0x1e, 0x84, 0x53, 0x47, 0x22, 0xd0, 0x36, 0x54, 0x98, 0xff, 0x98, 0x68, 0xf9, 0x06, 0x68, 0x01,
|
||||
0xbb, 0x78, 0x93, 0x18, 0xa0, 0xed, 0xc8, 0x5f, 0xc8, 0x80, 0xca, 0x00, 0xb3, 0x81, 0x56, 0x68,
|
||||
0x80, 0x56, 0xc5, 0xae, 0xbe, 0x4f, 0x8c, 0x72, 0x34, 0x1c, 0xed, 0x37, 0xdb, 0x4d, 0x47, 0x06,
|
||||
0x10, 0x82, 0xca, 0x79, 0x44, 0x03, 0x4d, 0x11, 0x00, 0x47, 0xda, 0xfb, 0xca, 0x93, 0xe7, 0x46,
|
||||
0xae, 0xf9, 0x22, 0x0f, 0xd5, 0x0e, 0xf1, 0xb0, 0x3b, 0xed, 0x4e, 0xd0, 0x26, 0x2c, 0x86, 0x34,
|
||||
0x74, 0x89, 0xac, 0x46, 0x71, 0x52, 0x07, 0x1d, 0xc3, 0x8a, 0x87, 0xc5, 0x83, 0x7d, 0x37, 0xcd,
|
||||
0x5e, 0xb1, 0xff, 0x7c, 0x93, 0x18, 0x7f, 0x78, 0x3e, 0x1f, 0x8c, 0x7b, 0xa6, 0x4b, 0x83, 0x8c,
|
||||
0x86, 0xec, 0xd3, 0x66, 0xfd, 0x47, 0x16, 0x9f, 0x8e, 0x08, 0x33, 0x4f, 0x42, 0xee, 0xa8, 0x1e,
|
||||
0x66, 0xff, 0x8b, 0xb3, 0x48, 0x87, 0x05, 0x0f, 0x33, 0x59, 0xa5, 0x62, 0xd7, 0x66, 0x89, 0xa1,
|
||||
0x1e, 0x63, 0xd6, 0xf1, 0x03, 0x9f, 0x3b, 0x22, 0x80, 0x36, 0x60, 0x9e, 0xd3, 0xac, 0xc6, 0x3c,
|
||||
0xa7, 0xe8, 0x5f, 0x58, 0x8c, 0xf1, 0x70, 0x4c, 0xb4, 0xa2, 0x4c, 0xfa, 0xd7, 0xdd, 0x93, 0xce,
|
||||
0x12, 0xa3, 0x74, 0x10, 0xd0, 0x71, 0xc8, 0x9d, 0xf4, 0x0a, 0xc1, 0x80, 0xe4, 0xb9, 0xd4, 0x00,
|
||||
0xad, 0x5a, 0xc6, 0x68, 0x0d, 0x82, 0x58, 0x2b, 0xcb, 0x1f, 0x20, 0x16, 0x5e, 0xa4, 0xa9, 0xa9,
|
||||
0x17, 0x09, 0x8f, 0x69, 0x95, 0xd4, 0x63, 0xfb, 0x1b, 0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x74, 0xc8, 0x41, 0x06, 0xe9, 0x9c, 0xca, 0xd9, 0xb5, 0xa0,
|
||||
0x32, 0xa4, 0x1e, 0xd3, 0xf2, 0x92, 0x8a, 0x5f, 0xd7, 0x51, 0xd1, 0xa1, 0x9e, 0x23, 0x81, 0xe8,
|
||||
0x67, 0x58, 0x88, 0x08, 0x97, 0x2d, 0x51, 0x73, 0x84, 0x89, 0xb6, 0xa1, 0x1a, 0x07, 0x67, 0x24,
|
||||
0x8a, 0x68, 0x94, 0x8d, 0x57, 0x39, 0x0e, 0x8e, 0x84, 0x2b, 0x42, 0xa2, 0x8b, 0xc6, 0x8c, 0xf4,
|
||||
0xa5, 0xc4, 0x8a, 0x53, 0xf6, 0x30, 0xbb, 0xc7, 0x48, 0x3f, 0x2d, 0x76, 0xd7, 0x87, 0x85, 0x53,
|
||||
0xe6, 0xa1, 0x1e, 0x84, 0xb7, 0xb6, 0xd6, 0xef, 0xeb, 0xaa, 0x58, 0x79, 0x56, 0xbd, 0x7d, 0x27,
|
||||
0xd8, 0xfc, 0xf5, 0xb6, 0x7d, 0x39, 0xd3, 0xc1, 0xd5, 0x4c, 0x07, 0xef, 0x66, 0x3a, 0x78, 0x76,
|
||||
0xad, 0xe7, 0xae, 0xae, 0xf5, 0xdc, 0xeb, 0x6b, 0x3d, 0xf7, 0xa0, 0x75, 0xab, 0xbf, 0xf8, 0x00,
|
||||
0x47, 0xcc, 0x67, 0xd6, 0x72, 0xd9, 0x4e, 0xe4, 0xba, 0x95, 0x5d, 0xd6, 0x2b, 0xc9, 0xcd, 0xb9,
|
||||
0xf7, 0x31, 0x00, 0x00, 0xff, 0xff, 0x32, 0x13, 0x74, 0x7d, 0x11, 0x06, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -793,15 +793,12 @@ func (m *MsgEthereumTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if m.Reverted {
|
||||
if len(m.VmError) > 0 {
|
||||
i -= len(m.VmError)
|
||||
copy(dAtA[i:], m.VmError)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.VmError)))
|
||||
i--
|
||||
if m.Reverted {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x20
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Ret) > 0 {
|
||||
i -= len(m.Ret)
|
||||
@@ -1003,8 +1000,9 @@ func (m *MsgEthereumTxResponse) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if m.Reverted {
|
||||
n += 2
|
||||
l = len(m.VmError)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if m.GasUsed != 0 {
|
||||
n += 1 + sovTx(uint64(m.GasUsed))
|
||||
@@ -2135,10 +2133,10 @@ func (m *MsgEthereumTxResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Reverted", wireType)
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field VmError", wireType)
|
||||
}
|
||||
var v int
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
@@ -2148,12 +2146,24 @@ func (m *MsgEthereumTxResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int(b&0x7F) << shift
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.Reverted = bool(v != 0)
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.VmError = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType)
|
||||
|
||||
Reference in new issue
Block a user