evm: dynamic fee tx (#384)

* evm: dynamic fee tx

* proto message

* fix

* lint
This commit is contained in:
Federico Kunze Küllmer
2021-07-30 11:40:17 +00:00
committed by GitHub
parent c4aa8fafab
commit 9b9c835266
14 changed files with 1242 additions and 123 deletions
+10
View File
@@ -98,6 +98,16 @@ func (tx *AccessListTx) GetGasPrice() *big.Int {
return tx.GasPrice.BigInt()
}
// GetGasTipCap returns the gas price field.
func (tx *AccessListTx) GetGasTipCap() *big.Int {
return tx.GetGasPrice()
}
// GetGasFeeCap returns the gas price field.
func (tx *AccessListTx) GetGasFeeCap() *big.Int {
return tx.GetGasPrice()
}
// GetValue returns the tx amount.
func (tx *AccessListTx) GetValue() *big.Int {
if tx.Amount == nil {
+1
View File
@@ -37,6 +37,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterInterface(
"ethermint.evm.v1alpha1.TxData",
(*TxData)(nil),
&DynamicFeeTx{},
&AccessListTx{},
&LegacyTx{},
)
+245
View File
@@ -0,0 +1,245 @@
package types
import (
"math/big"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/tharsis/ethermint/types"
)
// nolint: deadcode, unused
func newDynamicFeeTx(tx *ethtypes.Transaction) *DynamicFeeTx {
txData := &DynamicFeeTx{
Nonce: tx.Nonce(),
Data: tx.Data(),
GasLimit: tx.Gas(),
}
v, r, s := tx.RawSignatureValues()
if tx.To() != nil {
txData.To = tx.To().Hex()
}
if tx.Value() != nil {
amountInt := sdk.NewIntFromBigInt(tx.Value())
txData.Amount = &amountInt
}
// TODO:
// if tx.GasFeeCap() != nil {
// gasFeeCapInt := sdk.NewIntFromBigInt(tx.GasFeeCap())
// txData.GasFeeCap = &gasFeeCapInt
// }
// if tx.GasTipCap() != nil {
// gasTipCapInt := sdk.NewIntFromBigInt(tx.GasTipCap())
// txData.GasTipCap = &gasTipCapInt
// }
if tx.AccessList() != nil {
al := tx.AccessList()
txData.Accesses = NewAccessList(&al)
}
txData.SetSignatureValues(tx.ChainId(), v, r, s)
return txData
}
// TxType returns the tx type
func (tx *DynamicFeeTx) TxType() uint8 {
// TODO
return 0
// return ethtypes.DynamicFeeTxType
}
// Copy returns an instance with the same field values
func (tx *DynamicFeeTx) Copy() TxData {
return &DynamicFeeTx{
ChainID: tx.ChainID,
Nonce: tx.Nonce,
GasTipCap: tx.GasTipCap,
GasFeeCap: tx.GasFeeCap,
GasLimit: tx.GasLimit,
To: tx.To,
Amount: tx.Amount,
Data: common.CopyBytes(tx.Data),
Accesses: tx.Accesses,
V: common.CopyBytes(tx.V),
R: common.CopyBytes(tx.R),
S: common.CopyBytes(tx.S),
}
}
// GetChainID returns the chain id field from the DynamicFeeTx
func (tx *DynamicFeeTx) GetChainID() *big.Int {
if tx.ChainID == nil {
return nil
}
return tx.ChainID.BigInt()
}
// GetAccessList returns the AccessList field.
func (tx *DynamicFeeTx) GetAccessList() ethtypes.AccessList {
if tx.Accesses == nil {
return nil
}
return *tx.Accesses.ToEthAccessList()
}
// GetData returns the a copy of the input data bytes.
func (tx *DynamicFeeTx) GetData() []byte {
return common.CopyBytes(tx.Data)
}
// GetGas returns the gas limit.
func (tx *DynamicFeeTx) GetGas() uint64 {
return tx.GasLimit
}
// GetGasPrice returns the gas fee cap field.
func (tx *DynamicFeeTx) GetGasPrice() *big.Int {
return tx.GetGasFeeCap()
}
// GetGasTipCap returns the gas price field.
func (tx *DynamicFeeTx) GetGasTipCap() *big.Int {
if tx.GasTipCap == nil {
return nil
}
return tx.GasTipCap.BigInt()
}
// GetGasFeeCap returns the gas price field.
func (tx *DynamicFeeTx) GetGasFeeCap() *big.Int {
if tx.GasFeeCap == nil {
return nil
}
return tx.GasFeeCap.BigInt()
}
// GetValue returns the tx amount.
func (tx *DynamicFeeTx) GetValue() *big.Int {
if tx.Amount == nil {
return nil
}
return tx.Amount.BigInt()
}
// GetNonce returns the account sequence for the transaction.
func (tx *DynamicFeeTx) GetNonce() uint64 { return tx.Nonce }
// GetTo returns the pointer to the recipient address.
func (tx *DynamicFeeTx) GetTo() *common.Address {
if tx.To == "" {
return nil
}
to := common.HexToAddress(tx.To)
return &to
}
// AsEthereumData returns an DynamicFeeTx transaction tx from the proto-formatted
// TxData defined on the Cosmos EVM.
func (tx *DynamicFeeTx) AsEthereumData() ethtypes.TxData {
return nil
// TODO:
// v, r, s := tx.GetRawSignatureValues()
// return &ethtypes.DynamicFeeTx{
// ChainID: tx.GetChainID(),
// Nonce: tx.GetNonce(),
// GasTipCap: tx.GetGasTipCap(),
// GasFeeCap: tx.GetGasFeeCap(),
// Gas: tx.GetGas(),
// To: tx.GetTo(),
// Value: tx.GetValue(),
// Data: tx.GetData(),
// AccessList: tx.GetAccessList(),
// V: v,
// R: r,
// S: s,
// }
}
// GetRawSignatureValues returns the V, R, S signature values of the transaction.
// The return values should not be modified by the caller.
func (tx *DynamicFeeTx) GetRawSignatureValues() (v, r, s *big.Int) {
return rawSignatureValues(tx.V, tx.R, tx.S)
}
// SetSignatureValues sets the signature values to the transaction.
func (tx *DynamicFeeTx) SetSignatureValues(chainID, v, r, s *big.Int) {
if v != nil {
tx.V = v.Bytes()
}
if r != nil {
tx.R = r.Bytes()
}
if s != nil {
tx.S = s.Bytes()
}
if chainID != nil {
chainIDInt := sdk.NewIntFromBigInt(chainID)
tx.ChainID = &chainIDInt
}
}
// Validate performs a stateless validation of the tx fields.
func (tx DynamicFeeTx) Validate() error {
if tx.GasTipCap == nil {
return sdkerrors.Wrap(ErrInvalidGasCap, "gas tip cap cannot nil")
}
if tx.GasFeeCap == nil {
return sdkerrors.Wrap(ErrInvalidGasCap, "gas fee cap cannot nil")
}
if tx.GasTipCap.IsNegative() {
return sdkerrors.Wrapf(ErrInvalidGasCap, "gas tip cap cannot be negative %s", tx.GasTipCap)
}
if tx.GasFeeCap.IsNegative() {
return sdkerrors.Wrapf(ErrInvalidGasCap, "gas fee cap cannot be negative %s", tx.GasFeeCap)
}
if tx.GasFeeCap.LT(*tx.GasTipCap) {
return sdkerrors.Wrapf(
ErrInvalidGasCap, "max priority fee per gas higher than max fee per gas (%s > %s)",
tx.GasTipCap, tx.GasFeeCap,
)
}
amount := tx.GetValue()
// Amount can be 0
if amount != nil && amount.Sign() == -1 {
return sdkerrors.Wrapf(ErrInvalidAmount, "amount cannot be negative %s", amount)
}
if tx.To != "" {
if err := types.ValidateAddress(tx.To); err != nil {
return sdkerrors.Wrap(err, "invalid to address")
}
}
if tx.GetChainID() == nil {
return sdkerrors.Wrap(
sdkerrors.ErrInvalidChainID,
"chain ID must be present on AccessList txs",
)
}
return nil
}
// Fee panics as it requires the base fee amount to calculate
func (tx DynamicFeeTx) Fee() *big.Int {
panic("fee can only be called manually by providing the base fee")
}
// Cost returns amount + gasprice * gaslimit.
func (tx DynamicFeeTx) Cost() *big.Int {
panic("cost can only be called manually by providing the base fee")
}
+8
View File
@@ -28,6 +28,8 @@ const (
codeErrVMExecution
codeErrInvalidRefund
codeErrInconsistentGas
codeErrInvalidGasCap
codeErrInvalidBaseFee
)
var (
@@ -75,6 +77,12 @@ var (
// ErrInconsistentGas returns an error if a the gas differs from the expected one.
ErrInconsistentGas = sdkerrors.Register(ModuleName, codeErrInconsistentGas, "inconsistent gas")
// ErrInvalidGasCap returns an error if a the gas cap value is negative or invalid
ErrInvalidGasCap = sdkerrors.Register(ModuleName, codeErrInvalidGasCap, "invalid gas cap")
// ErrInvalidBaseFee returns an error if a the base fee cap value is invalid
ErrInvalidBaseFee = sdkerrors.Register(ModuleName, codeErrInvalidBaseFee, "invalid base fee")
)
// NewExecErrorWithReason unpacks the revert return bytes and returns a wrapped error
+10
View File
@@ -85,6 +85,16 @@ func (tx *LegacyTx) GetGasPrice() *big.Int {
return tx.GasPrice.BigInt()
}
// GetGasTipCap returns the gas price field.
func (tx *LegacyTx) GetGasTipCap() *big.Int {
return tx.GetGasPrice()
}
// GetGasFeeCap returns the gas price field.
func (tx *LegacyTx) GetGasFeeCap() *big.Int {
return tx.GetGasPrice()
}
// GetValue returns the tx amount.
func (tx *LegacyTx) GetValue() *big.Int {
if tx.Amount == nil {
+14 -8
View File
@@ -133,7 +133,8 @@ func (m *QueryAccountResponse) GetNonce() uint64 {
return 0
}
// QueryCosmosAccountRequest is the request type for the Query/CosmosAccount RPC method.
// QueryCosmosAccountRequest is the request type for the Query/CosmosAccount RPC
// method.
type QueryCosmosAccountRequest struct {
// address is the ethereum hex address to query the account for.
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
@@ -172,7 +173,8 @@ func (m *QueryCosmosAccountRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryCosmosAccountRequest proto.InternalMessageInfo
// QueryCosmosAccountResponse is the response type for the Query/CosmosAccount RPC method.
// QueryCosmosAccountResponse is the response type for the Query/CosmosAccount
// RPC method.
type QueryCosmosAccountResponse struct {
// cosmos_address is the cosmos address of the account.
CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty"`
@@ -236,7 +238,8 @@ func (m *QueryCosmosAccountResponse) GetAccountNumber() uint64 {
return 0
}
// QueryValidatorAccountRequest is the request type for the Query/ValidatorAccount RPC method.
// QueryValidatorAccountRequest is the request type for the
// Query/ValidatorAccount RPC method.
type QueryValidatorAccountRequest struct {
// cons_address is the validator cons address to query the account for.
ConsAddress string `protobuf:"bytes,1,opt,name=cons_address,json=consAddress,proto3" json:"cons_address,omitempty"`
@@ -275,7 +278,8 @@ func (m *QueryValidatorAccountRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryValidatorAccountRequest proto.InternalMessageInfo
// QueryValidatorAccountResponse is the response type for the Query/ValidatorAccount RPC method.
// QueryValidatorAccountResponse is the response type for the
// Query/ValidatorAccount RPC method.
type QueryValidatorAccountResponse struct {
// account_address is the cosmos address of the account in bech32 format.
AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"`
@@ -784,8 +788,8 @@ func (m *QueryBlockLogsResponse) GetPagination() *query.PageResponse {
type QueryBlockBloomRequest struct {
// height of the block which we want to query the bloom filter.
// Tendermint always replace the query request header by the current context
// header, height cannot be extracted from there, so we need to explicitly pass
// it in parameter.
// header, height cannot be extracted from there, so we need to explicitly
// pass it in parameter.
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
}
@@ -1290,7 +1294,8 @@ type QueryClient interface {
Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error)
// CosmosAccount queries an Ethereum account's Cosmos Address.
CosmosAccount(ctx context.Context, in *QueryCosmosAccountRequest, opts ...grpc.CallOption) (*QueryCosmosAccountResponse, error)
// ValidatorAccount queries an Ethereum account's from a validator consensus Address.
// ValidatorAccount queries an Ethereum account's from a validator consensus
// Address.
ValidatorAccount(ctx context.Context, in *QueryValidatorAccountRequest, opts ...grpc.CallOption) (*QueryValidatorAccountResponse, error)
// Balance queries the balance of a the EVM denomination for a single
// EthAccount.
@@ -1446,7 +1451,8 @@ type QueryServer interface {
Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error)
// CosmosAccount queries an Ethereum account's Cosmos Address.
CosmosAccount(context.Context, *QueryCosmosAccountRequest) (*QueryCosmosAccountResponse, error)
// ValidatorAccount queries an Ethereum account's from a validator consensus Address.
// ValidatorAccount queries an Ethereum account's from a validator consensus
// Address.
ValidatorAccount(context.Context, *QueryValidatorAccountRequest) (*QueryValidatorAccountResponse, error)
// Balance queries the balance of a the EVM denomination for a single
// EthAccount.
+746 -57
View File
@@ -40,9 +40,9 @@ type MsgEthereumTx struct {
Size_ float64 `protobuf:"fixed64,2,opt,name=size,proto3" json:"-"`
// transaction hash in hex format
Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty" rlp:"-"`
// ethereum signer address in hex format. This address value is checked against
// the address derived from the signature (V, R, S) using the secp256k1
// elliptic curve
// ethereum signer address in hex format. This address value is checked
// against the address derived from the signature (V, R, S) using the
// secp256k1 elliptic curve
From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
}
@@ -192,6 +192,66 @@ func (m *AccessListTx) XXX_DiscardUnknown() {
var xxx_messageInfo_AccessListTx proto.InternalMessageInfo
// DynamicFeeTx is the data of EIP-1559 dinamic fee transactions.
type DynamicFeeTx struct {
// destination EVM chain ID
ChainID *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"chainID"`
// nonce corresponds to the account nonce (transaction sequence).
Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
// gas tip cap defines the max value for the gas tip
GasTipCap *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=gas_tip_cap,json=gasTipCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_tip_cap,omitempty"`
// gas fee cap defines the max value for the gas fee
GasFeeCap *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=gas_fee_cap,json=gasFeeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_fee_cap,omitempty"`
// gas defines the gas limit defined for the transaction.
GasLimit uint64 `protobuf:"varint,5,opt,name=gas,proto3" json:"gas,omitempty"`
// hex formatted address of the recipient
To string `protobuf:"bytes,6,opt,name=to,proto3" json:"to,omitempty"`
// value defines the the transaction amount.
Amount *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=value,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"value,omitempty"`
// input defines the data payload bytes of the transaction.
Data []byte `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"`
Accesses AccessList `protobuf:"bytes,9,rep,name=accesses,proto3,castrepeated=AccessList" json:"accessList"`
// v defines the signature value
V []byte `protobuf:"bytes,10,opt,name=v,proto3" json:"v,omitempty"`
// r defines the signature value
R []byte `protobuf:"bytes,11,opt,name=r,proto3" json:"r,omitempty"`
// s define the signature value
S []byte `protobuf:"bytes,12,opt,name=s,proto3" json:"s,omitempty"`
}
func (m *DynamicFeeTx) Reset() { *m = DynamicFeeTx{} }
func (m *DynamicFeeTx) String() string { return proto.CompactTextString(m) }
func (*DynamicFeeTx) ProtoMessage() {}
func (*DynamicFeeTx) Descriptor() ([]byte, []int) {
return fileDescriptor_6a305e80b084ab0e, []int{3}
}
func (m *DynamicFeeTx) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *DynamicFeeTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_DynamicFeeTx.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *DynamicFeeTx) XXX_Merge(src proto.Message) {
xxx_messageInfo_DynamicFeeTx.Merge(m, src)
}
func (m *DynamicFeeTx) XXX_Size() int {
return m.Size()
}
func (m *DynamicFeeTx) XXX_DiscardUnknown() {
xxx_messageInfo_DynamicFeeTx.DiscardUnknown(m)
}
var xxx_messageInfo_DynamicFeeTx proto.InternalMessageInfo
type ExtensionOptionsEthereumTx struct {
}
@@ -199,7 +259,7 @@ func (m *ExtensionOptionsEthereumTx) Reset() { *m = ExtensionOptionsEthe
func (m *ExtensionOptionsEthereumTx) String() string { return proto.CompactTextString(m) }
func (*ExtensionOptionsEthereumTx) ProtoMessage() {}
func (*ExtensionOptionsEthereumTx) Descriptor() ([]byte, []int) {
return fileDescriptor_6a305e80b084ab0e, []int{3}
return fileDescriptor_6a305e80b084ab0e, []int{4}
}
func (m *ExtensionOptionsEthereumTx) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -235,7 +295,7 @@ func (m *ExtensionOptionsWeb3Tx) Reset() { *m = ExtensionOptionsWeb3Tx{}
func (m *ExtensionOptionsWeb3Tx) String() string { return proto.CompactTextString(m) }
func (*ExtensionOptionsWeb3Tx) ProtoMessage() {}
func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int) {
return fileDescriptor_6a305e80b084ab0e, []int{4}
return fileDescriptor_6a305e80b084ab0e, []int{5}
}
func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -266,13 +326,15 @@ var xxx_messageInfo_ExtensionOptionsWeb3Tx proto.InternalMessageInfo
// MsgEthereumTxResponse defines the Msg/EthereumTx response type.
type MsgEthereumTxResponse struct {
// 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
// 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
Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
// logs contains the transaction hash and the proto-compatible ethereum
// logs.
Logs []*Log `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"`
// returned data from evm function (result or data supplied with revert opcode)
// returned data from evm function (result or data supplied with revert
// opcode)
Ret []byte `protobuf:"bytes,3,opt,name=ret,proto3" json:"ret,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"`
@@ -284,7 +346,7 @@ func (m *MsgEthereumTxResponse) Reset() { *m = MsgEthereumTxResponse{} }
func (m *MsgEthereumTxResponse) String() string { return proto.CompactTextString(m) }
func (*MsgEthereumTxResponse) ProtoMessage() {}
func (*MsgEthereumTxResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_6a305e80b084ab0e, []int{5}
return fileDescriptor_6a305e80b084ab0e, []int{6}
}
func (m *MsgEthereumTxResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -317,6 +379,7 @@ func init() {
proto.RegisterType((*MsgEthereumTx)(nil), "ethermint.evm.v1alpha1.MsgEthereumTx")
proto.RegisterType((*LegacyTx)(nil), "ethermint.evm.v1alpha1.LegacyTx")
proto.RegisterType((*AccessListTx)(nil), "ethermint.evm.v1alpha1.AccessListTx")
proto.RegisterType((*DynamicFeeTx)(nil), "ethermint.evm.v1alpha1.DynamicFeeTx")
proto.RegisterType((*ExtensionOptionsEthereumTx)(nil), "ethermint.evm.v1alpha1.ExtensionOptionsEthereumTx")
proto.RegisterType((*ExtensionOptionsWeb3Tx)(nil), "ethermint.evm.v1alpha1.ExtensionOptionsWeb3Tx")
proto.RegisterType((*MsgEthereumTxResponse)(nil), "ethermint.evm.v1alpha1.MsgEthereumTxResponse")
@@ -325,54 +388,59 @@ func init() {
func init() { proto.RegisterFile("ethermint/evm/v1alpha1/tx.proto", fileDescriptor_6a305e80b084ab0e) }
var fileDescriptor_6a305e80b084ab0e = []byte{
// 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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, 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,
// 829 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4d, 0x6f, 0xf3, 0x44,
0x10, 0x8e, 0x13, 0x27, 0x76, 0x36, 0xe1, 0x15, 0xb2, 0xca, 0x2b, 0x37, 0x48, 0x76, 0x14, 0x04,
0x8a, 0x90, 0x62, 0xab, 0x2d, 0xa7, 0x9e, 0xa8, 0xfb, 0xa5, 0x56, 0xa9, 0x40, 0x56, 0x10, 0x12,
0x1c, 0xa2, 0x8d, 0xb3, 0x75, 0x56, 0xc4, 0x5e, 0xcb, 0xbb, 0xb1, 0x12, 0x7e, 0x01, 0x37, 0xf8,
0x09, 0x9c, 0x7b, 0x85, 0xdf, 0x80, 0x7a, 0xac, 0x38, 0x21, 0x0e, 0x06, 0xa5, 0xb7, 0x1e, 0xb9,
0x70, 0x45, 0xbb, 0x76, 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36, 0x5a, 0x08, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -722,6 +790,136 @@ func (m *AccessListTx) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *DynamicFeeTx) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *DynamicFeeTx) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DynamicFeeTx) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.S) > 0 {
i -= len(m.S)
copy(dAtA[i:], m.S)
i = encodeVarintTx(dAtA, i, uint64(len(m.S)))
i--
dAtA[i] = 0x62
}
if len(m.R) > 0 {
i -= len(m.R)
copy(dAtA[i:], m.R)
i = encodeVarintTx(dAtA, i, uint64(len(m.R)))
i--
dAtA[i] = 0x5a
}
if len(m.V) > 0 {
i -= len(m.V)
copy(dAtA[i:], m.V)
i = encodeVarintTx(dAtA, i, uint64(len(m.V)))
i--
dAtA[i] = 0x52
}
if len(m.Accesses) > 0 {
for iNdEx := len(m.Accesses) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Accesses[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintTx(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x4a
}
}
if len(m.Data) > 0 {
i -= len(m.Data)
copy(dAtA[i:], m.Data)
i = encodeVarintTx(dAtA, i, uint64(len(m.Data)))
i--
dAtA[i] = 0x42
}
if m.Amount != nil {
{
size := m.Amount.Size()
i -= size
if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil {
return 0, err
}
i = encodeVarintTx(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x3a
}
if len(m.To) > 0 {
i -= len(m.To)
copy(dAtA[i:], m.To)
i = encodeVarintTx(dAtA, i, uint64(len(m.To)))
i--
dAtA[i] = 0x32
}
if m.GasLimit != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.GasLimit))
i--
dAtA[i] = 0x28
}
if m.GasFeeCap != nil {
{
size := m.GasFeeCap.Size()
i -= size
if _, err := m.GasFeeCap.MarshalTo(dAtA[i:]); err != nil {
return 0, err
}
i = encodeVarintTx(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x22
}
if m.GasTipCap != nil {
{
size := m.GasTipCap.Size()
i -= size
if _, err := m.GasTipCap.MarshalTo(dAtA[i:]); err != nil {
return 0, err
}
i = encodeVarintTx(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
if m.Nonce != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.Nonce))
i--
dAtA[i] = 0x10
}
if m.ChainID != nil {
{
size := m.ChainID.Size()
i -= size
if _, err := m.ChainID.MarshalTo(dAtA[i:]); err != nil {
return 0, err
}
i = encodeVarintTx(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *ExtensionOptionsEthereumTx) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -962,6 +1160,63 @@ func (m *AccessListTx) Size() (n int) {
return n
}
func (m *DynamicFeeTx) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.ChainID != nil {
l = m.ChainID.Size()
n += 1 + l + sovTx(uint64(l))
}
if m.Nonce != 0 {
n += 1 + sovTx(uint64(m.Nonce))
}
if m.GasTipCap != nil {
l = m.GasTipCap.Size()
n += 1 + l + sovTx(uint64(l))
}
if m.GasFeeCap != nil {
l = m.GasFeeCap.Size()
n += 1 + l + sovTx(uint64(l))
}
if m.GasLimit != 0 {
n += 1 + sovTx(uint64(m.GasLimit))
}
l = len(m.To)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
if m.Amount != nil {
l = m.Amount.Size()
n += 1 + l + sovTx(uint64(l))
}
l = len(m.Data)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
if len(m.Accesses) > 0 {
for _, e := range m.Accesses {
l = e.Size()
n += 1 + l + sovTx(uint64(l))
}
}
l = len(m.V)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.R)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.S)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
return n
}
func (m *ExtensionOptionsEthereumTx) Size() (n int) {
if m == nil {
return 0
@@ -1903,6 +2158,440 @@ func (m *AccessListTx) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *DynamicFeeTx) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: DynamicFeeTx: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: DynamicFeeTx: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var v github_com_cosmos_cosmos_sdk_types.Int
m.ChainID = &v
if err := m.ChainID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType)
}
m.Nonce = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Nonce |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field GasTipCap", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var v github_com_cosmos_cosmos_sdk_types.Int
m.GasTipCap = &v
if err := m.GasTipCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field GasFeeCap", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var v github_com_cosmos_cosmos_sdk_types.Int
m.GasFeeCap = &v
if err := m.GasFeeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType)
}
m.GasLimit = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.GasLimit |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.To = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var v github_com_cosmos_cosmos_sdk_types.Int
m.Amount = &v
if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 8:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
if m.Data == nil {
m.Data = []byte{}
}
iNdEx = postIndex
case 9:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Accesses", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Accesses = append(m.Accesses, AccessTuple{})
if err := m.Accesses[len(m.Accesses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 10:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field V", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.V = append(m.V[:0], dAtA[iNdEx:postIndex]...)
if m.V == nil {
m.V = []byte{}
}
iNdEx = postIndex
case 11:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field R", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.R = append(m.R[:0], dAtA[iNdEx:postIndex]...)
if m.R == nil {
m.R = []byte{}
}
iNdEx = postIndex
case 12:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field S", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.S = append(m.S[:0], dAtA[iNdEx:postIndex]...)
if m.S == nil {
m.S = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ExtensionOptionsEthereumTx) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
+9 -1
View File
@@ -7,7 +7,11 @@ import (
ethtypes "github.com/ethereum/go-ethereum/core/types"
)
var _ TxData = &AccessListTx{}
var (
_ TxData = &LegacyTx{}
_ TxData = &AccessListTx{}
_ TxData = &DynamicFeeTx{}
)
// TxData implements the Ethereum transaction tx structure. It is used
// solely as intended in Ethereum abiding by the protocol.
@@ -22,6 +26,8 @@ type TxData interface {
GetNonce() uint64
GetGas() uint64
GetGasPrice() *big.Int
GetGasTipCap() *big.Int
GetGasFeeCap() *big.Int
GetValue() *big.Int
GetTo() *common.Address
@@ -37,6 +43,8 @@ type TxData interface {
func NewTxDataFromTx(tx *ethtypes.Transaction) TxData {
var txData TxData
switch tx.Type() {
// case ethtypes.DynamicFeeTxType:
// txData = newDynamicFeeTx(tx)
case ethtypes.AccessListTxType:
txData = newAccessListTx(tx)
default: