From 39e353de00898dc1c5152d32dd16d80685693865 Mon Sep 17 00:00:00 2001 From: Waclaw Banasik Date: Wed, 6 Nov 2024 16:27:32 +0000 Subject: [PATCH 1/2] ShardId Semantics --- neps/nep-0568.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neps/nep-0568.md b/neps/nep-0568.md index 285d3524c..0f729b597 100644 --- a/neps/nep-0568.md +++ b/neps/nep-0568.md @@ -143,6 +143,10 @@ supporting smooth transitions without altering storage structures directly. ### ShardId Semantics +Currently, shard IDs are represented as numbers within the range `[0,n)`, where n is the total number of shards. These shard IDs are sorted in the same order as the account ID ranges assigned to them. While this approach is straightforward, it complicates resharding operations, particularly when splitting a shard in the middle of the range. Such a split requires reindexing all subsequent shards with higher IDs, adding complexity to the process. + +In this NEP, we propose updating the ShardID semantics to allow for arbitrary identifiers. Although ShardIDs will remain integers, they will no longer be restricted to the `[0,n)` range, and they may appear in any order. The only requirement is that each ShardID must be unique. In practice, during resharding, the ID of a parent shard will be removed from the ShardLayout, and the new child shards will be assigned unique IDs - `max(shard_ids)+1` and `max(shard_ids)+2`. + ## Reference Implementation ```text From d005643f70338d821219b5a8cd88d3abf266d464 Mon Sep 17 00:00:00 2001 From: Waclaw Banasik Date: Thu, 7 Nov 2024 11:27:36 +0000 Subject: [PATCH 2/2] ShardID -> ShardId --- neps/nep-0568.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neps/nep-0568.md b/neps/nep-0568.md index 0f729b597..98615acf0 100644 --- a/neps/nep-0568.md +++ b/neps/nep-0568.md @@ -145,7 +145,7 @@ supporting smooth transitions without altering storage structures directly. Currently, shard IDs are represented as numbers within the range `[0,n)`, where n is the total number of shards. These shard IDs are sorted in the same order as the account ID ranges assigned to them. While this approach is straightforward, it complicates resharding operations, particularly when splitting a shard in the middle of the range. Such a split requires reindexing all subsequent shards with higher IDs, adding complexity to the process. -In this NEP, we propose updating the ShardID semantics to allow for arbitrary identifiers. Although ShardIDs will remain integers, they will no longer be restricted to the `[0,n)` range, and they may appear in any order. The only requirement is that each ShardID must be unique. In practice, during resharding, the ID of a parent shard will be removed from the ShardLayout, and the new child shards will be assigned unique IDs - `max(shard_ids)+1` and `max(shard_ids)+2`. +In this NEP, we propose updating the ShardId semantics to allow for arbitrary identifiers. Although ShardIds will remain integers, they will no longer be restricted to the `[0,n)` range, and they may appear in any order. The only requirement is that each ShardId must be unique. In practice, during resharding, the ID of a parent shard will be removed from the ShardLayout, and the new child shards will be assigned unique IDs - `max(shard_ids)+1` and `max(shard_ids)+2`. ## Reference Implementation