Sharding is a natural way to scale the EVM, and we try to show the feasibility of sharding by implementing a proof-of-concept of protocols previously only available in theory!
What it does
- Hierarchical Level1 sharding implementation: EVM-enabled shards are arranged in a tree. Shards adjacent to each other in the tree can communicate with their neighbors.
- Xshard message routing: messages destined to a shard that aren't a neighbor of its shard holding the message will be routed in multiple hops via intermediate shards;
- Topology rebalancing: the configuration of the shards tree can change dynamically, at any time
- Smart fork-choice rule that respects the shards hierarchy that enables atomic cross-shard transactions, by preventing the finalization of atomicity failures
- Shard messages are guarantee to only be received once and in order
- Visualization with sliding windows allows us to picture many shards executing and communicating
How We built it
We started with an publicly available prototype, that had only two shards, we generalized it for any number of shards in any configuration, added transactions routing and introduced the topology rebalancing, and dramatically improved the visualization.
Challenges We ran into
The fork choice rule isn't specified and using it isn't enough to guarantee that you won't invalid blocks. Reasoning about the block construction process (and how it related to the fork choice rule, Xshard messages, routing, switching positions) can be challenging. It often took hours to find bugs that lead to the production of invalid blocks in edge cases.
Accomplishments that we're proud of
We actually managed to make it work. Demo time!
What We learned
New shard-position-agnostic fork choice rule, new topology rebalancing algorithms.
What's next for Atomic XShard Transactions with Routing and Balancing PoC
Adding a light client and a wallet; Generalizing the rebalancing further; adding explicit finality, adding proof of stake
Mainnet or bust!