From 0fce8a6ba2b6750751d7928a5f0d57e76afebc23 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Mon, 2 Dec 2019 17:56:06 +0300 Subject: [PATCH 1/2] proto: publish sg lib, rewrite object --- docs/object.md | 42 +---------------- docs/storagegroup.md | 88 +++++++++++++++++++++++++++++++++++ object/extensions.go | 15 ++---- object/sg.go | 43 ++++------------- object/sg_test.go | 5 +- object/types.pb.go | Bin 93105 -> 79938 bytes object/types.proto | 47 +++++-------------- storagegroup/storage.go | 39 ++++++++++++++++ storagegroup/types.go | 97 +++++++++++++++++++++++++++++++++++++++ storagegroup/types.pb.go | Bin 0 -> 17559 bytes storagegroup/types.proto | 35 ++++++++++++++ 11 files changed, 288 insertions(+), 123 deletions(-) create mode 100644 docs/storagegroup.md create mode 100644 storagegroup/storage.go create mode 100644 storagegroup/types.go create mode 100644 storagegroup/types.pb.go create mode 100644 storagegroup/types.proto diff --git a/docs/object.md b/docs/object.md index 8407733..9e7efe6 100644 --- a/docs/object.md +++ b/docs/object.md @@ -34,8 +34,6 @@ - [Link](#object.Link) - [Object](#object.Object) - [Range](#object.Range) - - [StorageGroup](#object.StorageGroup) - - [StorageGroup.Lifetime](#object.StorageGroup.Lifetime) - [SystemHeader](#object.SystemHeader) - [Tombstone](#object.Tombstone) - [Transform](#object.Transform) @@ -369,7 +367,7 @@ in distributed system. | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | | PayloadChecksum | [bytes](#bytes) | | PayloadChecksum of actual object's payload | | Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | -| StorageGroup | [StorageGroup](#object.StorageGroup) | | StorageGroup contains meta information for the data audit | +| StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit | @@ -421,31 +419,6 @@ in distributed system. | Length | [uint64](#uint64) | | Length of the data range | - - -### Message StorageGroup - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| ValidationDataSize | [uint64](#uint64) | | ValidationDataSize is size of the all object's payloads included into storage group | -| ValidationHash | [bytes](#bytes) | | ValidationHash is homomorphic hash of all object's payloads included into storage group | -| lifetime | [StorageGroup.Lifetime](#object.StorageGroup.Lifetime) | | Lifetime is time until storage group is valid | - - - - -### Message StorageGroup.Lifetime - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| unit | [StorageGroup.Lifetime.Unit](#object.StorageGroup.Lifetime.Unit) | | Unit is lifetime type | -| Value | [int64](#int64) | | Value for lifetime | - - ### Message SystemHeader @@ -514,19 +487,6 @@ in distributed system. - - -### StorageGroup.Lifetime.Unit - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unlimited | 0 | Unlimited set if storage group always valid | -| NeoFSEpoch | 1 | NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch | -| UnixTime | 2 | UnixTime set if storage group is valid until lifetime unix timestamp | - - - ### Transform.Type diff --git a/docs/storagegroup.md b/docs/storagegroup.md new file mode 100644 index 0000000..7522902 --- /dev/null +++ b/docs/storagegroup.md @@ -0,0 +1,88 @@ +# Protocol Documentation + + +## Table of Contents + +- [storagegroup/types.proto](#storagegroup/types.proto) + + - Messages + - [StorageGroup](#storagegroup.StorageGroup) + - [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## storagegroup/types.proto + + + + + + + +### Message StorageGroup + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ValidationDataSize | [uint64](#uint64) | | ValidationDataSize is size of the all object's payloads included into storage group | +| ValidationHash | [bytes](#bytes) | | ValidationHash is homomorphic hash of all object's payloads included into storage group | +| lifetime | [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime) | | Lifetime is time until storage group is valid | + + + + +### Message StorageGroup.Lifetime + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| unit | [StorageGroup.Lifetime.Unit](#storagegroup.StorageGroup.Lifetime.Unit) | | Unit is lifetime type | +| Value | [int64](#int64) | | Value for lifetime | + + + + + + +### StorageGroup.Lifetime.Unit + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unlimited | 0 | Unlimited set if storage group always valid | +| NeoFSEpoch | 1 | NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch | +| UnixTime | 2 | UnixTime set if storage group is valid until lifetime unix timestamp | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/object/extensions.go b/object/extensions.go index 1d89683..7427079 100644 --- a/object/extensions.go +++ b/object/extensions.go @@ -1,8 +1,6 @@ package object -import ( - "github.com/nspcc-dev/neofs-proto/hash" -) +import "github.com/nspcc-dev/neofs-proto/storagegroup" // IsLinking checks if object has children links to another objects. // We have to check payload size because zero-object must have zero @@ -64,7 +62,7 @@ func (m Object) IsTombstone() bool { } // StorageGroup returns storage group structure if it is presented in extended headers. -func (m Object) StorageGroup() (*StorageGroup, error) { +func (m Object) StorageGroup() (*storagegroup.StorageGroup, error) { _, sgHdr := m.LastHeader(HeaderType(StorageGroupHdr)) if sgHdr == nil { return nil, ErrHeaderNotFound @@ -74,11 +72,6 @@ func (m Object) StorageGroup() (*StorageGroup, error) { // SetStorageGroup sets storage group header in the object. // It will replace existing storage group header or add a new one. -func (m *Object) SetStorageGroup(sg *StorageGroup) { - m.SetHeader(&Header{Value: &Header_StorageGroup{StorageGroup: sg}}) -} - -// Empty checks if storage group has some data for validation. -func (m StorageGroup) Empty() bool { - return m.ValidationDataSize == 0 && m.ValidationHash.Equal(hash.Hash{}) +func (m *Object) SetStorageGroup(group *storagegroup.StorageGroup) { + m.SetHeader(&Header{Value: &Header_StorageGroup{StorageGroup: group}}) } diff --git a/object/sg.go b/object/sg.go index 1b48b3e..620d24d 100644 --- a/object/sg.go +++ b/object/sg.go @@ -1,54 +1,31 @@ package object import ( - "bytes" "sort" + + "github.com/nspcc-dev/neofs-proto/refs" + "github.com/nspcc-dev/neofs-proto/storagegroup" ) // Here are defined getter functions for objects that contain storage group // information. -type ( - // IDList is a slice of object ids, that can be sorted. - IDList []ID - - // ZoneInfo provides validation info of storage group. - ZoneInfo struct { - Hash - Size uint64 - } - - // IdentificationInfo provides meta information about storage group. - IdentificationInfo struct { - SGID - CID - OwnerID - } -) - -// Len returns amount of object ids in IDList. -func (s IDList) Len() int { return len(s) } - -// Less returns byte comparision between IDList[i] and IDList[j]. -func (s IDList) Less(i, j int) bool { return bytes.Compare(s[i].Bytes(), s[j].Bytes()) == -1 } - -// Swap swaps element with i and j index in IDList. -func (s IDList) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +var _ storagegroup.Provider = (*Object)(nil) // Group returns slice of object ids that are part of a storage group. -func (m *Object) Group() []ID { +func (m *Object) Group() []refs.ObjectID { sgLinks := m.Links(Link_StorageGroup) - sort.Sort(IDList(sgLinks)) + sort.Sort(storagegroup.IDList(sgLinks)) return sgLinks } // Zones returns validation zones of storage group. -func (m *Object) Zones() []ZoneInfo { +func (m *Object) Zones() []storagegroup.ZoneInfo { sgInfo, err := m.StorageGroup() if err != nil { return nil } - return []ZoneInfo{ + return []storagegroup.ZoneInfo{ { Hash: sgInfo.ValidationHash, Size: sgInfo.ValidationDataSize, @@ -57,8 +34,8 @@ func (m *Object) Zones() []ZoneInfo { } // IDInfo returns meta information about storage group. -func (m *Object) IDInfo() *IdentificationInfo { - return &IdentificationInfo{ +func (m *Object) IDInfo() *storagegroup.IdentificationInfo { + return &storagegroup.IdentificationInfo{ SGID: m.SystemHeader.ID, CID: m.SystemHeader.CID, OwnerID: m.SystemHeader.OwnerID, diff --git a/object/sg_test.go b/object/sg_test.go index 58e2042..15cc21b 100644 --- a/object/sg_test.go +++ b/object/sg_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/nspcc-dev/neofs-proto/hash" + "github.com/nspcc-dev/neofs-proto/storagegroup" "github.com/stretchr/testify/require" ) @@ -28,7 +29,7 @@ func TestObject_StorageGroup(t *testing.T) { } rand.Shuffle(len(obj.Headers), func(i, j int) { obj.Headers[i], obj.Headers[j] = obj.Headers[j], obj.Headers[i] }) - sort.Sort(IDList(idList)) + sort.Sort(storagegroup.IDList(idList)) require.Equal(t, idList, obj.Group()) }) t.Run("identification method", func(t *testing.T) { @@ -58,7 +59,7 @@ func TestObject_StorageGroup(t *testing.T) { Headers: []Header{ { Value: &Header_StorageGroup{ - StorageGroup: &StorageGroup{ + StorageGroup: &storagegroup.StorageGroup{ ValidationDataSize: sgSize, ValidationHash: sgHash, }, diff --git a/object/types.pb.go b/object/types.pb.go index 217ef099bce185ff81f21d608ca4c4bf8340712f..459e124b053ab4c032498513b277709a36b089bb 100644 GIT binary patch delta 5369 zcmZXYxvFJV5Qe#GcjJ`UC=hdTy*#?*?(4;=ZPT+^)3dMBbDddf?mqWyaVm%O&)B7B z*QDn@rsu|{nZs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mm;1EMmCFrU6rFw*2x2 zDYoJ4)YTxK?TW(jR8Fl?H_yqN0AeOYsR47j(eS#9w{lhTT}- z_v0Q3S(kriQ$j zdF#yYhdj9$%@27JEc`LfH1>}e8y3U(j+58MI~$uWGp}dj{f*3e`!>9bq5 z5Q`^WcU<*(08T-|cY%>V8pU5nNx=h`2B@X*R#KM&F?Kl|&3&n>^O zHLV?@7Fy=v#`(37>') + return b.String() +} + +// Empty checks if storage group has some data for validation. +func (m StorageGroup) Empty() bool { + return m.ValidationDataSize == 0 && m.ValidationHash.Equal(hash.Hash{}) +} + +// Len returns amount of object ids in IDList. +func (s IDList) Len() int { return len(s) } + +// Less returns byte comparision between IDList[i] and IDList[j]. +func (s IDList) Less(i, j int) bool { return bytes.Compare(s[i].Bytes(), s[j].Bytes()) == -1 } + +// Swap swaps element with i and j index in IDList. +func (s IDList) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// CalculateSize combines length of all zones in storage group. +func CalculateSize(sg Provider) (size uint64) { + zoneList := sg.Zones() + for i := range zoneList { + size += zoneList[i].Size + } + return +} + +// CalculateHash returns homomorphic sum of hashes +// fromm all zones in storage group. +func CalculateHash(sg Provider) (hash.Hash, error) { + var ( + zones = sg.Zones() + hashes = make([]hash.Hash, len(zones)) + ) + for i := range zones { + hashes[i] = zones[i].Hash + } + return hash.Concat(hashes) +} diff --git a/storagegroup/types.pb.go b/storagegroup/types.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..f05288533e982981af115828716b53db2bcaf863 GIT binary patch literal 17559 zcmeHP|8Ltyvj187EA|O!pLCIBeX}k5;sbh@^j?5AIb4&XK;Y+6fxdJTO3$(Wh0w-nGMYJ&McESi~R$P9bCm% zanC$^WnR8|ZJs}S@w(SMJTz&%N_=}}(kxEAD|?m1tL0&Kx3p=Gu+8Su^WWjk#*Ah& zTrA@xGwo($w#ZBik5;pBX$CxlC-D8k;0>lA3U4 zvTJ*1yu_L)&P_|DGn%))w6YVP0; z09f9cm?{!J)LJ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y|3%Q($813QwJ~c3R_orti?9d+FN@5SwW_1x1FymU@XMeEP~$w()TJ(3X`jQa6`qvfFRl)l3`_Fd5uldp_1uCXW(=z=-D%d#%@CyPYC zu{cp35~oyLj|pZ_Oj}nr_I$*ED(<(VcvR@x-GRZR9uE4WpkjB1d$ZF1)+om36J`9O z*Xyay)O)eBr$A6690ASdQVHQAtE(0(%Ll;ZTfq8zv86rWW|ZB%GW?&-!xy}H$YaLu zxN%sM_!2e^(t@bW&2l9^|9RLKUvD~Lke4eH3~wv{mMXMxSmGmQFRThzITo{*$#`S}aP8%EVao19p0c|6jAV)B)@Isz}Y+n$#)`#gseJ-j}BX zyTmV#>l%K)Pje4Pp3gt6zX!;D2CQm}Xg#&j;%mF!>a=6ndwYDFFYhH)_wih_tC%F6 zO~%DO%jbvoM`exgHc0alu3m|*M+9gsgG+7F5^#+kb6_brT`viU*7fPZ;9|1{TH7OX zoxQwr#R*uscO;&L-7Z=YpSO|o`>LhN!8ZDCP9(%`Y189(Yn2}M!00X09KxLqOfF|_ zPe*N!Zo6X0wXdxWu6ml6emTzj9U2X=E8R-gO0CpakAhb-{(OJ4kwkdjvLN20(smJ? zjKM@XBe~58kXIA~dC6F;qOXFjS!pRE-t&uXuROrXSZOfYPoWx=E)`Ht*-Lq)i zEpYt53MvW8FRSG5yh_Ljt@JFs!T+W~m%=Pwp?M#y_#5+8{&P+I;9Q#b6){s$*P@3D g+AEuw*qx&|EVXv5W^z>=r|@V2zmU$)6FSZR0~9H?cK`qY literal 0 HcmV?d00001 diff --git a/storagegroup/types.proto b/storagegroup/types.proto new file mode 100644 index 0000000..5014b96 --- /dev/null +++ b/storagegroup/types.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package storagegroup; +option go_package = "github.com/nspcc-dev/neofs-proto/storagegroup"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +message StorageGroup { + option (gogoproto.goproto_stringer) = false; + + // ValidationDataSize is size of the all object's payloads included into storage group + uint64 ValidationDataSize = 1; + // ValidationHash is homomorphic hash of all object's payloads included into storage group + bytes ValidationHash = 2 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false]; + + message Lifetime { + enum Unit { + // Unlimited set if storage group always valid + Unlimited = 0; + // NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch + NeoFSEpoch = 1; + // UnixTime set if storage group is valid until lifetime unix timestamp + UnixTime = 2; + } + + // Unit is lifetime type + Unit unit = 1 [(gogoproto.customname) = "Unit"]; + // Value for lifetime + int64 Value = 2; + } + + // Lifetime is time until storage group is valid + Lifetime lifetime = 3 [(gogoproto.customname) = "Lifetime"]; +} From 90b6e5c4c110c7fdc451c5947556fe43cc43893d Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 3 Dec 2019 13:20:54 +0300 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3f3c8c..a039d13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Changelog This is the changelog for NeoFS Proto +## [0.2.4] - 2019-12-03 + +### Added +- StorageGroup library + +### Changed +- Storage group part of object library moved into separate package +- Updated proto documentation + ## [0.2.3] - 2019-11-28 ### Removed @@ -50,3 +59,4 @@ Initial public release [0.2.1]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.0...v0.2.1 [0.2.2]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.1...v0.2.2 [0.2.3]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.2...v0.2.3 +[0.2.4]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.3...v0.2.4