Skip to content

Commit

Permalink
forknet: support arbitrary shard layouts (#12938)
Browse files Browse the repository at this point in the history
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
marcelo-gonzalez authored Feb 19, 2025
1 parent f7ef0a1 commit ac5aa6a
Show file tree
Hide file tree
Showing 3 changed files with 617 additions and 308 deletions.
Loading

0 comments on commit ac5aa6a

Please sign in to comment.