Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

pallet-lottery: deal with randomness freshness #8311

Open
andresilva opened this issue Mar 10, 2021 · 2 comments
Open

pallet-lottery: deal with randomness freshness #8311

andresilva opened this issue Mar 10, 2021 · 2 comments
Labels
I2-security The client fails to follow expected, security-sensitive, behaviour.

Comments

@andresilva
Copy link
Contributor

#8180 changed the randomness API to also explicitly return how fresh some random material is. In order to safely use this entropy any commitments based on it must have been made before the randomness was known. In the context of the lottery pallet it means that people should only be able to sign up for the lottery to the point where we fetch the random data that will decide the winner, e.g. we accept new participants until block #50, on block #50 we get new (fresh) random material which is used later on to randomly select the winner.

@andresilva andresilva added the I2-security The client fails to follow expected, security-sensitive, behaviour. label Mar 10, 2021
@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 7, 2021
@burdges
Copy link

burdges commented Sep 19, 2022

I've not looked at pallet_lottery but in general it depends upon the usage of the lottery.

It's clearly impossible for any blockchain to simultaneously close a lottery and produce randomness with which to decide the lottery, but you might survive doing this if the lottery was low enough value.

In our case, all block producers learn their babe/sassafras VRFs two/three epochs in advance, so you either need commitments to participate way in advance or else you need something like the random close time we use in elections.

@stale stale bot removed the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I2-security The client fails to follow expected, security-sensitive, behaviour.
Projects
None yet
Development

No branches or pull requests

2 participants