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

updated randomness sampling in fil to broaden ec solution to all rand… #642

Merged
merged 6 commits into from
Nov 20, 2019

Conversation

sternhenri
Copy link
Contributor

…omness given vdf removal

@whyrusleeping, this PR should do the following:

  • remove stale references to multiple tickets
  • generalize EC solution to null blocks to all ticket generation, namely: if attempting to draw a ticket from a null block, go back to prior parent and generate ticket with H(prior_ticket || epoch_num)
  • redraw ticket chain abstraction and code accordingly
    • including changing ticket output to be a SHA256 output in all cases (either of the ticket gone through vrf -- for live blocks -- or of the ticket || round, when drawing from null).

In order to ease all of this, I moved most of the ticket things to SPC readme.

Needs to be made to compile still.

@sternhenri
Copy link
Contributor Author

I only now get to your comments from #538 @jbenet. They were super useful, I'm sorry I missed them until now. And likewise, I now finally understand what you meant in your question there @whyrusleeping that I thought I had answered (was thinking solely in terms of EC randomness, not overall randomness). Sorry about that!

Copy link
Contributor

@zixuanzh zixuanzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging for velocity, @jzimmerman please review when you get a chance.

@zixuanzh zixuanzh merged commit 71760e3 into master Nov 20, 2019
@zixuanzh zixuanzh deleted the patch/randomness branch November 20, 2019 03:18
Copy link
Contributor

@jzimmerman jzimmerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some general notes:

  • I think it makes sense to have randomness primitives both in the runtime (as a VM context primitive available to actors) and in the relevant subsystems (as a pure function to extract randomness from chain state), but we shouldn't duplicate implementations (i.e., the former should be implemented in terms of calls to the latter).
  • See VM updates #637 for serialization APIs -- ideally, we would do something like the following for random seeds, to avoid potentially error-prone duplication/variation in seed generation methods:
type RandomnessRole int
const (
  RandomnessRole_TicketProduction RandomnessRole = 1+iota
  RandomnessRole_ElectionProof
  // ...
)

type RandomSeed []byte
DeriveRandomSeedExtended(role RandomnessRole, s Serialization) RandomSeed
DeriveRandomSeed(role RandomnessRole) RandomSeed
// Serialization methods "Serialize_T(T) Serialization" auto-generated as in https://github.com/filecoin-project/specs/pull/637

Randomness(epoch Epoch, seed RandomSeed)
  • We should set lookback parameters keeping in mind the possibility of null epochs.

@nikkolasg nikkolasg mentioned this pull request Nov 27, 2019
@sternhenri sternhenri mentioned this pull request Nov 29, 2019
4 tasks
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

Successfully merging this pull request may close these issues.

3 participants