Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
forknet: support arbitrary shard layouts (#12938)
We'd like to use forknet with more shards than we have currently on mainnet, or just any arbitrary shard layout. But it won't work to just change the shard layout in the genesis file, since we need to rewrite everything in the tries. So this PR implements support for an optional custom shard layout when generating the state. To do this, we use the existing `StorageMutator` that keeps a list of updates per shard, and we change it to be aware of which shards belong to the source shard layout and which belong to the target. We still have one thread per source shard, but now it writes state to shards that possibly don't exist in the shard layout. This also requires writing a new bandwidth scheduler state in each target shard that doesn't exist in the source shard layout
- Loading branch information