Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(resharding): enable resharding state sync and modify the reshard…
…ing state sanity checks accordingly (near#12546) Here we enable state sync after a resharding by removing the debug assert that prevented it, and we unignore the corresponding resharding TestLoop test. To make this work, we have to modify `assert_state_sanity_for_children_shard()`, because it currently assumes that the client tracks all shards. If we make the simple change of just checking whether the shard is tracked before proceeding, we'll run into a problem because memtries are unloaded at the end of an epoch, and this check was performed at the end of the test when the head of the chain is in a different epoch than the final head, so clients tracking a single shard won't have those memtries loaded anymore. So instead of making the check at the end, we can make it on every new block. The check is pretty quick anyway (<2 ms) and there's no harm in getting a bit more coverage. While we're at it, we also make the check for every shard rather than just the child shards, since it's a bit simpler and there's no downside to a bit more coverage. Performing the check on every block introduces a bit of extra work that needs to be done to make sure we're actually checking what we think we are, though. When checking flat storage and memtrie equality on arbitrary blocks, it might be the case that flat storage isn't ready because it's for a child shard that's still being created. This is not a big deal, because we just skip checking flat storage and memtrie equality in that case (but still check memtrie and trie equality). We could just leave it at that, but there's a risk that the test will silently not check what we think it was supposed to if there's a bug that prevents the flat storage comparison from happening for an entire epoch. So, we introduce a `struct TrieSanityCheck` to keep track of the shards for which we expect there to be flat storage and memtries (for each account for each epoch). Then at the end of the test we iterate over epoch IDs and make sure all expected checks were performed.
- Loading branch information