From fcbf8f898832239c41bdaf9a6b1007395acd219e Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 5 Feb 2024 18:22:35 +0300 Subject: [PATCH] object: Use the first object part as a split ID There is no need to generate some UUID with non-specified rules if the first object part allows the same identification routines but uses hashes widely accepted in the protocol. Signed-off-by: Pavel Karpy --- CHANGELOG.md | 1 + object/types.proto | 11 +++++++++++ proto-docs/object.md | 6 ++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca6c76c..f45bd16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - `LINK` split chain object type (#283) ### Changed +- Split ID is deprecated, the first child part is used instead and is known to the other parts (#283) ### Removed diff --git a/object/types.proto b/object/types.proto index f3dca1c..46d33e7 100644 --- a/object/types.proto +++ b/object/types.proto @@ -194,11 +194,16 @@ message Header { // List of identifiers of the objects generated by splitting current one. repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; + // DEPRECATED. Was used as an identifier of a split chain. Use the first + // part ID instead. // 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"]; + // Identifier of the first part of the origin object. Known to all the split + // parts except the first one. Identifies the split and allows to differ them. + neo.fs.v2.refs.ObjectID first = 7 [json_name = "first"]; } // Position of the object in the split hierarchy Split split = 11 [json_name = "split"]; @@ -229,6 +234,8 @@ message Object { // assemble the original object. With a linking object one can assemble an object // right from the object parts. message SplitInfo { + // DEPRECATED. Was used as an identifier of a split chain. Use the first + // part ID instead. // 16 byte UUID used to identify the split object hierarchy parts. bytes split_id = 1; @@ -240,4 +247,8 @@ message SplitInfo { // split header with the original object header and a sorted list of // object parts. neo.fs.v2.refs.ObjectID link = 3; + + // Identifier of the first part of the origin object. Known to all the split + // parts except the first one. Identifies the split and allows to differ them. + neo.fs.v2.refs.ObjectID first_part = 4; } diff --git a/proto-docs/object.md b/proto-docs/object.md index 9c475af..9ee7d17 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -955,7 +955,8 @@ must be within the same container. | parent_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `signature` field of the parent object. Used to reconstruct parent. | | parent_header | [Header](#neo.fs.v2.object.Header) | | `header` field of the parent object. Used to reconstruct parent. | | children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | DEPRECATED. Was used before creating the separate LINK object type. Keep child objects list in the LINK object's payload. List of identifiers of the objects generated by splitting current one. | -| split_id | [bytes](#bytes) | | 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. | +| split_id | [bytes](#bytes) | | DEPRECATED. Was used as an identifier of a split chain. Use the first part ID instead. 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. | +| first | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the first part of the origin object. Known to all the split parts except the first one. Identifies the split and allows to differ them. | @@ -1005,9 +1006,10 @@ right from the object parts. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. | +| split_id | [bytes](#bytes) | | DEPRECATED. Was used as an identifier of a split chain. Use the first part ID instead. 16 byte UUID used to identify the split object hierarchy parts. | | last_part | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | The identifier of the last object in split hierarchy parts. It contains split header with the original object header. | | link | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | The identifier of a linking object for split hierarchy parts. It contains split header with the original object header and a sorted list of object parts. | +| first_part | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the first part of the origin object. Known to all the split parts except the first one. Identifies the split and allows to differ them. |