Implement solution for #1446, based on suggested use of eth1 hash #1447
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, I am very aware that the use of block hashes does not provide great randomness.
However, the concern was that the selection of committees of the early epochs could realistically be biased by deposit ordering manipulation. Setting some initial randomness, even if biasable by a few bits, should help work around this attack vector.
This solution came out of a conversation between @paulhauner and @djrtwo in #1446, but I am open to any better alternatives.
Also note that I adapted it to:
LOOKAHEAD
constantas seed, and set different randao mixes.Alternatively we could also fill the whole mixes array with seeded hashes: no concern about exact
LOOKAHEAD
value, but much more work (mainnet history size =2**16
). Or we do not care about different mixes, and copy over the eth1 hash.Edit: not as seed, just plain copy, and into the full extent of the randao-mixes (less error prone, more minimal). Thanks to Justin for pointing out that
get_seed
already mixes in the epoch, for us to not care about duplicate randao mixes here, just what we need.