diff --git a/commonspace/object/acl/syncacl/headupdate.go b/commonspace/object/acl/syncacl/headupdate.go index a7bf2ed2..0cd189a5 100644 --- a/commonspace/object/acl/syncacl/headupdate.go +++ b/commonspace/object/acl/syncacl/headupdate.go @@ -1,6 +1,7 @@ package syncacl import ( + "github.com/anyproto/any-sync/commonspace/spacesyncproto" "github.com/anyproto/any-sync/commonspace/sync/objectsync/objectmessages" "github.com/anyproto/any-sync/consensus/consensusproto" ) @@ -24,6 +25,10 @@ func (h *InnerHeadUpdate) MsgSize() uint64 { return size + uint64(len(h.head)) + uint64(len(h.root.Id)) + uint64(len(h.root.Payload)) } +func (h *InnerHeadUpdate) ObjectType() spacesyncproto.ObjectType { + return spacesyncproto.ObjectType_Acl +} + func (h *InnerHeadUpdate) Prepare() error { logMsg := consensusproto.WrapHeadUpdate(&consensusproto.LogHeadUpdate{ Head: h.head, diff --git a/commonspace/object/tree/synctree/headupdate.go b/commonspace/object/tree/synctree/headupdate.go index e828ae46..4e847aa0 100644 --- a/commonspace/object/tree/synctree/headupdate.go +++ b/commonspace/object/tree/synctree/headupdate.go @@ -4,6 +4,7 @@ import ( "slices" "github.com/anyproto/any-sync/commonspace/object/tree/treechangeproto" + "github.com/anyproto/any-sync/commonspace/spacesyncproto" "github.com/anyproto/any-sync/commonspace/sync/objectsync/objectmessages" ) @@ -21,6 +22,10 @@ func (h *InnerHeadUpdate) MsgSize() (size uint64) { return uint64(len(h.prepared)) } +func (h *InnerHeadUpdate) ObjectType() spacesyncproto.ObjectType { + return spacesyncproto.ObjectType_Tree +} + func (h *InnerHeadUpdate) Prepare() error { treeMsg := treechangeproto.WrapHeadUpdate(&treechangeproto.TreeHeadUpdate{ Heads: h.heads, diff --git a/commonspace/spacesyncproto/protos/spacesync.proto b/commonspace/spacesyncproto/protos/spacesync.proto index e3b02c18..7212e58c 100644 --- a/commonspace/spacesyncproto/protos/spacesync.proto +++ b/commonspace/spacesyncproto/protos/spacesync.proto @@ -79,6 +79,7 @@ message ObjectSyncMessage { string replyId = 3; bytes payload = 4; string objectId = 5; + ObjectType objectType = 6; } // SpacePushRequest is a request to add space on a node containing only one acl record @@ -200,4 +201,11 @@ message AclGetRecordsResponse { enum DiffType { Initial = 0; Precalculated = 1; -} \ No newline at end of file +} + +// ObjectType is a type of object +enum ObjectType { + Tree = 0; + Acl = 1; + KeyValue = 2; +} diff --git a/commonspace/spacesyncproto/spacesync.pb.go b/commonspace/spacesyncproto/spacesync.pb.go index 3f95b78e..29620079 100644 --- a/commonspace/spacesyncproto/spacesync.pb.go +++ b/commonspace/spacesyncproto/spacesync.pb.go @@ -126,6 +126,35 @@ func (DiffType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_80e49f1f4ac27799, []int{2} } +// ObjectType is a type of object +type ObjectType int32 + +const ( + ObjectType_Tree ObjectType = 0 + ObjectType_Acl ObjectType = 1 + ObjectType_KeyValue ObjectType = 2 +) + +var ObjectType_name = map[int32]string{ + 0: "Tree", + 1: "Acl", + 2: "KeyValue", +} + +var ObjectType_value = map[string]int32{ + "Tree": 0, + "Acl": 1, + "KeyValue": 2, +} + +func (x ObjectType) String() string { + return proto.EnumName(ObjectType_name, int32(x)) +} + +func (ObjectType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_80e49f1f4ac27799, []int{3} +} + // HeadSyncRange presenting a request for one range type HeadSyncRange struct { From uint64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"` @@ -466,11 +495,12 @@ func (m *HeadSyncResponse) GetDiffType() DiffType { // ObjectSyncMessage is a message sent on object sync type ObjectSyncMessage struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - RequestId string `protobuf:"bytes,2,opt,name=requestId,proto3" json:"requestId,omitempty"` - ReplyId string `protobuf:"bytes,3,opt,name=replyId,proto3" json:"replyId,omitempty"` - Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` - ObjectId string `protobuf:"bytes,5,opt,name=objectId,proto3" json:"objectId,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + RequestId string `protobuf:"bytes,2,opt,name=requestId,proto3" json:"requestId,omitempty"` + ReplyId string `protobuf:"bytes,3,opt,name=replyId,proto3" json:"replyId,omitempty"` + Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` + ObjectId string `protobuf:"bytes,5,opt,name=objectId,proto3" json:"objectId,omitempty"` + ObjectType ObjectType `protobuf:"varint,6,opt,name=objectType,proto3,enum=spacesync.ObjectType" json:"objectType,omitempty"` } func (m *ObjectSyncMessage) Reset() { *m = ObjectSyncMessage{} } @@ -549,6 +579,13 @@ func (m *ObjectSyncMessage) GetObjectId() string { return "" } +func (m *ObjectSyncMessage) GetObjectType() ObjectType { + if m != nil { + return m.ObjectType + } + return ObjectType_Tree +} + // SpacePushRequest is a request to add space on a node containing only one acl record type SpacePushRequest struct { Payload *SpacePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` @@ -1685,6 +1722,7 @@ func init() { proto.RegisterEnum("spacesync.ErrCodes", ErrCodes_name, ErrCodes_value) proto.RegisterEnum("spacesync.SpaceSubscriptionAction", SpaceSubscriptionAction_name, SpaceSubscriptionAction_value) proto.RegisterEnum("spacesync.DiffType", DiffType_name, DiffType_value) + proto.RegisterEnum("spacesync.ObjectType", ObjectType_name, ObjectType_value) proto.RegisterType((*HeadSyncRange)(nil), "spacesync.HeadSyncRange") proto.RegisterType((*HeadSyncResult)(nil), "spacesync.HeadSyncResult") proto.RegisterType((*HeadSyncResultElement)(nil), "spacesync.HeadSyncResultElement") @@ -1716,89 +1754,92 @@ func init() { } var fileDescriptor_80e49f1f4ac27799 = []byte{ - // 1308 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x3d, 0x6f, 0xdb, 0xc6, - 0x1b, 0x17, 0xe9,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xd9, 0xfb, 0x3b, - 0x00, 0x00, 0xff, 0xff, 0xd0, 0x97, 0xf7, 0xc0, 0xd6, 0x0d, 0x00, 0x00, + // 1358 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4d, 0x73, 0xdb, 0xc4, + 0x1b, 0xb7, 0x14, 0x27, 0xb6, 0x9f, 0x28, 0xae, 0xba, 0x71, 0x1a, 0xff, 0xdd, 0x8e, 0xeb, 0xd1, + 0xfc, 0x87, 0xc9, 0x64, 0x86, 0xbe, 0x24, 0xc0, 0x4c, 0x0b, 0x1c, 0xd2, 0x24, 0x25, 0xa2, 0xb4, + 0xc9, 0xac, 0x5b, 0x3a, 0xc3, 0x0c, 0x87, 0x8d, 0xb4, 0x49, 0x04, 0xb2, 0x64, 0xb4, 0xeb, 0x36, + 0x3e, 0x72, 0xe2, 0xca, 0x70, 0xe4, 0x13, 0x71, 0x2c, 0x9c, 0x38, 0x32, 0xed, 0x9d, 0x4f, 0xc0, + 0x81, 0xd9, 0xd5, 0x4a, 0x5a, 0xd9, 0x72, 0x81, 0xe9, 0xc5, 0xd1, 0xf3, 0xf6, 0x7b, 0x5e, 0xf7, + 0xd9, 0x0d, 0xdc, 0xf5, 0xe2, 0xd1, 0x28, 0x8e, 0xd8, 0x98, 0x78, 0xf4, 0xb6, 0xfc, 0x65, 0xd3, + 0xc8, 0x1b, 0x27, 0x31, 0x8f, 0x6f, 0xcb, 0x5f, 0x56, 0x70, 0x6f, 0x49, 0x06, 0x6a, 0xe5, 0x0c, + 0x87, 0xc2, 0xda, 0x11, 0x25, 0xfe, 0x70, 0x1a, 0x79, 0x98, 0x44, 0xe7, 0x14, 0x21, 0xa8, 0x9f, + 0x25, 0xf1, 0xa8, 0x6b, 0x0c, 0x8c, 0xad, 0x3a, 0x96, 0xdf, 0xa8, 0x0d, 0x26, 0x8f, 0xbb, 0xa6, + 0xe4, 0x98, 0x3c, 0x46, 0x1d, 0x58, 0x0e, 0x83, 0x51, 0xc0, 0xbb, 0x4b, 0x03, 0x63, 0x6b, 0x0d, + 0xa7, 0x04, 0xea, 0x41, 0x93, 0x86, 0x74, 0x44, 0x23, 0xce, 0xba, 0xf5, 0x81, 0xb1, 0xd5, 0xc4, + 0x39, 0xed, 0x5c, 0x42, 0x3b, 0x77, 0x43, 0xd9, 0x24, 0xe4, 0xc2, 0xcf, 0x05, 0x61, 0x17, 0xd2, + 0x8f, 0x85, 0xe5, 0x37, 0xfa, 0x44, 0x43, 0x30, 0x07, 0x4b, 0x5b, 0xab, 0x3b, 0x83, 0x5b, 0x45, + 0xec, 0x65, 0x80, 0xc3, 0x54, 0xb1, 0xf0, 0x21, 0xa2, 0xf2, 0xe2, 0x49, 0x94, 0x47, 0x25, 0x09, + 0xe7, 0x63, 0xd8, 0xa8, 0x34, 0x14, 0x49, 0x05, 0xbe, 0x74, 0xdf, 0xc2, 0x66, 0xe0, 0xcb, 0x80, + 0x28, 0xf1, 0x65, 0x9a, 0x2d, 0x2c, 0xbf, 0x9d, 0x9f, 0x0c, 0xb8, 0x52, 0x58, 0x7f, 0x37, 0xa1, + 0x8c, 0xa3, 0x2e, 0x34, 0x64, 0x4c, 0x6e, 0x66, 0x9c, 0x91, 0xe8, 0x0e, 0xac, 0x24, 0xa2, 0x86, + 0x59, 0xf0, 0xdd, 0xaa, 0xe0, 0x85, 0x02, 0x56, 0x7a, 0x68, 0x17, 0x9a, 0x7e, 0x70, 0x76, 0xf6, + 0x74, 0x3a, 0xa6, 0x32, 0xea, 0xf6, 0xce, 0xba, 0x66, 0x73, 0xa0, 0x44, 0x0f, 0xcc, 0xae, 0x81, + 0x73, 0x45, 0xe7, 0x12, 0x6c, 0x2d, 0xa3, 0x71, 0x1c, 0x31, 0x8a, 0x76, 0xa1, 0x91, 0xc8, 0xec, + 0x58, 0xd7, 0x90, 0xbe, 0xff, 0xb7, 0xb0, 0x70, 0x38, 0xd3, 0x44,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xa3, 0xac, 0xca, 0xb2, 0x54, 0xef, 0x80, + 0x86, 0x9e, 0xc3, 0x66, 0xc1, 0x54, 0x09, 0xbd, 0x7b, 0x90, 0x77, 0x0c, 0x74, 0x0c, 0x96, 0xbe, + 0x2d, 0x50, 0x5f, 0xd3, 0xaf, 0xd8, 0x48, 0xbd, 0x9b, 0x0b, 0xe5, 0x79, 0x1d, 0xd7, 0x4a, 0x87, + 0x1c, 0xcd, 0x58, 0xcc, 0xad, 0x92, 0xde, 0x60, 0xb1, 0x42, 0x8a, 0xf9, 0xe0, 0x83, 0x5f, 0x5e, + 0xf7, 0x8d, 0x57, 0xaf, 0xfb, 0xc6, 0x1f, 0xaf, 0xfb, 0xc6, 0x8f, 0x6f, 0xfa, 0xb5, 0x57, 0x6f, + 0xfa, 0xb5, 0xdf, 0xdf, 0xf4, 0x6b, 0x5f, 0xf5, 0x16, 0xff, 0x5f, 0x78, 0xba, 0x22, 0xff, 0xec, + 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x46, 0x42, 0x1b, 0xb6, 0x3c, 0x0e, 0x00, 0x00, } func (m *HeadSyncRange) Marshal() (dAtA []byte, err error) { @@ -2046,6 +2087,11 @@ func (m *ObjectSyncMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ObjectType != 0 { + i = encodeVarintSpacesync(dAtA, i, uint64(m.ObjectType)) + i-- + dAtA[i] = 0x30 + } if len(m.ObjectId) > 0 { i -= len(m.ObjectId) copy(dAtA[i:], m.ObjectId) @@ -2951,6 +2997,9 @@ func (m *ObjectSyncMessage) Size() (n int) { if l > 0 { n += 1 + l + sovSpacesync(uint64(l)) } + if m.ObjectType != 0 { + n += 1 + sovSpacesync(uint64(m.ObjectType)) + } return n } @@ -4097,6 +4146,25 @@ func (m *ObjectSyncMessage) Unmarshal(dAtA []byte) error { } m.ObjectId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectType", wireType) + } + m.ObjectType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpacesync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ObjectType |= ObjectType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipSpacesync(dAtA[iNdEx:]) diff --git a/commonspace/sync/objectsync/objectmessages/headupdate.go b/commonspace/sync/objectsync/objectmessages/headupdate.go index 2d9c3e02..d667c9dd 100644 --- a/commonspace/sync/objectsync/objectmessages/headupdate.go +++ b/commonspace/sync/objectsync/objectmessages/headupdate.go @@ -39,6 +39,7 @@ type InnerHeadUpdate interface { Prepare() error Heads() []string MsgSize() uint64 + ObjectType() spacesyncproto.ObjectType } type ObjectMeta struct { @@ -48,10 +49,11 @@ type ObjectMeta struct { } type HeadUpdate struct { - Meta ObjectMeta - Bytes []byte - Update InnerHeadUpdate - msg *spacesyncproto.ObjectSyncMessage + Meta ObjectMeta + Bytes []byte + Update InnerHeadUpdate + objectType spacesyncproto.ObjectType + msg *spacesyncproto.ObjectSyncMessage } func (h *HeadUpdate) MsgSize() uint64 { @@ -84,6 +86,7 @@ func (h *HeadUpdate) SetProtoMessage(message proto.Message) error { h.Bytes = msg.GetPayload() h.Meta.SpaceId = msg.SpaceId h.Meta.ObjectId = msg.ObjectId + h.objectType = msg.GetObjectType() return nil } @@ -94,14 +97,19 @@ func (h *HeadUpdate) ProtoMessage() (proto.Message, error) { return nil, err } return &spacesyncproto.ObjectSyncMessage{ - SpaceId: h.Meta.SpaceId, - Payload: payload, - ObjectId: h.Meta.ObjectId, + SpaceId: h.Meta.SpaceId, + Payload: payload, + ObjectId: h.Meta.ObjectId, + ObjectType: h.objectType, }, nil } return NewMessage(), nil } +func (h *HeadUpdate) ObjectType() spacesyncproto.ObjectType { + return h.objectType +} + func (h *HeadUpdate) SpaceId() string { return h.Meta.SpaceId } @@ -116,9 +124,10 @@ func (h *HeadUpdate) ObjectId() string { func (h *HeadUpdate) Copy() drpc.Message { return &HeadUpdate{ - Meta: h.Meta, - Bytes: h.Bytes, - Update: h.Update, - msg: h.msg, + Meta: h.Meta, + Bytes: h.Bytes, + Update: h.Update, + msg: h.msg, + objectType: h.objectType, } } diff --git a/commonspace/sync/sync.go b/commonspace/sync/sync.go index b58d75db..bbc173fb 100644 --- a/commonspace/sync/sync.go +++ b/commonspace/sync/sync.go @@ -12,6 +12,7 @@ import ( "github.com/anyproto/any-sync/app/logger" "github.com/anyproto/any-sync/commonspace/peermanager" "github.com/anyproto/any-sync/commonspace/spacestate" + "github.com/anyproto/any-sync/commonspace/spacesyncproto" "github.com/anyproto/any-sync/commonspace/sync/syncdeps" "github.com/anyproto/any-sync/metric" "github.com/anyproto/any-sync/nodeconf" @@ -117,6 +118,9 @@ func (s *syncService) HandleMessage(ctx context.Context, msg drpc.Message) error if !ok { return ErrUnexpectedMessage } + if idMsg.ObjectType() == spacesyncproto.ObjectType_KeyValue { + return nil + } objectId := idMsg.ObjectId() err := s.receiveQueue.Add(ctx, objectId, msgCtx{ ctx: ctx, diff --git a/commonspace/sync/sync_test.go b/commonspace/sync/sync_test.go index c1070c18..7a2fbe0b 100644 --- a/commonspace/sync/sync_test.go +++ b/commonspace/sync/sync_test.go @@ -115,6 +115,14 @@ func TestSyncService(t *testing.T) { } require.Equal(t, headUpdate, f.syncHandler.headUpdate) }) + t.Run("handle key value message no op", func(t *testing.T) { + f := newFixture(t) + headUpdate := &testMessage{objectId: "objectId", objectType: spacesyncproto.ObjectType_KeyValue} + err := f.HandleMessage(ctx, headUpdate) + require.NoError(t, err) + f.Close(t) + require.Nil(t, f.syncHandler.headUpdate) + }) t.Run("handle message", func(t *testing.T) { f := newFixture(t) f.syncHandler.toReceiveData = map[string][]*testResponse{ @@ -386,7 +394,12 @@ func (r *testRequest) MsgSize() uint64 { } type testMessage struct { - objectId string + objectId string + objectType spacesyncproto.ObjectType +} + +func (t *testMessage) ObjectType() spacesyncproto.ObjectType { + return t.objectType } func (t *testMessage) ObjectId() string { diff --git a/commonspace/sync/syncdeps/message.go b/commonspace/sync/syncdeps/message.go index c1844098..26a0fac3 100644 --- a/commonspace/sync/syncdeps/message.go +++ b/commonspace/sync/syncdeps/message.go @@ -1,6 +1,9 @@ package syncdeps +import "github.com/anyproto/any-sync/commonspace/spacesyncproto" + type Message interface { ObjectId() string MsgSize() uint64 + ObjectType() spacesyncproto.ObjectType }