Skip to content
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

generate_seed mixes in get_active_index_root #945

Closed
dankrad opened this issue Apr 16, 2019 · 2 comments
Closed

generate_seed mixes in get_active_index_root #945

dankrad opened this issue Apr 16, 2019 · 2 comments

Comments

@dankrad
Copy link
Contributor

dankrad commented Apr 16, 2019

In the definition

def generate_seed(state: BeaconState,
                  epoch: Epoch) -> Bytes32:
    """
    Generate a seed for the given ``epoch``.
    """
    return hash(
        get_randao_mix(state, epoch - MIN_SEED_LOOKAHEAD) +
        get_active_index_root(state, epoch) +
        int_to_bytes32(epoch)
    )

Is there any reason to mix in the get_active_index_root? Currently this does not seem dangerous, but also does not provide any advantage as far as I can see. So with simplification in mind we could just remove it.
Also to protect RANDAO from biasability, it is advantageous to keep the seed as clean as possible. In case there would be any "instant changes" to the validator set, possibly introduced in some unforeseen spec version in the future, it would be unwise to have this in the mix.

@djrtwo
Copy link
Contributor

djrtwo commented Apr 16, 2019

This was added in #476 as per issue #459.

The specific rational is

We add the active index root into the shuffling seed to make sure that it is not possible to affect the shuffling in predictable ways by entering or exiting the validator set (there is a Fiat-Shamir-heuristic-like argument here: even if the attacker can "choose" the validator set, the protocol randomly chooses the shuffling after they do that)

@dankrad
Copy link
Contributor Author

dankrad commented Apr 17, 2019

Ah so we need it for light clients. Thanks

@dankrad dankrad closed this as completed Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants