Currently, we:
- Have an EVM precompile to fetch randomness.
- 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:
- 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).
- 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.