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:
parent
9d1ce30ecd
commit
297a35dbdd
@ -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
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
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"
|
||||
|
6
x/evm/types/tx.go
Normal file
6
x/evm/types/tx.go
Normal file
@ -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
|
||||
}
|
@ -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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c7, 0x68, 0x1d, 0xe6, 0x03, 0x16, 0x38,
|
||||
0x54, 0x56, 0xa3, 0xe0, 0xc4, 0x41, 0x87, 0xb0, 0xe4, 0x92, 0xf8, 0xc1, 0x9e, 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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0x9b, 0xa8, 0x0a, 0xd5, 0x90, 0x8e, 0x68, 0x28, 0x68,
|
||||
0x57, 0xca, 0xac, 0xe2, 0xb9, 0x8f, 0x36, 0x61, 0xdc, 0x09, 0x27, 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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xad, 0x4f, 0x31, 0xf7, 0x49, 0x6f, 0x6f, 0x11, 0xbf, 0x00, 0xf0, 0x97, 0x95, 0x2d,
|
||||
0xe0, 0x10, 0x36, 0xa2, 0x21, 0x93, 0x74, 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)
|
||||
|
Loading…
Reference in New Issue
Block a user