-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lotus fetches drand from chain backwards with null blocks while specs fetches forward #3613
Comments
@nikkolasg I'd like to propose splitting this into two issues:
What do you think? |
There is an additional test that @arajasek is going to write before we close. |
Unfortunately, the fix in #6240 wasn't quite right. If the tipset corresponding to round N is null, when fetching randomness for round N we now return the entry at round N+1. This is also wrong (we were using N-1 before). This needs to be reopened and fixed in another network upgrade. |
Describe the bug
There is a diff with the spec as to how fetch drand entry from the chain.
Lotus will look backward in the chain as long as it doesn't find a drand entry inside (code). Also, given a certain epoch to fetch drand randomness from, Lotus starts from the round before if the height chosen falls on a null block (code).
The spec starts by deciding the minimum Filecoin block height and then looks forwards if it encounters null blocks (spec)
Expected behavior
In case of null rounds, drand entries will be inserted at later rounds (even adversarially) - so lotus should fetch it from later blocks as well.
Reasoning: Using this behavior, a malicious miner can decide to withold its block or not, and that changes the randomness for a given epoch. If he witholds the block at height
e
and he's the only winner, then the randomness associated with heighte
is the one at the block at heighte-1
. If he doesn't, then the randomness is the one associated with this block at heighte
.The text was updated successfully, but these errors were encountered: