Crate pallet_sassafras
source ·Expand description
Extension module for Sassafras consensus.
Sassafras is a constant-time block production protocol that aims to ensure that there is exactly one block produced with constant time intervals rather than multiple or none.
We run a lottery to distribute block production slots in an epoch and to fix the order validators produce blocks in, by the beginning of an epoch.
Each validator signs the same VRF input and publishes the output on-chain. This value is their lottery ticket that can be validated against their public key.
We want to keep lottery winners secret, i.e. do not publish their public keys. At the beginning of the epoch all the validators tickets are published but not their public keys.
A valid tickets is validated when an honest validator reclaims it on block production.
To prevent submission of fake tickets, resulting in empty slots, the validator when submitting the ticket accompanies it with a SNARK of the statement: “Here’s my VRF output that has been generated using the given VRF input and my secret key. I’m not telling you my keys, but my public key is among those of the nominated validators”, that is validated before the lottery.
To anonymously publish the ticket to the chain a validator sends their tickets to a random validator who later puts it on-chain as a transaction.
Re-exports§
pub use weights::WeightInfo;
pub use pallet::*;
Modules§
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - Autogenerated weights for
pallet_sassafras
Structs§
- An
EpochChangeTrigger
which does nothing. - An
EpochChangeTrigger
which recycle the same authorities set forever. - Tickets metadata.
Traits§
- Trigger an epoch change, if any should take place.
Type Aliases§
- Authorities bounded vector convenience type.
- Epoch length defined by the configuration.