From d95855afeea8af64537c4f042d6b38e6f05d9dd4 Mon Sep 17 00:00:00 2001 From: Andrea Date: Fri, 3 Jan 2025 16:44:45 +0100 Subject: [PATCH] docs: add a TODO to flat storage resharder (#12680) Adding a TODO to remember to put in place a debug assertion inside the `shard_uid` sanity check. --- chain/chain/src/flat_storage_resharder.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chain/chain/src/flat_storage_resharder.rs b/chain/chain/src/flat_storage_resharder.rs index a362fbb5a3c..83a9434115d 100644 --- a/chain/chain/src/flat_storage_resharder.rs +++ b/chain/chain/src/flat_storage_resharder.rs @@ -1027,6 +1027,12 @@ fn copy_kv_to_child( if new_shard_uid != *left_child_shard && new_shard_uid != *right_child_shard { let err_msg = "account id doesn't map to any child shard! - skipping it"; warn!(target: "resharding", ?new_shard_uid, ?left_child_shard, ?right_child_shard, ?shard_layout, ?account_id, err_msg); + + // TODO(resharding): add a debug assertion once the root cause is fixed. The current + // hypothesis is that flat storage might contain keys with account_id outside of the shard's + // boundary due to either a bug in the state generation for forknet or corrupted state in + // mainnet. + // Do not fail resharding. Just skip this entry. return Ok(()); }