-
Notifications
You must be signed in to change notification settings - Fork 378
Include babe randomness in the relay chain proof #463
Comments
I'll remake that paritytech/substrate#8180 gives two nicer names, although We'll want We want If someone wants a better randomness source, but not in consensus, then |
@burdges This may be a dumb question, but could you explain (or link to somewhere that explains) why older randomness is better for conensus? Following the definition of "unpredictability" from the fantomette paper https://arxiv.org/pdf/1805.06786.pdf (which I learned of from you; thanks for that):
It is good if the leader election is unpredictable because adversaries can't mount a targeted attack against the next leader(s) as easily. When it isn't possible to have the leader truly unpredictable up to the moment of publishing a valid block, it is better to be "more unpredictable" by having the step barrier later in the protocol. It seems like using randomness from two epochs ago is the least unpredictable. Have I missed something? Or are you saying randomness from two epochs ago is better for a reason that is not related to unpredictability? |
We want finality on VRF inputs before using them in BABE, and ditto ring VRF inputs in Sassafras, because otherwise we cannot so easily detect equivocation in block production, meaning building upon multiple forks, so adding a full epoch helps ensure finality. I suppose "one full epoch ago" and "previous epoch" might make more sense. VRF keys should be registered before all VRF inputs become known by anyone, so this pushed VRF key registration even further back into the past. If you're not worried about equivocations then you do not need to wait so long, but an epoch rendomness is still harder to manipulate or know in advance. |
Phala requires VRF for probabilistic payment distribution. Unpredictable property is good, but a delay is acceptable (i.e. we know the randomness of the next a few blocks, but not later). Background: On our network, a large amount of off-chain agents are registered on the blockchain. At every block we randomly sample a small subset of the agents, and send them online challenges. They must respond the challenge in order to keep their running state. To reduce the burden on the blockchain, the sample size is small (~20 per block). |
Right now, we stupidly use a Vec to accumulate the babe VRF outputs for the subsequent epoch randomnesses. We'll replace this by a hash accumulator |
Moonbeam requires access to Where is the relay state proof code where we could include this randomness data? |
Sorry for the late reply.
|
Thanks @bkchr , so we have to add a storage item to parachain system for the randomness? And a trait with an impl by parachain system to expose it for other pallets. |
Better to store the entire proof for now with all its values. As I said, I think that doesn't exist yet. |
Done now, ty @4meta5 |
Before we have paritytech/polkadot-sdk#82, we should include the randomness manually for now.
This will enable parachain teams to use the randomness provided by the relay chain.
@burdges @andresilva which of randomness should we provide:
While 3. requires that we change Substrate to not delete it at the end of a block.
The text was updated successfully, but these errors were encountered: