diff --git a/proto/rollup/v1/tx.proto b/proto/rollup/v1/tx.proto index 933288ca..e34e1f64 100644 --- a/proto/rollup/v1/tx.proto +++ b/proto/rollup/v1/tx.proto @@ -17,6 +17,9 @@ service Msg { // InitiateWithdrawal defines a method for initiating a withdrawal from L2 to L1. rpc InitiateWithdrawal(MsgInitiateWithdrawal) returns (MsgInitiateWithdrawalResponse); + + // InitiateFeeWithdrawal defines a method for initiating a withdrawal of fees from L2 to the L1 fee recipient address. + rpc InitiateFeeWithdrawal(MsgInitiateFeeWithdrawal) returns (MsgInitiateFeeWithdrawalResponse); } // MsgApplyL1Txs defines the message for applying all L1 system and user deposit txs. @@ -52,3 +55,14 @@ message MsgInitiateWithdrawal { // MsgInitiateWithdrawalResponse defines the Msg/InitiateWithdrawal response type. message MsgInitiateWithdrawalResponse {} + +// MsgInitiateFeeWithdrawal defines the message for initiating an L2 fee withdrawal to the L1 fee recipient address. +message MsgInitiateFeeWithdrawal { + option (cosmos.msg.v1.signer) = "sender"; + + // The signer address of the user initiating the fee withdrawal. + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgInitiateFeeWithdrawalResponse defines the Msg/InitiateFeeWithdrawal response type. +message MsgInitiateFeeWithdrawalResponse {} diff --git a/x/rollup/types/tx.pb.go b/x/rollup/types/tx.pb.go index d16e506b..d0a6aa40 100644 --- a/x/rollup/types/tx.pb.go +++ b/x/rollup/types/tx.pb.go @@ -228,46 +228,134 @@ func (m *MsgInitiateWithdrawalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInitiateWithdrawalResponse proto.InternalMessageInfo +// MsgInitiateFeeWithdrawal defines the message for initiating an L2 fee withdrawal to the L1 fee recipient address. +type MsgInitiateFeeWithdrawal struct { + // The signer address of the user initiating the fee withdrawal. + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (m *MsgInitiateFeeWithdrawal) Reset() { *m = MsgInitiateFeeWithdrawal{} } +func (m *MsgInitiateFeeWithdrawal) String() string { return proto.CompactTextString(m) } +func (*MsgInitiateFeeWithdrawal) ProtoMessage() {} +func (*MsgInitiateFeeWithdrawal) Descriptor() ([]byte, []int) { + return fileDescriptor_106533843870de0f, []int{4} +} +func (m *MsgInitiateFeeWithdrawal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitiateFeeWithdrawal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitiateFeeWithdrawal.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 *MsgInitiateFeeWithdrawal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitiateFeeWithdrawal.Merge(m, src) +} +func (m *MsgInitiateFeeWithdrawal) XXX_Size() int { + return m.Size() +} +func (m *MsgInitiateFeeWithdrawal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitiateFeeWithdrawal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInitiateFeeWithdrawal proto.InternalMessageInfo + +func (m *MsgInitiateFeeWithdrawal) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +// MsgInitiateFeeWithdrawalResponse defines the Msg/InitiateFeeWithdrawal response type. +type MsgInitiateFeeWithdrawalResponse struct { +} + +func (m *MsgInitiateFeeWithdrawalResponse) Reset() { *m = MsgInitiateFeeWithdrawalResponse{} } +func (m *MsgInitiateFeeWithdrawalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgInitiateFeeWithdrawalResponse) ProtoMessage() {} +func (*MsgInitiateFeeWithdrawalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_106533843870de0f, []int{5} +} +func (m *MsgInitiateFeeWithdrawalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitiateFeeWithdrawalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitiateFeeWithdrawalResponse.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 *MsgInitiateFeeWithdrawalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitiateFeeWithdrawalResponse.Merge(m, src) +} +func (m *MsgInitiateFeeWithdrawalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgInitiateFeeWithdrawalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitiateFeeWithdrawalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInitiateFeeWithdrawalResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgApplyL1Txs)(nil), "rollup.v1.MsgApplyL1Txs") proto.RegisterType((*MsgApplyL1TxsResponse)(nil), "rollup.v1.MsgApplyL1TxsResponse") proto.RegisterType((*MsgInitiateWithdrawal)(nil), "rollup.v1.MsgInitiateWithdrawal") proto.RegisterType((*MsgInitiateWithdrawalResponse)(nil), "rollup.v1.MsgInitiateWithdrawalResponse") + proto.RegisterType((*MsgInitiateFeeWithdrawal)(nil), "rollup.v1.MsgInitiateFeeWithdrawal") + proto.RegisterType((*MsgInitiateFeeWithdrawalResponse)(nil), "rollup.v1.MsgInitiateFeeWithdrawalResponse") } func init() { proto.RegisterFile("rollup/v1/tx.proto", fileDescriptor_106533843870de0f) } var fileDescriptor_106533843870de0f = []byte{ - // 461 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xbd, 0x6e, 0x13, 0x31, - 0x1c, 0x8f, 0x49, 0x13, 0x1a, 0x53, 0x06, 0xac, 0x96, 0x5e, 0x0f, 0x71, 0x89, 0x32, 0x45, 0x11, - 0x3d, 0x37, 0xb0, 0xb1, 0x35, 0x43, 0x45, 0xa4, 0x76, 0x39, 0x90, 0x90, 0x58, 0x82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, 0x6a, 0xef, 0x9e, 0x09, 0x09, - 0xd3, 0xd9, 0xc4, 0x3f, 0xd5, 0x8a, 0x26, 0x3a, 0xca, 0x14, 0x37, 0x21, 0xd3, 0x54, 0xe9, 0x58, - 0x2b, 0x6e, 0x68, 0x4a, 0xab, 0x07, 0x0c, 0x59, 0xc2, 0xed, 0xa4, 0x59, 0xbc, 0xac, 0x17, 0xbf, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x45, 0x06, 0xeb, 0x1e, 0xd7, 0x02, 0x00, 0x00, + // 501 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x3f, 0x6f, 0x13, 0x31, + 0x1c, 0xcd, 0x35, 0x4d, 0x68, 0x4c, 0x19, 0xb0, 0x1a, 0x7a, 0x3d, 0xc4, 0xe5, 0x74, 0x2c, 0x51, + 0xa0, 0xe7, 0x06, 0x36, 0xb6, 0x66, 0x88, 0x88, 0xd4, 0x2e, 0x07, 0x12, 0x82, 0x25, 0x38, 0x3d, + 0xcb, 0xb1, 0x38, 0x9f, 0x4f, 0xb6, 0x13, 0x2e, 0x1b, 0xe2, 0x13, 0xf0, 0x1d, 0x58, 0x18, 0x3b, + 0xf4, 0x43, 0x74, 0xac, 0x3a, 0x21, 0x86, 0x0a, 0x25, 0x43, 0xbe, 0x06, 0xba, 0x3f, 0x89, 0x1a, + 0x48, 0x04, 0x12, 0xcb, 0xc9, 0xef, 0xf7, 0xde, 0xef, 0x3d, 0x9f, 0x7f, 0x36, 0x80, 0x52, 0x84, + 0xe1, 0x28, 0x46, 0xe3, 0x36, 0xd2, 0x89, 0x17, 0x4b, 0xa1, 0x05, 0xac, 0xe5, 0x35, 0x6f, 0xdc, + 0xb6, 0xee, 0x63, 0xce, 0x22, 0x81, 0xb2, 0x6f, 0xce, 0x5a, 0xfb, 0x67, 0x42, 0x71, 0xa1, 0x10, + 0x57, 0x34, 0xed, 0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x04, + 0x91, 0xc1, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -286,6 +374,8 @@ type MsgClient interface { ApplyL1Txs(ctx context.Context, in *MsgApplyL1Txs, opts ...grpc.CallOption) (*MsgApplyL1TxsResponse, error) // InitiateWithdrawal defines a method for initiating a withdrawal from L2 to L1. InitiateWithdrawal(ctx context.Context, in *MsgInitiateWithdrawal, opts ...grpc.CallOption) (*MsgInitiateWithdrawalResponse, error) + // InitiateFeeWithdrawal defines a method for initiating a withdrawal of fees from L2 to the L1 fee recipient address. + InitiateFeeWithdrawal(ctx context.Context, in *MsgInitiateFeeWithdrawal, opts ...grpc.CallOption) (*MsgInitiateFeeWithdrawalResponse, error) } type msgClient struct { @@ -314,12 +404,23 @@ func (c *msgClient) InitiateWithdrawal(ctx context.Context, in *MsgInitiateWithd return out, nil } +func (c *msgClient) InitiateFeeWithdrawal(ctx context.Context, in *MsgInitiateFeeWithdrawal, opts ...grpc.CallOption) (*MsgInitiateFeeWithdrawalResponse, error) { + out := new(MsgInitiateFeeWithdrawalResponse) + err := c.cc.Invoke(ctx, "/rollup.v1.Msg/InitiateFeeWithdrawal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // ApplyL1Txs defines a method for applying applying all L1 system and user deposit txs. ApplyL1Txs(context.Context, *MsgApplyL1Txs) (*MsgApplyL1TxsResponse, error) // InitiateWithdrawal defines a method for initiating a withdrawal from L2 to L1. InitiateWithdrawal(context.Context, *MsgInitiateWithdrawal) (*MsgInitiateWithdrawalResponse, error) + // InitiateFeeWithdrawal defines a method for initiating a withdrawal of fees from L2 to the L1 fee recipient address. + InitiateFeeWithdrawal(context.Context, *MsgInitiateFeeWithdrawal) (*MsgInitiateFeeWithdrawalResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -332,6 +433,9 @@ func (*UnimplementedMsgServer) ApplyL1Txs(ctx context.Context, req *MsgApplyL1Tx func (*UnimplementedMsgServer) InitiateWithdrawal(ctx context.Context, req *MsgInitiateWithdrawal) (*MsgInitiateWithdrawalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InitiateWithdrawal not implemented") } +func (*UnimplementedMsgServer) InitiateFeeWithdrawal(ctx context.Context, req *MsgInitiateFeeWithdrawal) (*MsgInitiateFeeWithdrawalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitiateFeeWithdrawal not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -373,6 +477,24 @@ func _Msg_InitiateWithdrawal_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Msg_InitiateFeeWithdrawal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgInitiateFeeWithdrawal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).InitiateFeeWithdrawal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rollup.v1.Msg/InitiateFeeWithdrawal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InitiateFeeWithdrawal(ctx, req.(*MsgInitiateFeeWithdrawal)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "rollup.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -385,6 +507,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "InitiateWithdrawal", Handler: _Msg_InitiateWithdrawal_Handler, }, + { + MethodName: "InitiateFeeWithdrawal", + Handler: _Msg_InitiateFeeWithdrawal_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "rollup/v1/tx.proto", @@ -529,6 +655,59 @@ func (m *MsgInitiateWithdrawalResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgInitiateFeeWithdrawal) 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 *MsgInitiateFeeWithdrawal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInitiateFeeWithdrawal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgInitiateFeeWithdrawalResponse) 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 *MsgInitiateFeeWithdrawalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInitiateFeeWithdrawalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -600,6 +779,28 @@ func (m *MsgInitiateWithdrawalResponse) Size() (n int) { return n } +func (m *MsgInitiateFeeWithdrawal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgInitiateFeeWithdrawalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1004,6 +1205,138 @@ func (m *MsgInitiateWithdrawalResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgInitiateFeeWithdrawal) 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: MsgInitiateFeeWithdrawal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInitiateFeeWithdrawal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + 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 *MsgInitiateFeeWithdrawalResponse) 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: MsgInitiateFeeWithdrawalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInitiateFeeWithdrawalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0