From 73b27c7dacf5e83dec2526f8c15baf3d7f1a69c6 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Thu, 23 Feb 2023 21:08:31 +0100 Subject: [PATCH] Update any-sync new deletion logic --- .../object/tree/objecttree/objecttree.go | 21 ++ commonspace/settings/deletionmanager.go | 20 +- commonspace/settings/settings.go | 90 +++++--- .../settings/settingsstate/changefactory.go | 23 +- .../settings/settingsstate/settingsstate.go | 8 +- .../settings/settingsstate/statebuilder.go | 9 +- commonspace/space.go | 13 +- .../spacesyncproto/protos/spacesync.proto | 6 +- commonspace/spacesyncproto/spacesync.pb.go | 218 ++++++++++-------- 9 files changed, 243 insertions(+), 165 deletions(-) diff --git a/commonspace/object/tree/objecttree/objecttree.go b/commonspace/object/tree/objecttree/objecttree.go index 8e5d7c84..31abc01a 100644 --- a/commonspace/object/tree/objecttree/objecttree.go +++ b/commonspace/object/tree/objecttree/objecttree.go @@ -76,6 +76,9 @@ type ObjectTree interface { AddContent(ctx context.Context, content SignableChangeContent) (AddResult, error) AddRawChanges(ctx context.Context, changes RawChangesPayload) (AddResult, error) + UnpackChange(raw *treechangeproto.RawTreeChangeWithId) (data []byte, err error) + PrepareChange(content SignableChangeContent) (res *treechangeproto.RawTreeChangeWithId, err error) + Delete() error Close() error } @@ -191,6 +194,24 @@ func (ot *objectTree) AddContent(ctx context.Context, content SignableChangeCont return } +func (ot *objectTree) UnpackChange(raw *treechangeproto.RawTreeChangeWithId) (data []byte, err error) { + unmarshalled, err := ot.changeBuilder.Unmarshall(raw, true) + if err != nil { + return + } + data = unmarshalled.Data + return +} + +func (ot *objectTree) PrepareChange(content SignableChangeContent) (res *treechangeproto.RawTreeChangeWithId, err error) { + payload, err := ot.prepareBuilderContent(content) + if err != nil { + return + } + _, res, err = ot.changeBuilder.Build(payload) + return +} + func (ot *objectTree) prepareBuilderContent(content SignableChangeContent) (cnt BuilderContent, err error) { ot.aclList.RLock() defer ot.aclList.RUnlock() diff --git a/commonspace/settings/deletionmanager.go b/commonspace/settings/deletionmanager.go index d728740d..ddad78af 100644 --- a/commonspace/settings/deletionmanager.go +++ b/commonspace/settings/deletionmanager.go @@ -3,6 +3,7 @@ package settings import ( "github.com/anytypeio/any-sync/commonspace/object/treegetter" "github.com/anytypeio/any-sync/commonspace/settings/settingsstate" + "github.com/anytypeio/any-sync/util/slice" "time" ) @@ -20,12 +21,16 @@ type DeletionManager interface { func newDeletionManager( spaceId string, + settingsId string, + isResponsible bool, deletionInterval time.Duration, deletionState settingsstate.ObjectDeletionState, provider SpaceIdsProvider, onSpaceDelete func()) DeletionManager { return &deletionManager{ + isResponsible: isResponsible, spaceId: spaceId, + settingsId: settingsId, deletionState: deletionState, provider: provider, deletionInterval: deletionInterval, @@ -39,6 +44,8 @@ type deletionManager struct { treeGetter treegetter.TreeGetter deletionInterval time.Duration spaceId string + settingsId string + isResponsible bool onSpaceDelete func() } @@ -47,15 +54,18 @@ func (d *deletionManager) UpdateState(state *settingsstate.State) (err error) { if err != nil { log.Warn("failed to add deleted ids to deletion state") } - if !state.SpaceDeletionDate.IsZero() { + + if state.DeleterId != "" { spaceDeleter, ok := d.treeGetter.(SpaceDeleter) if ok { spaceDeleter.DeleteSpace(d.spaceId) } - if state.SpaceDeletionDate.Add(d.deletionInterval).Before(time.Now()) { - err = d.deletionState.Add(d.provider.AllIds()) // todo: except deletion tree - // todo: compaction in pogreb - d.onSpaceDelete() + d.onSpaceDelete() + if d.isResponsible { + allIds := slice.DiscardFromSlice(d.provider.AllIds(), func(s string) bool { + return s == d.settingsId + }) + err = d.deletionState.Add(allIds) } } return diff --git a/commonspace/settings/settings.go b/commonspace/settings/settings.go index 5efddeae..f2eebb1e 100644 --- a/commonspace/settings/settings.go +++ b/commonspace/settings/settings.go @@ -9,10 +9,15 @@ import ( "github.com/anytypeio/any-sync/commonspace/object/tree/objecttree" "github.com/anytypeio/any-sync/commonspace/object/tree/synctree" "github.com/anytypeio/any-sync/commonspace/object/tree/synctree/updatelistener" + "github.com/anytypeio/any-sync/commonspace/object/tree/treechangeproto" "github.com/anytypeio/any-sync/commonspace/object/treegetter" "github.com/anytypeio/any-sync/commonspace/settings/settingsstate" spacestorage "github.com/anytypeio/any-sync/commonspace/spacestorage" + "github.com/anytypeio/any-sync/commonspace/spacesyncproto" + "github.com/anytypeio/any-sync/nodeconf" + "github.com/gogo/protobuf/proto" "go.uber.org/zap" + "golang.org/x/exp/slices" "time" ) @@ -24,16 +29,16 @@ type SettingsObject interface { synctree.SyncTree Init(ctx context.Context) (err error) DeleteObject(id string) (err error) - DeleteSpace(t time.Time) (err error) - RestoreSpace() (err error) + DeleteSpace(ctx context.Context, deleterId string, raw *treechangeproto.RawTreeChangeWithId) (err error) + SpaceDeleteRawChange(deleterId string) (raw *treechangeproto.RawTreeChangeWithId, err error) } var ( - ErrDeleteSelf = errors.New("cannot delete self") - ErrAlreadyDeleted = errors.New("the object is already deleted") - ErrObjDoesNotExist = errors.New("the object does not exist") - ErrMarkedDeleted = errors.New("this space is already marked deleted") - ErrMarkedNotDeleted = errors.New("this space is not marked not deleted") + ErrDeleteSelf = errors.New("cannot delete self") + ErrAlreadyDeleted = errors.New("the object is already deleted") + ErrObjDoesNotExist = errors.New("the object does not exist") + ErrCantDeleteSpace = errors.New("not able to delete space") + ErrIncorrectDeleteChange = errors.New("incorrect delete change") ) type BuildTreeFunc func(ctx context.Context, id string, listener updatelistener.UpdateListener) (t synctree.SyncTree, err error) @@ -43,6 +48,7 @@ type Deps struct { Account accountservice.Service TreeGetter treegetter.TreeGetter Store spacestorage.SpaceStorage + Configuration nodeconf.Configuration DeletionState settingsstate.ObjectDeletionState Provider SpaceIdsProvider OnSpaceDelete func() @@ -82,7 +88,14 @@ func NewSettingsObject(deps Deps, spaceId string) (obj SettingsObject) { deleter = deps.del } if deps.delManager == nil { - deletionManager = newDeletionManager(spaceId, spaceDeletionInterval, deps.DeletionState, deps.Provider, deps.OnSpaceDelete) + deletionManager = newDeletionManager( + spaceId, + deps.Store.SpaceSettingsId(), + deps.Configuration.IsResponsible(spaceId), + spaceDeletionInterval, + deps.DeletionState, + deps.Provider, + deps.OnSpaceDelete) } else { deletionManager = deps.delManager } @@ -160,36 +173,39 @@ func (s *settingsObject) Close() error { return s.SyncTree.Close() } -func (s *settingsObject) DeleteSpace(t time.Time) (err error) { +func (s *settingsObject) DeleteSpace(ctx context.Context, deleterId string, raw *treechangeproto.RawTreeChangeWithId) (err error) { s.Lock() defer s.Unlock() - if !s.state.SpaceDeletionDate.IsZero() { - return ErrMarkedDeleted - } - - // TODO: add snapshot logic - res, err := s.changeFactory.CreateSpaceDeleteChange(t, s.state, false) + err = s.verifyDeleteSpace(deleterId, raw) if err != nil { return } - - return s.addContent(res) + res, err := s.AddRawChanges(ctx, objecttree.RawChangesPayload{ + NewHeads: []string{raw.Id}, + RawChanges: []*treechangeproto.RawTreeChangeWithId{raw}, + }) + if err != nil { + return + } + if !slices.Contains(res.Heads, raw.Id) { + return ErrCantDeleteSpace + } + return } -func (s *settingsObject) RestoreSpace() (err error) { - s.Lock() - defer s.Unlock() - if s.state.SpaceDeletionDate.IsZero() { - return ErrMarkedNotDeleted - } - - // TODO: add snapshot logic - res, err := s.changeFactory.CreateSpaceRestoreChange(s.state, false) +func (s *settingsObject) SpaceDeleteRawChange(deleterId string) (raw *treechangeproto.RawTreeChangeWithId, err error) { + data, err := s.changeFactory.CreateSpaceDeleteChange(deleterId, s.state, false) if err != nil { return } - - return s.addContent(res) + accountData := s.account.Account() + return s.PrepareChange(objecttree.SignableChangeContent{ + Data: data, + Key: accountData.SignKey, + Identity: accountData.Identity, + IsSnapshot: false, + IsEncrypted: false, + }) } func (s *settingsObject) DeleteObject(id string) (err error) { @@ -218,6 +234,24 @@ func (s *settingsObject) DeleteObject(id string) (err error) { return s.addContent(res) } +func (s *settingsObject) verifyDeleteSpace(peerId string, raw *treechangeproto.RawTreeChangeWithId) (err error) { + data, err := s.UnpackChange(raw) + if err != nil { + return + } + content := &spacesyncproto.SettingsData{} + err = proto.Unmarshal(data, content) + if err != nil { + return + } + if len(content.GetContent()) != 1 || + content.GetContent()[0].GetSpaceDelete() == nil || + content.GetContent()[0].GetSpaceDelete().GetDeleterPeerId() != peerId { + return ErrIncorrectDeleteChange + } + return +} + func (s *settingsObject) addContent(data []byte) (err error) { accountData := s.account.Account() _, err = s.AddContent(context.Background(), objecttree.SignableChangeContent{ diff --git a/commonspace/settings/settingsstate/changefactory.go b/commonspace/settings/settingsstate/changefactory.go index c414878c..df3da76b 100644 --- a/commonspace/settings/settingsstate/changefactory.go +++ b/commonspace/settings/settingsstate/changefactory.go @@ -2,13 +2,11 @@ package settingsstate import ( "github.com/anytypeio/any-sync/commonspace/spacesyncproto" - "time" ) type ChangeFactory interface { CreateObjectDeleteChange(id string, state *State, isSnapshot bool) (res []byte, err error) - CreateSpaceDeleteChange(t time.Time, state *State, isSnapshot bool) (res []byte, err error) - CreateSpaceRestoreChange(state *State, isSnapshot bool) (res []byte, err error) + CreateSpaceDeleteChange(peerId string, state *State, isSnapshot bool) (res []byte, err error) } func NewChangeFactory() ChangeFactory { @@ -33,24 +31,9 @@ func (c *changeFactory) CreateObjectDeleteChange(id string, state *State, isSnap return } -func (c *changeFactory) CreateSpaceDeleteChange(t time.Time, state *State, isSnapshot bool) (res []byte, err error) { +func (c *changeFactory) CreateSpaceDeleteChange(peerId string, state *State, isSnapshot bool) (res []byte, err error) { content := &spacesyncproto.SpaceSettingsContent_SpaceDelete{ - SpaceDelete: &spacesyncproto.SpaceDelete{Timestamp: t.UnixNano()}, - } - change := &spacesyncproto.SettingsData{ - Content: []*spacesyncproto.SpaceSettingsContent{ - {Value: content}, - }, - Snapshot: nil, - } - // TODO: add snapshot logic - res, err = change.Marshal() - return -} - -func (c *changeFactory) CreateSpaceRestoreChange(state *State, isSnapshot bool) (res []byte, err error) { - content := &spacesyncproto.SpaceSettingsContent_SpaceDelete{ - SpaceDelete: &spacesyncproto.SpaceDelete{}, + SpaceDelete: &spacesyncproto.SpaceDelete{DeleterPeerId: peerId}, } change := &spacesyncproto.SettingsData{ Content: []*spacesyncproto.SpaceSettingsContent{ diff --git a/commonspace/settings/settingsstate/settingsstate.go b/commonspace/settings/settingsstate/settingsstate.go index 6263b089..2f4f0afd 100644 --- a/commonspace/settings/settingsstate/settingsstate.go +++ b/commonspace/settings/settingsstate/settingsstate.go @@ -1,9 +1,7 @@ package settingsstate -import "time" - type State struct { - DeletedIds []string - SpaceDeletionDate time.Time - LastIteratedId string + DeletedIds []string + DeleterId string + LastIteratedId string } diff --git a/commonspace/settings/settingsstate/statebuilder.go b/commonspace/settings/settingsstate/statebuilder.go index 5e5087a7..60dd58db 100644 --- a/commonspace/settings/settingsstate/statebuilder.go +++ b/commonspace/settings/settingsstate/statebuilder.go @@ -4,7 +4,6 @@ import ( "github.com/anytypeio/any-sync/commonspace/object/tree/objecttree" "github.com/anytypeio/any-sync/commonspace/spacesyncproto" "github.com/gogo/protobuf/proto" - "time" ) type StateBuilder interface { @@ -59,9 +58,9 @@ func (s *stateBuilder) processChange(change *objecttree.Change, rootId, startId // getting data from snapshot if we start from it if change.Id == rootId { state = &State{ - DeletedIds: deleteChange.Snapshot.DeletedIds, - SpaceDeletionDate: time.Unix(0, deleteChange.Snapshot.SpaceDeletionTimestamp), - LastIteratedId: rootId, + DeletedIds: deleteChange.Snapshot.DeletedIds, + DeleterId: deleteChange.Snapshot.DeleterPeerId, + LastIteratedId: rootId, } return state } @@ -72,7 +71,7 @@ func (s *stateBuilder) processChange(change *objecttree.Change, rootId, startId case cnt.GetObjectDelete() != nil: state.DeletedIds = append(state.DeletedIds, cnt.GetObjectDelete().GetId()) case cnt.GetSpaceDelete() != nil: - state.SpaceDeletionDate = time.Unix(0, cnt.GetSpaceDelete().GetTimestamp()) + state.DeleterId = cnt.GetSpaceDelete().GetDeleterPeerId() } } return state diff --git a/commonspace/space.go b/commonspace/space.go index 235b4a2e..58e28575 100644 --- a/commonspace/space.go +++ b/commonspace/space.go @@ -99,8 +99,8 @@ type Space interface { DeleteTree(ctx context.Context, id string) (err error) BuildHistoryTree(ctx context.Context, id string, opts HistoryTreeOpts) (t objecttree.HistoryTree, err error) - DeleteSpace(ctx context.Context, t time.Time) (err error) - RestoreSpace(ctx context.Context) (err error) + SpaceDeleteRawChange(ctx context.Context, deleterPeer string) (raw *treechangeproto.RawTreeChangeWithId, err error) + DeleteSpace(ctx context.Context, deleterPeer string, deleteChange *treechangeproto.RawTreeChangeWithId) (err error) HeadSync() headsync.HeadSync ObjectSync() objectsync.ObjectSync @@ -213,6 +213,7 @@ func (s *space) Init(ctx context.Context) (err error) { Store: s.storage, DeletionState: deletionState, Provider: s.headSync, + Configuration: s.configuration, OnSpaceDelete: s.onSpaceDelete, } s.settingsObject = settings.NewSettingsObject(deps, s.id) @@ -368,12 +369,12 @@ func (s *space) DeleteTree(ctx context.Context, id string) (err error) { return s.settingsObject.DeleteObject(id) } -func (s *space) DeleteSpace(ctx context.Context, t time.Time) (err error) { - return s.settingsObject.DeleteSpace(t) +func (s *space) SpaceDeleteRawChange(ctx context.Context, deleterPeer string) (raw *treechangeproto.RawTreeChangeWithId, err error) { + return s.settingsObject.SpaceDeleteRawChange(deleterPeer) } -func (s *space) RestoreSpace(ctx context.Context) (err error) { - return s.settingsObject.RestoreSpace() +func (s *space) DeleteSpace(ctx context.Context, deleterPeer string, deleteChange *treechangeproto.RawTreeChangeWithId) (err error) { + return s.settingsObject.DeleteSpace(ctx, deleterPeer, deleteChange) } func (s *space) HandleMessage(ctx context.Context, hm HandleMessage) (err error) { diff --git a/commonspace/spacesyncproto/protos/spacesync.proto b/commonspace/spacesyncproto/protos/spacesync.proto index 7a0865bb..06f2bf9f 100644 --- a/commonspace/spacesyncproto/protos/spacesync.proto +++ b/commonspace/spacesyncproto/protos/spacesync.proto @@ -124,15 +124,15 @@ message ObjectDelete { string id = 1; } -// SpaceDelete is a message containing timestamp when space was deleted +// SpaceDelete is a message containing deleter peer id message SpaceDelete { - int64 timestamp = 1; + string deleterPeerId = 1; } // SpaceSettingsSnapshot contains all the deleted ids in a snapshot message SpaceSettingsSnapshot { repeated string deletedIds = 1; - int64 spaceDeletionTimestamp = 2; + string deleterPeerId = 2; } // SettingsData contains ObjectTree change payload diff --git a/commonspace/spacesyncproto/spacesync.pb.go b/commonspace/spacesyncproto/spacesync.pb.go index 3fa19f6f..5ef50a67 100644 --- a/commonspace/spacesyncproto/spacesync.pb.go +++ b/commonspace/spacesyncproto/spacesync.pb.go @@ -999,9 +999,9 @@ func (m *ObjectDelete) GetId() string { return "" } -// SpaceDelete is a message containing timestamp when space was deleted +// SpaceDelete is a message containing deleter peer id type SpaceDelete struct { - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + DeleterPeerId string `protobuf:"bytes,1,opt,name=deleterPeerId,proto3" json:"deleterPeerId,omitempty"` } func (m *SpaceDelete) Reset() { *m = SpaceDelete{} } @@ -1037,17 +1037,17 @@ func (m *SpaceDelete) XXX_DiscardUnknown() { var xxx_messageInfo_SpaceDelete proto.InternalMessageInfo -func (m *SpaceDelete) GetTimestamp() int64 { +func (m *SpaceDelete) GetDeleterPeerId() string { if m != nil { - return m.Timestamp + return m.DeleterPeerId } - return 0 + return "" } // SpaceSettingsSnapshot contains all the deleted ids in a snapshot type SpaceSettingsSnapshot struct { - DeletedIds []string `protobuf:"bytes,1,rep,name=deletedIds,proto3" json:"deletedIds,omitempty"` - SpaceDeletionTimestamp int64 `protobuf:"varint,2,opt,name=spaceDeletionTimestamp,proto3" json:"spaceDeletionTimestamp,omitempty"` + DeletedIds []string `protobuf:"bytes,1,rep,name=deletedIds,proto3" json:"deletedIds,omitempty"` + DeleterPeerId string `protobuf:"bytes,2,opt,name=deleterPeerId,proto3" json:"deleterPeerId,omitempty"` } func (m *SpaceSettingsSnapshot) Reset() { *m = SpaceSettingsSnapshot{} } @@ -1090,11 +1090,11 @@ func (m *SpaceSettingsSnapshot) GetDeletedIds() []string { return nil } -func (m *SpaceSettingsSnapshot) GetSpaceDeletionTimestamp() int64 { +func (m *SpaceSettingsSnapshot) GetDeleterPeerId() string { if m != nil { - return m.SpaceDeletionTimestamp + return m.DeleterPeerId } - return 0 + return "" } // SettingsData contains ObjectTree change payload @@ -1232,71 +1232,71 @@ func init() { } var fileDescriptor_80e49f1f4ac27799 = []byte{ - // 1021 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0x6e, 0xdc, 0x24, 0x7e, 0x71, 0x9c, 0xed, 0x34, 0x6d, 0x8d, 0x1b, 0xb9, 0xd6, 0x1c, - 0x50, 0x54, 0xa4, 0x7e, 0xb8, 0x08, 0xa9, 0x05, 0x0e, 0x6d, 0xe2, 0x52, 0x0b, 0x95, 0x44, 0xe3, - 0x56, 0x48, 0x48, 0x1c, 0x26, 0xbb, 0x13, 0x7b, 0x61, 0x3d, 0xb3, 0xec, 0x8c, 0x49, 0x7c, 0xe4, - 0xc4, 0x95, 0x33, 0x9c, 0xf8, 0x1f, 0xf8, 0x23, 0x38, 0xf6, 0xc8, 0x11, 0x25, 0xff, 0x08, 0x9a, - 0xd9, 0xd9, 0x0f, 0xdb, 0xeb, 0x1e, 0xb8, 0x38, 0x3b, 0xef, 0xe3, 0xf7, 0x3e, 0x7e, 0x33, 0xef, - 0x05, 0x9e, 0xf8, 0x62, 0x3a, 0x15, 0x5c, 0xc6, 0xd4, 0x67, 0x8f, 0xcc, 0xaf, 0x9c, 0x73, 0x3f, - 0x4e, 0x84, 0x12, 0x8f, 0xcc, 0xaf, 0x2c, 0xa4, 0x0f, 0x8d, 0x00, 0x35, 0x72, 0x01, 0x1e, 0xc2, - 0xee, 0x6b, 0x46, 0x83, 0xd1, 0x9c, 0xfb, 0x84, 0xf2, 0x31, 0x43, 0x08, 0xea, 0xe7, 0x89, 0x98, - 0xb6, 0x9d, 0x9e, 0x73, 0x58, 0x27, 0xe6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x35, 0xb9, 0xa1, - 0x5d, 0x68, 0x58, 0xe9, 0x19, 0xf3, 0x6a, 0xda, 0xf5, 0x1d, 0x97, 0xb9, 0xc0, 0xe9, 0xff, 0xe5, - 0x42, 0x23, 0xf5, 0x9d, 0x73, 0x1f, 0x1d, 0xc1, 0x76, 0xb6, 0xd4, 0x50, 0xa7, 0x72, 0xd3, 0x99, - 0x99, 0xde, 0xb9, 0x57, 0xbd, 0x05, 0xd3, 0x59, 0xfe, 0xca, 0x22, 0xea, 0xcd, 0x80, 0xee, 0xad, - 0xcc, 0xf1, 0x62, 0xed, 0x74, 0x0e, 0xaa, 0x95, 0x2b, 0x38, 0x51, 0x54, 0x85, 0x93, 0xaf, 0x98, - 0x2a, 0x9c, 0xd2, 0x6e, 0x21, 0xe0, 0x15, 0xdb, 0x78, 0xa4, 0x12, 0x46, 0xa7, 0xe8, 0x60, 0xe5, - 0x35, 0x97, 0x56, 0x75, 0xe7, 0x83, 0xda, 0x43, 0xe7, 0xb1, 0xf3, 0xf2, 0xd3, 0xbf, 0xaf, 0xba, - 0xce, 0xfb, 0xab, 0xae, 0xf3, 0xef, 0x55, 0xd7, 0xf9, 0xed, 0xba, 0x5b, 0x7b, 0x7f, 0xdd, 0xad, - 0xfd, 0x73, 0xdd, 0xad, 0x7d, 0xd7, 0x59, 0xff, 0x4f, 0xde, 0xd9, 0xa6, 0xf9, 0xf3, 0xf4, 0xbf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xd5, 0xd9, 0x0b, 0xc0, 0x09, 0x0a, 0x00, 0x00, + // 1019 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4b, 0x6f, 0xdb, 0x46, + 0x10, 0x16, 0xe9, 0xa7, 0xc6, 0xb2, 0xcc, 0x6c, 0x9c, 0x44, 0x55, 0x0c, 0x45, 0x58, 0x14, 0x85, + 0x91, 0x43, 0x1e, 0x72, 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, 0x70, 0x8a, 0x1d, 0x3c, 0x94, 0x09, 0xf2, 0x09, 0x39, 0x58, 0x7a, 0xc3, + 0xa5, 0x05, 0xdd, 0xfe, 0xa0, 0xf4, 0xd0, 0x7a, 0x62, 0xbd, 0xfc, 0xf4, 0xef, 0xeb, 0x8e, 0xf5, + 0xfe, 0xba, 0x63, 0xfd, 0x7b, 0xdd, 0xb1, 0x7e, 0xbb, 0xe9, 0xd4, 0xde, 0xdf, 0x74, 0x6a, 0xff, + 0xdc, 0x74, 0x6a, 0xdf, 0xb7, 0x57, 0xff, 0x6b, 0x77, 0xbe, 0xa9, 0xff, 0x1c, 0xfd, 0x17, 0x00, + 0x00, 0xff, 0xff, 0xa1, 0xe4, 0x04, 0x3d, 0xff, 0x09, 0x00, 0x00, } func (m *HeadSyncRange) Marshal() (dAtA []byte, err error) { @@ -2000,10 +2000,12 @@ func (m *SpaceDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Timestamp != 0 { - i = encodeVarintSpacesync(dAtA, i, uint64(m.Timestamp)) + if len(m.DeleterPeerId) > 0 { + i -= len(m.DeleterPeerId) + copy(dAtA[i:], m.DeleterPeerId) + i = encodeVarintSpacesync(dAtA, i, uint64(len(m.DeleterPeerId))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -2028,10 +2030,12 @@ func (m *SpaceSettingsSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.SpaceDeletionTimestamp != 0 { - i = encodeVarintSpacesync(dAtA, i, uint64(m.SpaceDeletionTimestamp)) + if len(m.DeleterPeerId) > 0 { + i -= len(m.DeleterPeerId) + copy(dAtA[i:], m.DeleterPeerId) + i = encodeVarintSpacesync(dAtA, i, uint64(len(m.DeleterPeerId))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } if len(m.DeletedIds) > 0 { for iNdEx := len(m.DeletedIds) - 1; iNdEx >= 0; iNdEx-- { @@ -2455,8 +2459,9 @@ func (m *SpaceDelete) Size() (n int) { } var l int _ = l - if m.Timestamp != 0 { - n += 1 + sovSpacesync(uint64(m.Timestamp)) + l = len(m.DeleterPeerId) + if l > 0 { + n += 1 + l + sovSpacesync(uint64(l)) } return n } @@ -2473,8 +2478,9 @@ func (m *SpaceSettingsSnapshot) Size() (n int) { n += 1 + l + sovSpacesync(uint64(l)) } } - if m.SpaceDeletionTimestamp != 0 { - n += 1 + sovSpacesync(uint64(m.SpaceDeletionTimestamp)) + l = len(m.DeleterPeerId) + if l > 0 { + n += 1 + l + sovSpacesync(uint64(l)) } return n } @@ -4468,10 +4474,10 @@ func (m *SpaceDelete) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleterPeerId", wireType) } - m.Timestamp = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSpacesync @@ -4481,11 +4487,24 @@ func (m *SpaceDelete) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSpacesync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSpacesync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeleterPeerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSpacesync(dAtA[iNdEx:]) @@ -4569,10 +4588,10 @@ func (m *SpaceSettingsSnapshot) Unmarshal(dAtA []byte) error { m.DeletedIds = append(m.DeletedIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SpaceDeletionTimestamp", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleterPeerId", wireType) } - m.SpaceDeletionTimestamp = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSpacesync @@ -4582,11 +4601,24 @@ func (m *SpaceSettingsSnapshot) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SpaceDeletionTimestamp |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSpacesync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSpacesync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeleterPeerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSpacesync(dAtA[iNdEx:])