diff --git a/CHANGELOG.md b/CHANGELOG.md index 91ebf2f..ee28fa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Removed - Reputation system (#22) - All `subnet` related fields and types (#25) +- Storage group (#19) ## [2.14.0] - 2022-09-23 - Anmado (안마도, 鞍馬島) diff --git a/object/service.proto b/object/service.proto index 3a0a3de..2a3c6ff 100644 --- a/object/service.proto +++ b/object/service.proto @@ -13,11 +13,11 @@ import "session/types.proto"; // not affect the sidechain and are only served by nodes in p2p style. service ObjectService { // Receive full object structure, including Headers and payload. Response uses - // gRPC stream. First response message carries the object with the requested address. - // Chunk messages are parts of the object's payload if it is needed. All - // messages, except the first one, carry payload chunks. The requested object can - // be restored by concatenation of object message payload and all chunks - // keeping the receiving order. + // gRPC stream. First response message carries the object with the requested + // address. Chunk messages are parts of the object's payload if it is needed. + // All messages, except the first one, carry payload chunks. The requested + // object can be restored by concatenation of object message payload and all + // chunks keeping the receiving order. // // Extended headers can change `Get` behaviour: // * [ __SYSTEM__NETMAP_EPOCH ] \ @@ -26,9 +26,10 @@ service ObjectService { // calculation. // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` + // (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or the latest one + // otherwise) of Network Map to find an object until the depth limit is + // reached. // // Please refer to detailed `XHeader` description. // @@ -70,15 +71,16 @@ service ObjectService { // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; + // placement of an object of type TOMBSTONE that includes at least one + // locked object is prohibited; // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ // placement of an object of type LOCK that includes at least one object of // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // (for trusted object preparation) session private key does not exist or + // has // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. @@ -166,8 +168,8 @@ service ObjectService { // Get byte range of data payload. Range is set as an (offset, length) tuple. // Like in `Get` method, the response uses gRPC stream. Requested range can be - // restored by concatenation of all received payload chunks keeping the receiving - // order. + // restored by concatenation of all received payload chunks keeping the + // receiving order. // // Extended headers can change `GetRange` behaviour: // * [ __SYSTEM__NETMAP_EPOCH ] \ @@ -233,7 +235,8 @@ service ObjectService { rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); // Put the prepared object into container. - // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of an object MUST be set. + // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of + // an object MUST be set. // // Extended headers can change `Put` behaviour: // * [ __SYSTEM__NETMAP_EPOCH \ @@ -250,15 +253,16 @@ service ObjectService { // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; + // placement of an object of type TOMBSTONE that includes at least one + // locked object is prohibited; // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ // placement of an object of type LOCK that includes at least one object of // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // (for trusted object preparation) session private key does not exist or + // has // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. @@ -346,16 +350,16 @@ message PutRequest { // Object's Header Header header = 3; - // Number of copies of the object to store within the RPC call. By default, - // object is processed according to the container's placement policy. - // Can be one of: + // Number of copies of the object to store within the RPC call. By + // default, object is processed according to the container's placement + // policy. Can be one of: // 1. A single number; applied to the whole request and is treated as // a minimal number of nodes that must store an object to complete the // request successfully. // 2. An ordered array; every number is treated as a minimal number of // nodes in a corresponding placement vector that must store an object - // to complete the request successfully. The length MUST equal the placement - // vectors number, otherwise request is considered malformed. + // to complete the request successfully. The length MUST equal the + // placement vectors number, otherwise request is considered malformed. repeated uint32 copies_number = 4; } // Single message in the request stream. @@ -406,7 +410,7 @@ message DeleteRequest { message Body { // Address of the object to be deleted neo.fs.v2.refs.Address address = 1; - } + } // Body of delete object request message. Body body = 1; @@ -478,10 +482,10 @@ message HeadRequest { // 3. Check if `ObjectID` signature in `signature` field is correct message HeaderWithSignature { // Full object header - Header header = 1 [json_name = "header"]; + Header header = 1 [ json_name = "header" ]; // Signed `ObjectID` to verify full header's authenticity - neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; + neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ]; } // Object HEAD response @@ -490,7 +494,7 @@ message HeadResponse { message Body { // Requested object header, it's part or meta information about split // object. - oneof head{ + oneof head { // Full object's `Header` with `ObjectID` signature HeaderWithSignature header = 1; @@ -523,11 +527,11 @@ message SearchRequest { // Version of the Query Language used uint32 version = 2; - // Filter structure checks if the object header field or the attribute content - // matches a value. + // Filter structure checks if the object header field or the attribute + // content matches a value. // // If no filters are set, search request will return all objects of the - // container, including Regular object, Tombstones and Storage Group + // container, including Regular object and Tombstone // objects. Most human users expect to get only object they can directly // work with. In that case, `$Object:ROOT` filter should be used. // @@ -562,11 +566,11 @@ message SearchRequest { // properties: // // * $Object:ROOT \ - // Returns only `REGULAR` type objects that are not split or that are the top - // level root objects in a split hierarchy. This includes objects not + // Returns only `REGULAR` type objects that are not split or that are the + // top level root objects in a split hierarchy. This includes objects not // present physically, like large objects split into smaller objects // without a separate top-level root object. Objects of other types like - // StorageGroups and Tombstones will not be shown. This filter may be + // Locks and Tombstones will not be shown. This filter may be // useful for listing objects like `ls` command of some virtual file // system. This filter is activated if the `key` exists, disregarding the // value and matcher type. @@ -575,17 +579,17 @@ message SearchRequest { // activated if the `key` exists, disregarding the value and matcher type. // // Note: using filters with a key with prefix `$Object:` and match type - // `NOT_PRESENT `is not recommended since this is not a cross-version approach. - // Behavior when processing this kind of filters is undefined. + // `NOT_PRESENT `is not recommended since this is not a cross-version + // approach. Behavior when processing this kind of filters is undefined. message Filter { // Match type to use - MatchType match_type = 1 [json_name = "matchType"]; + MatchType match_type = 1 [ json_name = "matchType" ]; // Attribute or Header fields to match - string key = 2 [json_name = "key"]; + string key = 2 [ json_name = "key" ]; // Value to match - string value = 3 [json_name = "value"]; + string value = 3 [ json_name = "value" ]; } // List of search expressions repeated Filter filters = 3; @@ -668,7 +672,7 @@ message GetRangeResponse { // chunks. message Body { // Requested object range or meta information about split object. - oneof range_part{ + oneof range_part { // Chunked object payload's range. bytes chunk = 1; @@ -744,36 +748,35 @@ message GetRangeHashResponse { // Object PUT Single request message PutSingleRequest { - // PUT Single request body - message Body { - // Prepared object with payload. - Object object = 1; - // Number of copies of the object to store within the RPC call. By default, - // object is processed according to the container's placement policy. - // Every number is treated as a minimal number of - // nodes in a corresponding placement vector that must store an object - // to complete the request successfully. The length MUST equal the placement - // vectors number, otherwise request is considered malformed. - repeated uint32 copies_number = 2; - } - // Body of put single object request message. - Body body = 1; - - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; + // PUT Single request body + message Body { + // Prepared object with payload. + Object object = 1; + // Number of copies of the object to store within the RPC call. By default, + // object is processed according to the container's placement policy. + // Every number is treated as a minimal number of + // nodes in a corresponding placement vector that must store an object + // to complete the request successfully. The length MUST equal the placement + // vectors number, otherwise request is considered malformed. + repeated uint32 copies_number = 2; + } + // Body of put single object request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Object PUT Single response message PutSingleResponse { // PUT Single Object response body - message Body { - } + message Body {} // Body of put single object response message. Body body = 1; diff --git a/object/types.proto b/object/types.proto index 2af9b6a..41b785b 100644 --- a/object/types.proto +++ b/object/types.proto @@ -9,13 +9,12 @@ import "refs/types.proto"; import "session/types.proto"; // Type of the object payload content. Only `REGULAR` type objects can be split, -// hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by the maximum -// object size. +// hence `TOMBSTONE` and `LOCK` payload is limited by the +// maximum object size. // // String presentation of object type is the same as definition: // * REGULAR // * TOMBSTONE -// * STORAGE_GROUP // * LOCK enum ObjectType { // Just a normal object @@ -24,8 +23,8 @@ enum ObjectType { // Used internally to identify deleted objects TOMBSTONE = 1; - // StorageGroup information - STORAGE_GROUP = 2; + // Unused (previously storageGroup information) + // _ = 2; // Object lock LOCK = 3; @@ -53,59 +52,62 @@ enum MatchType { message ShortHeader { // Object format version. Effectively, the version of API library used to // create particular object. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Epoch when the object was created - uint64 creation_epoch = 2 [json_name = "creationEpoch"]; + uint64 creation_epoch = 2 [ json_name = "creationEpoch" ]; // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 3 [ json_name = "ownerID" ]; // Type of the object payload content - ObjectType object_type = 4 [json_name = "objectType"]; + ObjectType object_type = 4 [ json_name = "objectType" ]; // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown - uint64 payload_length = 5 [json_name = "payloadLength"]; + uint64 payload_length = 5 [ json_name = "payloadLength" ]; // Hash of payload bytes - neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; + neo.fs.v2.refs.Checksum payload_hash = 6 [ json_name = "payloadHash" ]; // Homomorphic hash of the object payload - neo.fs.v2.refs.Checksum homomorphic_hash = 7 [json_name = "homomorphicHash"]; + neo.fs.v2.refs.Checksum homomorphic_hash = 7 + [ json_name = "homomorphicHash" ]; } // Object Header message Header { // Object format version. Effectively, the version of API library used to // create particular object - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Object's container - neo.fs.v2.refs.ContainerID container_id = 2 [json_name = "containerID"]; + neo.fs.v2.refs.ContainerID container_id = 2 [ json_name = "containerID" ]; // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 3 [ json_name = "ownerID" ]; // Object creation Epoch - uint64 creation_epoch = 4 [json_name = "creationEpoch"]; + uint64 creation_epoch = 4 [ json_name = "creationEpoch" ]; // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. - uint64 payload_length = 5 [json_name = "payloadLength"]; + uint64 payload_length = 5 [ json_name = "payloadLength" ]; // Hash of payload bytes - neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; + neo.fs.v2.refs.Checksum payload_hash = 6 [ json_name = "payloadHash" ]; // Type of the object payload content - ObjectType object_type = 7 [json_name = "objectType"]; + ObjectType object_type = 7 [ json_name = "objectType" ]; // Homomorphic hash of the object payload - neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homomorphicHash"]; + neo.fs.v2.refs.Checksum homomorphic_hash = 8 + [ json_name = "homomorphicHash" ]; // Session token, if it was used during Object creation. Need it to verify // integrity and authenticity out of Request scope. - neo.fs.v2.session.SessionToken session_token = 9 [json_name = "sessionToken"]; + neo.fs.v2.session.SessionToken session_token = 9 + [ json_name = "sessionToken" ]; // `Attribute` is a user-defined Key-Value metadata pair attached to an // object. @@ -114,8 +116,8 @@ message Header { // Objects with duplicated attribute names or attributes with empty values // will be considered invalid. // - // There are some "well-known" attributes starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix - // that affect system behaviour: + // There are some "well-known" attributes starting with `__SYSTEM__` + // (`__NEOFS__` is deprecated) prefix that affect system behaviour: // // * [ __SYSTEM__UPLOAD_ID ] \ // (`__NEOFS__UPLOAD_ID` is deprecated) \ @@ -155,12 +157,12 @@ message Header { // corresponding section in NeoFS Technical Specification. message Attribute { // string key to the object attribute - string key = 1 [json_name = "key"]; + string key = 1 [ json_name = "key" ]; // string value of the object attribute - string value = 2 [json_name = "value"]; + string value = 2 [ json_name = "value" ]; } // User-defined object attributes - repeated Attribute attributes = 10 [json_name = "attributes"]; + repeated Attribute attributes = 10 [ json_name = "attributes" ]; // Bigger objects can be split into a chain of smaller objects. Information // about inter-dependencies between spawned objects and how to re-construct @@ -168,54 +170,54 @@ message Header { // must be within the same container. message Split { // Identifier of the origin object. Known only to the minor child. - neo.fs.v2.refs.ObjectID parent = 1 [json_name = "parent"]; + neo.fs.v2.refs.ObjectID parent = 1 [ json_name = "parent" ]; // Identifier of the left split neighbor - neo.fs.v2.refs.ObjectID previous = 2 [json_name = "previous"]; + neo.fs.v2.refs.ObjectID previous = 2 [ json_name = "previous" ]; // `signature` field of the parent object. Used to reconstruct parent. - neo.fs.v2.refs.Signature parent_signature = 3 [json_name = "parentSignature"]; + neo.fs.v2.refs.Signature parent_signature = 3 + [ json_name = "parentSignature" ]; // `header` field of the parent object. Used to reconstruct parent. - Header parent_header = 4 [json_name = "parentHeader"]; + Header parent_header = 4 [ json_name = "parentHeader" ]; // List of identifiers of the objects generated by splitting current one. - repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; + repeated neo.fs.v2.refs.ObjectID children = 5 [ json_name = "children" ]; // 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be // unique inside container. All objects participating in the split must have // the same `split_id` value. - bytes split_id = 6 [json_name = "splitID"]; - + bytes split_id = 6 [ json_name = "splitID" ]; } // Position of the object in the split hierarchy - Split split = 11 [json_name = "split"]; + Split split = 11 [ json_name = "split" ]; } // Object structure. Object is immutable and content-addressed. It means -// `ObjectID` will change if the header or the payload changes. It's calculated as a -// hash of header field which contains hash of the object's payload. +// `ObjectID` will change if the header or the payload changes. It's calculated +// as a hash of header field which contains hash of the object's payload. // // For non-regular object types payload format depends on object type specified // in the header. message Object { // Object's unique identifier. - neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "objectID"]; + neo.fs.v2.refs.ObjectID object_id = 1 [ json_name = "objectID" ]; // Signed object_id - neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; + neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ]; // Object metadata headers - Header header = 3 [json_name = "header"]; + Header header = 3 [ json_name = "header" ]; // Payload bytes - bytes payload = 4 [json_name = "payload"]; + bytes payload = 4 [ json_name = "payload" ]; } // Meta information of split hierarchy for object assembly. With the last part // one can traverse linked list of split hierarchy back to the first part and -// assemble the original object. With a linking object one can assemble an object -// right from the object parts. +// assemble the original object. With a linking object one can assemble an +// object right from the object parts. message SplitInfo { // 16 byte UUID used to identify the split object hierarchy parts. bytes split_id = 1; diff --git a/storagegroup/types.proto b/storagegroup/types.proto deleted file mode 100644 index b74f755..0000000 --- a/storagegroup/types.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.storagegroup; - -option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc;storagegroup"; -option csharp_namespace = "Neo.FileStorage.API.StorageGroup"; - -import "refs/types.proto"; - -// StorageGroup keeps verification information for Data Audit sessions. Objects -// that require paid storage guarantees are gathered in `StorageGroups` with -// additional information used for the proof of storage. `StorageGroup` only -// contains objects from the same container. -// -// Being an object payload, StorageGroup may have expiration Epoch set with -// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) well-known attribute. When expired, StorageGroup -// will be ignored by InnerRing nodes during Data Audit cycles and will be -// deleted by Storage Nodes. -// -message StorageGroup { - // Total size of the payloads of objects in the storage group - uint64 validation_data_size = 1 [json_name = "validationDataSize"]; - - // Homomorphic hash from the concatenation of the payloads of the storage - // group members. The order of concatenation is the same as the order of the - // members in the `members` field. - neo.fs.v2.refs.Checksum validation_hash = 2 [json_name = "validationHash"]; - - // DEPRECATED. Last NeoFS epoch number of the storage group lifetime - uint64 expiration_epoch = 3 [json_name = "expirationEpoch", deprecated = true]; - - // Strictly ordered list of storage group member objects. Members MUST be unique - repeated neo.fs.v2.refs.ObjectID members = 4 [json_name = "members"]; -}