Skip to content

Limits: Fetch "vrfdigest" from the client instead of letting the client draw randomness #1277

@Stebalien

Description

@Stebalien

Currently, we:

  1. Have an EVM precompile to fetch randomness.
  2. Have no real limit on size of the "entropy" we allow.

Honestly, that's fine as long as we charge for the hashing (which we can do). However, the current "extern" APIs pass the entire entropy into lotus and copy it. That's not ok.

Instead, we should:

  1. Provide an extern that just returns the VRFDigest (https://github.com/filecoin-project/lotus/blob/1ba2f23efcc99a5ce94057cf2a043ecc3376940a/chain/rand/rand.go#L30) for some given epoch (drand or chain).
  2. Do all the heavy lifting in the FVM (so we don't need to copy).

In the future, we should replace these syscalls entirely with syscalls that just get the VRFDigest, computing the actual randomness inside the actors.

Metadata

Metadata

Assignees

Labels

P0P0: Critical blocker

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions