Skip to content

Commit

Permalink
object: Use the first object part as a split ID
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
carpawell committed Feb 5, 2024
1 parent 90a979b commit fcbf8f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions object/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down Expand Up @@ -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;

Expand All @@ -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;
}
6 changes: 4 additions & 2 deletions proto-docs/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |


<a name="neo.fs.v2.object.Object"></a>
Expand Down Expand Up @@ -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. |

<!-- end messages -->

Expand Down

0 comments on commit fcbf8f8

Please sign in to comment.