The Anatomy of a Fork: Simulating Slot Collisions in Substrate

Kian, Bastien thanks for stopping by. It’s an honor to have the core team looking at this.

Bastien, to your point about standard tutorials, that’s exactly what drove me to build this. the “black box” nature of the macros is excellent for production speed, but it often masks the underlying distributed systems logic. This codebase is my attempt to decouple the Consensus Mechanics from the FRAME machinery so I can verify invariants in a controlled, bare-metal environment.

Kian, I’m actually iterating on this specifically to explore more advanced slot-leadership models. Some of you might remember my previous series on Sassafras.

The “Eureka” moment I had with these slot collisions really highlighted why Sassafras’s attempt to achieve Single Secret Leader Election (SSLE) is such a game-changer. My plan for Phase 3/4 is to move beyond the probabilistic BABE threshold and simulate a “Semi-Sassafras” model where we can see the impact of exact leadership on fork density during high network jitter.

What’s currently in progress:

The repo is now live for anyone who wants to audit my logic (and likely tell me where my SCALE encoding is slightly off!): GitHub - Kanasjnr/substrate-consensus-lab · GitHub

Looking forward to hearing any specific experiments/edge cases the team would love to see simulated in a “bare-bones” environment like this.