-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [resharding] fix gas and balance redistribution during resharding (
#9449) During resharding we need to redistribute the gas and balance to the children shards. The old implementation relied on the fact that the split shards and indexed from 0. In the future reshardings this may not be the case, for example when splitting shard 3, the split shard ids will be 3 & 4. The principle idea of the distribution remains the same. Both quantities are distributed evenly across the children shards. If there is any remainder := quantity % num_split_shards, then we assign 1 extra unit to each of the first `remainder` children shards. e.g. splitting shard 3 -> 3' & 4' there is 5 gas to redistribute to children shard 3' will get 3 units of gas shard 4' will get 2 units of gas the old implementation relied on a math trick to do that, the new one takes a more engineering leaning approach
- Loading branch information
Showing
2 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters