diff --git a/pkg/relay/ethereum/chain.go b/pkg/relay/ethereum/chain.go index d14cc29..f1e20ca 100644 --- a/pkg/relay/ethereum/chain.go +++ b/pkg/relay/ethereum/chain.go @@ -47,12 +47,12 @@ type Chain struct { ibcHandler *ibchandler.Ibchandler multicall3 *multicall3.Multicall3 + txMaxSize uint64 + ethereumSigner EthereumSigner errorRepository ErrorRepository - txMaxSize uint64 - // cache connectionOpenedConfirmed bool allowLCFunctions *AllowLCFunctions @@ -61,6 +61,8 @@ type Chain struct { var _ core.Chain = (*Chain)(nil) func NewChain(config ChainConfig) (*Chain, error) { + logger := GetModuleLogger() + id := big.NewInt(int64(config.EthChainId)) client, err := client.NewETHClient( config.RpcAddr, @@ -107,6 +109,11 @@ func NewChain(config ChainConfig) (*Chain, error) { if err != nil { return nil, fmt.Errorf("failed to create error repository: %v", err) } + txMaxSize := config.GetTxMaxSize() + if txMaxSize == 0 { + txMaxSize = 128 * 1024 // go-ethereum/core/txpool/legacypool/legacypool.go + logger.Info(fmt.Sprintf("txMaxSize is zero. set to %v", txMaxSize)); + } return &Chain{ config: config, @@ -120,7 +127,7 @@ func NewChain(config ChainConfig) (*Chain, error) { errorRepository: errorRepository, - txMaxSize: 1024 * 128, // go-ethereum/core/txpool/legacypool/legacypool.go + txMaxSize: txMaxSize, allowLCFunctions: alfs, }, nil diff --git a/pkg/relay/ethereum/config.pb.go b/pkg/relay/ethereum/config.pb.go index 6389ec0..ac4dffe 100644 --- a/pkg/relay/ethereum/config.pb.go +++ b/pkg/relay/ethereum/config.pb.go @@ -46,6 +46,9 @@ type ChainConfig struct { BlocksPerEventQuery uint64 `protobuf:"varint,16,opt,name=blocks_per_event_query,json=blocksPerEventQuery,proto3" json:"blocks_per_event_query,omitempty"` AbiPaths []string `protobuf:"bytes,17,rep,name=abi_paths,json=abiPaths,proto3" json:"abi_paths,omitempty"` Multicall3Address string `protobuf:"bytes,18,opt,name=multicall3_address,json=multicall3Address,proto3" json:"multicall3_address,omitempty"` + // Types that are valid to be assigned to XTxMaxSize: + // *ChainConfig_TxMaxSize + XTxMaxSize isChainConfig_XTxMaxSize `protobuf_oneof:"_tx_max_size"` } func (m *ChainConfig) Reset() { *m = ChainConfig{} } @@ -81,6 +84,39 @@ func (m *ChainConfig) XXX_DiscardUnknown() { var xxx_messageInfo_ChainConfig proto.InternalMessageInfo +type isChainConfig_XTxMaxSize interface { + isChainConfig_XTxMaxSize() + MarshalTo([]byte) (int, error) + Size() int +} + +type ChainConfig_TxMaxSize struct { + TxMaxSize uint64 `protobuf:"varint,19,opt,name=tx_max_size,json=txMaxSize,proto3,oneof" json:"tx_max_size,omitempty"` +} + +func (*ChainConfig_TxMaxSize) isChainConfig_XTxMaxSize() {} + +func (m *ChainConfig) GetXTxMaxSize() isChainConfig_XTxMaxSize { + if m != nil { + return m.XTxMaxSize + } + return nil +} + +func (m *ChainConfig) GetTxMaxSize() uint64 { + if x, ok := m.GetXTxMaxSize().(*ChainConfig_TxMaxSize); ok { + return x.TxMaxSize + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ChainConfig) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ChainConfig_TxMaxSize)(nil), + } +} + type AllowLCFunctionsConfig struct { LcAddress string `protobuf:"bytes,1,opt,name=lc_address,json=lcAddress,proto3" json:"lc_address,omitempty"` AllowAll bool `protobuf:"varint,2,opt,name=allow_all,json=allowAll,proto3" json:"allow_all,omitempty"` @@ -212,64 +248,66 @@ func init() { } var fileDescriptor_a8a57ab2f9f14837 = []byte{ - // 902 bytes of a gzipped FileDescriptorProto + // 938 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcd, 0x6e, 0x1b, 0x37, - 0x10, 0xb6, 0x62, 0xd7, 0x96, 0xa8, 0x38, 0xb1, 0x59, 0xff, 0xac, 0xdd, 0x46, 0x15, 0x7c, 0x52, - 0xd1, 0x78, 0x05,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c0, + 0xbc, 0x80, 0x73, 0xb2, 0x9e, 0x70, 0x07, 0xf3, 0xe4, 0x2b, 0x9f, 0x99, 0xbc, 0x19, 0xe4, 0xd3, + 0xc4, 0x27, 0xe4, 0x51, 0x30, 0x1a, 0x4a, 0xe7, 0x8d, 0x2d, 0x99, 0x85, 0xb7, 0xdc, 0xa6, 0xa1, + 0x02, 0x01, 0xda, 0x4b, 0x05, 0xb8, 0x36, 0xd7, 0xe3, 0x83, 0x01, 0xc0, 0xcb, 0x8a, 0x13, 0x23, + 0xe5, 0x62, 0xc6, 0xa0, 0x3f, 0x90, 0xfd, 0xbb, 0x1b, 0x67, 0xc1, 0x10, 0x17, 0xe9, 0x7a, 0xbc, + 0xb3, 0xb0, 0x73, 0xce, 0x66, 0x4e, 0xa7, 0xfc, 0xfd, 0x3f, 0xad, 0xa5, 0xf7, 0x37, 0xad, 0xda, + 0x87, 0x9b, 0x56, 0xed, 0xef, 0x9b, 0x56, 0xed, 0xf7, 0xdb, 0xd6, 0xd2, 0x87, 0xdb, 0xd6, 0xd2, + 0x5f, 0xb7, 0xad, 0xa5, 0x5f, 0xfa, 0x99, 0xf4, 0xc3, 0x51, 0xd2, 0x15, 0x26, 0xef, 0xa5, 0xdc, + 0x73, 0xec, 0x4b, 0xf1, 0x64, 0xf6, 0x71, 0x3b, 0x92, 0x89, 0x38, 0xc2, 0xae, 0x8f, 0x10, 0xeb, + 0x15, 0x57, 0x59, 0x0f, 0xcf, 0x33, 0x4a, 0xb2, 0x8a, 0x9f, 0x86, 0xe3, 0x7f, 0x03, 0x00, 0x00, + 0xff, 0xff, 0x26, 0xd4, 0x7a, 0xa3, 0x21, 0x07, 0x00, 0x00, } func (m *ChainConfig) Marshal() (dAtA []byte, err error) { @@ -292,6 +330,15 @@ func (m *ChainConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.XTxMaxSize != nil { + { + size := m.XTxMaxSize.Size() + i -= size + if _, err := m.XTxMaxSize.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } if len(m.Multicall3Address) > 0 { i -= len(m.Multicall3Address) copy(dAtA[i:], m.Multicall3Address) @@ -438,6 +485,20 @@ func (m *ChainConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ChainConfig_TxMaxSize) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainConfig_TxMaxSize) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintConfig(dAtA, i, uint64(m.TxMaxSize)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + return len(dAtA) - i, nil +} func (m *AllowLCFunctionsConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -674,9 +735,21 @@ func (m *ChainConfig) Size() (n int) { if l > 0 { n += 2 + l + sovConfig(uint64(l)) } + if m.XTxMaxSize != nil { + n += m.XTxMaxSize.Size() + } return n } +func (m *ChainConfig_TxMaxSize) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + sovConfig(uint64(m.TxMaxSize)) + return n +} func (m *AllowLCFunctionsConfig) Size() (n int) { if m == nil { return 0 @@ -1269,6 +1342,26 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { } m.Multicall3Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TxMaxSize", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XTxMaxSize = &ChainConfig_TxMaxSize{v} default: iNdEx = preIndex skippy, err := skipConfig(dAtA[iNdEx:]) diff --git a/pkg/relay/ethereum/tx.go b/pkg/relay/ethereum/tx.go index d433f95..8d94443 100644 --- a/pkg/relay/ethereum/tx.go +++ b/pkg/relay/ethereum/tx.go @@ -748,7 +748,7 @@ func (iter *CallIter) buildMultiTx(ctx context.Context, c *Chain) (*CallIterBuil } if c.txMaxSize < multiTx.Size() { - return fmt.Errorf("tx exceeds txMaxSize"); + return fmt.Errorf("tx size exceeds txMaxSize: tx=%v, max=%v", multiTx.Size(), c.txMaxSize) } txGasLimit, err := estimateGas(ctx, c, multiTx, 1 == count, logger) diff --git a/proto/relayer/chains/ethereum/config/config.proto b/proto/relayer/chains/ethereum/config/config.proto index bc77be8..54649a8 100644 --- a/proto/relayer/chains/ethereum/config/config.proto +++ b/proto/relayer/chains/ethereum/config/config.proto @@ -40,6 +40,8 @@ message ChainConfig { repeated string abi_paths = 17; string multicall3_address = 18; + + optional uint64 tx_max_size = 19; } message AllowLCFunctionsConfig {