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

Construct the FVM with randomness info #525

Open
Stebalien opened this issue May 3, 2022 · 2 comments
Open

Construct the FVM with randomness info #525

Stebalien opened this issue May 3, 2022 · 2 comments
Milestone

Comments

@Stebalien
Copy link
Member

Currently, we need to pay an "extern" cost to get the randomness. However, we can pretty easily construct the FVM with 2x finality randomness information to avoid having to go back to the client to "fetch" it on demand.

Specifically, we need:

  1. The minimum VRFTicket from each tipset (96 bytes)
  2. The drand ticket from each tipset (32 bytes)

And we need 1800 of these.

Specifically, we should pass a Boxed Randomness as follows:

type VRFTicket = [u8; 96];
type DrandTicket = [u8; 32];

type EpochRandomness {
    chain: VRFTicket, // all zeros means this was a null tipset (could also use a boolean flag?)
    drand: DrandTicket,
}

// A ring buffer of 1800 epochs worth of randomness.
struct Randomness {
   pub head: u64, // The first element in the ring buffer.
   pub first_epoch: u64, // The first epoch in the ring buffer.
   pub rand:  [EpochRandomness; 1800], // a ring buffer of randomness.
}

The client would then "lend" a Box<Randomness> to the FVM, updating the randomness between epochs.

@maciejwitowski
Copy link
Contributor

@Stebalien do we need it for M2.1?

@Stebalien
Copy link
Member Author

No, actually. We can probably punt this (if we ever need to do it).

@Stebalien Stebalien modified the milestones: M2.1, M2.2 Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants