diff --git a/adapters.go b/adapters.go index 06279680..401541de 100644 --- a/adapters.go +++ b/adapters.go @@ -65,15 +65,17 @@ func countDepositTransactions(ethTxs []hexutil.Bytes) (int, error) { return numDepositTxs, nil } -func packDepositTxsToCosmosTx(ethDepositTxs []hexutil.Bytes, _ string) (*rolluptypes.MsgApplyL1Txs, error) { //nolint:unparam +func packDepositTxsToCosmosTx(ethDepositTxs []hexutil.Bytes, _ string) (*rolluptypes.DepositsTx, error) { //nolint:unparam depositTxs := make([]*rolluptypes.EthDepositTx, 0, len(ethDepositTxs)) for _, ethDepositTx := range ethDepositTxs { depositTxs = append(depositTxs, &rolluptypes.EthDepositTx{ Tx: ethDepositTx, }) } - return &rolluptypes.MsgApplyL1Txs{ - Txs: depositTxs, + return &rolluptypes.DepositsTx{ + Deposits: &rolluptypes.MsgApplyL1Txs{ + Txs: depositTxs, + }, }, nil } @@ -108,11 +110,11 @@ func AdaptCosmosTxsToEthTxs(cosmosTxs bfttypes.Txs) (ethtypes.Transactions, erro } func GetDepositTxs(txsBytes [][]byte) (ethtypes.Transactions, error) { - msg := new(rolluptypes.MsgApplyL1Txs) + msg := new(rolluptypes.DepositsTx) if err := msg.Unmarshal(txsBytes[0]); err != nil { return nil, fmt.Errorf("unmarshal MsgL1Txs msg: %v", err) } - ethTxsBytes := msg.GetTxs() + ethTxsBytes := msg.GetDeposits().Txs if len(ethTxsBytes) == 0 { return nil, errL1AttributesNotFound } diff --git a/proto/rollup/v1/tx.proto b/proto/rollup/v1/tx.proto index fd4a7d77..e1414355 100644 --- a/proto/rollup/v1/tx.proto +++ b/proto/rollup/v1/tx.proto @@ -26,6 +26,11 @@ service Msg { rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } +// DepositsTx is the Cosmos SDK transaction type that wraps OP Stack deposit transactions. +message DepositsTx { + MsgApplyL1Txs deposits = 1; +} + // DepositTx is a eth deposit tx. message EthDepositTx { // tx is the marshaled Ethereum Deposit tx. diff --git a/x/rollup/tx/deposit.go b/x/rollup/tx/deposit.go index 02cfb17e..5c9a1be1 100644 --- a/x/rollup/tx/deposit.go +++ b/x/rollup/tx/deposit.go @@ -4,35 +4,12 @@ import ( "fmt" sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/gogoproto/proto" - protov1 "github.com/golang/protobuf/proto" //nolint:staticcheck "github.com/polymerdao/monomer/x/rollup/tx/internal" "github.com/polymerdao/monomer/x/rollup/types" - "google.golang.org/protobuf/reflect/protoreflect" ) -type Deposit struct { - Msg *types.MsgApplyL1Txs -} - -var _ sdktypes.Tx = (*Deposit)(nil) - -func (d *Deposit) GetMsgs() []proto.Message { - return []proto.Message{d.Msg} -} - -func (d *Deposit) GetMsgsV2() ([]protoreflect.ProtoMessage, error) { - return []protoreflect.ProtoMessage{protov1.MessageV2(d.Msg)}, nil -} - -// TODO split deposits into three types: -// 1. L1Info -// 2. Mint -// 3. ForceInclude -// also add an sdktypes.PreBlocker to check that these are in the propoer order. - func DepositAnteHandler(ctx sdktypes.Context, tx sdktypes.Tx, simulate bool) (sdktypes.Context, error) { //nolint:gocritic // hugeparam - if _, ok := tx.(*Deposit); ok { + if _, ok := tx.(*types.DepositsTx); ok { ctx = ctx.WithGasMeter(internal.NewFreeInfiniteGasMeter()) } return ctx, nil @@ -40,11 +17,9 @@ func DepositAnteHandler(ctx sdktypes.Context, tx sdktypes.Tx, simulate bool) (sd // DepositDecoder is an sdktypes.TxDecoder. func DepositDecoder(txBytes []byte) (sdktypes.Tx, error) { - depositMsg := new(types.MsgApplyL1Txs) - if err := proto.Unmarshal(txBytes, depositMsg); err != nil { - return nil, fmt.Errorf("unmarshal proto: %v", err) + depositsTx := new(types.DepositsTx) + if err := depositsTx.Unmarshal(txBytes); err != nil { + return nil, fmt.Errorf("unmarshal deposits tx: %v", err) } - return &Deposit{ - Msg: depositMsg, - }, nil + return depositsTx, nil } diff --git a/x/rollup/tx/helpers/ante.go b/x/rollup/tx/helpers/ante.go index e5fc42de..eb1a20ab 100644 --- a/x/rollup/tx/helpers/ante.go +++ b/x/rollup/tx/helpers/ante.go @@ -7,6 +7,7 @@ import ( authante "github.com/cosmos/cosmos-sdk/x/auth/ante" rollupkeeper "github.com/polymerdao/monomer/x/rollup/keeper" rolluptx "github.com/polymerdao/monomer/x/rollup/tx" + rolluptypes "github.com/polymerdao/monomer/x/rollup/types" ) type AnteHandler struct { @@ -35,7 +36,7 @@ func (a *AnteHandler) AnteHandle( simulate bool, ) (sdktypes.Context, error) { switch tx.(type) { - case *rolluptx.Deposit: + case *rolluptypes.DepositsTx: newCtx, err := rolluptx.DepositAnteHandler(ctx, tx, simulate) if err != nil { return newCtx, fmt.Errorf("deposit ante handle: %v", err) diff --git a/x/rollup/types/deposit_tx.go b/x/rollup/types/deposit_tx.go new file mode 100644 index 00000000..ec8cae4e --- /dev/null +++ b/x/rollup/types/deposit_tx.go @@ -0,0 +1,23 @@ +package types + +import ( + sdktypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/gogoproto/proto" + protov1 "github.com/golang/protobuf/proto" //nolint:staticcheck + "google.golang.org/protobuf/reflect/protoreflect" +) + +var _ sdktypes.Tx = (*DepositsTx)(nil) + +func (d *DepositsTx) GetMsgs() []proto.Message { + return []proto.Message{d.Deposits} +} + +func (d *DepositsTx) GetMsgsV2() ([]protoreflect.ProtoMessage, error) { + msgsV1 := d.GetMsgs() + msgs := make([]protoreflect.ProtoMessage, 0, len(msgsV1)) + for _, msgV1 := range msgsV1 { + msgs = append(msgs, protov1.MessageV2(msgV1)) + } + return msgs, nil +} diff --git a/x/rollup/types/tx.pb.go b/x/rollup/types/tx.pb.go index b0d016ec..48642b4f 100644 --- a/x/rollup/types/tx.pb.go +++ b/x/rollup/types/tx.pb.go @@ -32,6 +32,50 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type DepositsTx struct { + Deposits *MsgApplyL1Txs `protobuf:"bytes,1,opt,name=deposits,proto3" json:"deposits,omitempty"` +} + +func (m *DepositsTx) Reset() { *m = DepositsTx{} } +func (m *DepositsTx) String() string { return proto.CompactTextString(m) } +func (*DepositsTx) ProtoMessage() {} +func (*DepositsTx) Descriptor() ([]byte, []int) { + return fileDescriptor_106533843870de0f, []int{0} +} +func (m *DepositsTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DepositsTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DepositsTx.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 *DepositsTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_DepositsTx.Merge(m, src) +} +func (m *DepositsTx) XXX_Size() int { + return m.Size() +} +func (m *DepositsTx) XXX_DiscardUnknown() { + xxx_messageInfo_DepositsTx.DiscardUnknown(m) +} + +var xxx_messageInfo_DepositsTx proto.InternalMessageInfo + +func (m *DepositsTx) GetDeposits() *MsgApplyL1Txs { + if m != nil { + return m.Deposits + } + return nil +} + // DepositTx is a eth deposit tx. type EthDepositTx struct { // tx is the marshaled Ethereum Deposit tx. @@ -42,7 +86,7 @@ func (m *EthDepositTx) Reset() { *m = EthDepositTx{} } func (m *EthDepositTx) String() string { return proto.CompactTextString(m) } func (*EthDepositTx) ProtoMessage() {} func (*EthDepositTx) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{0} + return fileDescriptor_106533843870de0f, []int{1} } func (m *EthDepositTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -88,7 +132,7 @@ func (m *MsgApplyL1Txs) Reset() { *m = MsgApplyL1Txs{} } func (m *MsgApplyL1Txs) String() string { return proto.CompactTextString(m) } func (*MsgApplyL1Txs) ProtoMessage() {} func (*MsgApplyL1Txs) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{1} + return fileDescriptor_106533843870de0f, []int{2} } func (m *MsgApplyL1Txs) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -132,7 +176,7 @@ func (m *MsgApplyL1TxsResponse) Reset() { *m = MsgApplyL1TxsResponse{} } func (m *MsgApplyL1TxsResponse) String() string { return proto.CompactTextString(m) } func (*MsgApplyL1TxsResponse) ProtoMessage() {} func (*MsgApplyL1TxsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{2} + return fileDescriptor_106533843870de0f, []int{3} } func (m *MsgApplyL1TxsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -179,7 +223,7 @@ func (m *MsgInitiateWithdrawal) Reset() { *m = MsgInitiateWithdrawal{} } func (m *MsgInitiateWithdrawal) String() string { return proto.CompactTextString(m) } func (*MsgInitiateWithdrawal) ProtoMessage() {} func (*MsgInitiateWithdrawal) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{3} + return fileDescriptor_106533843870de0f, []int{4} } func (m *MsgInitiateWithdrawal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -244,7 +288,7 @@ func (m *MsgInitiateWithdrawalResponse) Reset() { *m = MsgInitiateWithdr func (m *MsgInitiateWithdrawalResponse) String() string { return proto.CompactTextString(m) } func (*MsgInitiateWithdrawalResponse) ProtoMessage() {} func (*MsgInitiateWithdrawalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{4} + return fileDescriptor_106533843870de0f, []int{5} } func (m *MsgInitiateWithdrawalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -283,7 +327,7 @@ func (m *MsgInitiateFeeWithdrawal) Reset() { *m = MsgInitiateFeeWithdraw func (m *MsgInitiateFeeWithdrawal) String() string { return proto.CompactTextString(m) } func (*MsgInitiateFeeWithdrawal) ProtoMessage() {} func (*MsgInitiateFeeWithdrawal) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{5} + return fileDescriptor_106533843870de0f, []int{6} } func (m *MsgInitiateFeeWithdrawal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -327,7 +371,7 @@ func (m *MsgInitiateFeeWithdrawalResponse) Reset() { *m = MsgInitiateFee func (m *MsgInitiateFeeWithdrawalResponse) String() string { return proto.CompactTextString(m) } func (*MsgInitiateFeeWithdrawalResponse) ProtoMessage() {} func (*MsgInitiateFeeWithdrawalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{6} + return fileDescriptor_106533843870de0f, []int{7} } func (m *MsgInitiateFeeWithdrawalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -369,7 +413,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParams) ProtoMessage() {} func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{7} + return fileDescriptor_106533843870de0f, []int{8} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -420,7 +464,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParamsResponse) ProtoMessage() {} func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_106533843870de0f, []int{8} + return fileDescriptor_106533843870de0f, []int{9} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,6 +494,7 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*DepositsTx)(nil), "rollup.v1.DepositsTx") proto.RegisterType((*EthDepositTx)(nil), "rollup.v1.EthDepositTx") proto.RegisterType((*MsgApplyL1Txs)(nil), "rollup.v1.MsgApplyL1Txs") proto.RegisterType((*MsgApplyL1TxsResponse)(nil), "rollup.v1.MsgApplyL1TxsResponse") @@ -464,46 +509,47 @@ func init() { func init() { proto.RegisterFile("rollup/v1/tx.proto", fileDescriptor_106533843870de0f) } var fileDescriptor_106533843870de0f = []byte{ - // 612 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x41, 0x4f, 0xd4, 0x40, - 0x14, 0xde, 0xee, 0xc2, 0xc6, 0x7d, 0x20, 0x86, 0x09, 0xb0, 0xa5, 0xc6, 0xb2, 0xa9, 0x17, 0x44, - 0x69, 0x01, 0x8d, 0x07, 0x6e, 0x10, 0x25, 0x92, 0x80, 0x31, 0x15, 0x63, 0xf4, 0x82, 0x03, 0x9d, - 0xcc, 0x4e, 0x6c, 0x3b, 0x4d, 0x67, 0x16, 0xbb, 0x37, 0xe3, 0x1f, 0xd0, 0x9f, 0xe1, 0x91, 0x03, - 0x3f, 0x82, 0x23, 0xe1, 0x64, 0x3c, 0x10, 0x03, 0x07, 0x7e, 0x80, 0x7f, 0xc0, 0x74, 0x5a, 0x76, - 0x5b, 0xdc, 0x0d, 0x26, 0x5e, 0x9a, 0xbe, 0xf7, 0x7d, 0xef, 0xfb, 0x5e, 0xdf, 0x7b, 0x29, 0xa0, - 0x98, 0xfb, 0x7e, 0x27, 0x72, 0x0e, 0x96, 0x1d, 0x99, 0xd8, 0x51, 0xcc, 0x25, 0x47, 0x8d, 0x2c, - 0x67, 0x1f, 0x2c, 0x1b, 0x93, 0x38, 0x60, 0x21, 0x77, 0xd4, 0x33, 0x43, 0x8d, 0xe6, 0x3e, 0x17, - 0x01, 0x17, 0x4e, 0x20, 0x68, 0x5a, 0x15, 0x08, 0x9a, 0x03, 0xb3, 0x19, 0xb0, 0xab, 0x22, 0x27, - 0x0b, 0x72, 0x68, 0x8a, 0x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81, 0xd4, 0xb3, 0x7a, 0x09, 0xe3, 0xa5, 0x3d, 0x1a, 0xe5, 0xe2, 0x22, 0x66, 0x58, - 0xc3, 0xb1, 0x2b, 0x3d, 0x63, 0xf4, 0x73, 0xba, 0xa8, 0xf5, 0x8d, 0xe3, 0x73, 0x53, 0x3b, 0x39, - 0x37, 0xb5, 0x5f, 0xe7, 0xa6, 0xf6, 0xed, 0xc2, 0xac, 0x9c, 0x5c, 0x98, 0x95, 0x1f, 0x17, 0x66, - 0xe5, 0xfd, 0x23, 0xca, 0x64, 0xbb, 0xb3, 0x67, 0xef, 0xf3, 0xc0, 0x89, 0xb8, 0xdf, 0x0d, 0x48, - 0xec, 0x61, 0xee, 0x04, 0x3c, 0xe4, 0x01, 0x89, 0x9d, 0x24, 0xff, 0xd3, 0x38, 0xb2, 0x1b, 0x11, - 0xb1, 0x57, 0x57, 0x3f, 0x9c, 0xc7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x51, 0x4d, 0xe3, - 0x06, 0x05, 0x00, 0x00, + // 630 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4f, 0x4f, 0x13, 0x41, + 0x14, 0xef, 0xb6, 0xd0, 0xd0, 0x57, 0xc4, 0x30, 0x01, 0xba, 0xac, 0x71, 0x21, 0xeb, 0x05, 0x51, + 0x76, 0xa1, 0x12, 0x0f, 0xdc, 0x68, 0x94, 0x48, 0x02, 0xc6, 0x54, 0x8c, 0xd1, 0x0b, 0x0e, 0xec, + 0x64, 0x3a, 0x71, 0x77, 0x67, 0xb3, 0x33, 0xc5, 0xed, 0xcd, 0xf8, 0x05, 0xf4, 0x63, 0x78, 0xe4, + 0xc0, 0x87, 0xe0, 0x48, 0x38, 0x19, 0x0f, 0xc4, 0xc0, 0x81, 0x0f, 0xe0, 0x17, 0x30, 0x3b, 0x3b, + 0x94, 0x16, 0xdb, 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x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -702,6 +748,41 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "rollup/v1/tx.proto", } +func (m *DepositsTx) 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 *DepositsTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DepositsTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deposits != nil { + { + size, err := m.Deposits.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *EthDepositTx) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1003,6 +1084,19 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *DepositsTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Deposits != nil { + l = m.Deposits.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func (m *EthDepositTx) Size() (n int) { if m == nil { return 0 @@ -1128,6 +1222,92 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *DepositsTx) 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: DepositsTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DepositsTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", 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 + } + if m.Deposits == nil { + m.Deposits = &MsgApplyL1Txs{} + } + if err := m.Deposits.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *EthDepositTx) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0