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

[Flow EVM] provide revertible randomness in EVM #5507

Closed
Tracked by #5536
ramtinms opened this issue Mar 5, 2024 · 5 comments · Fixed by #5742
Closed
Tracked by #5536

[Flow EVM] provide revertible randomness in EVM #5507

ramtinms opened this issue Mar 5, 2024 · 5 comments · Fixed by #5742
Assignees
Labels

Comments

@ramtinms
Copy link
Contributor

ramtinms commented Mar 5, 2024

See: #5507 (comment)

@sideninja
Copy link
Contributor

sideninja commented Apr 17, 2024

Investigate how the service account (through the contract) is affected using the randomness

@sideninja
Copy link
Contributor

Check devs requirements (Gio, Eric...)

@sideninja
Copy link
Contributor

@sideninja
Copy link
Contributor

Update on the design proposal. The transaction env exposed randomness source is not sufficient since it allows for reverting transactions if unfavorable outcomes.
We need to support the implementation of a commit-reveal scheme in the EVM thus requiring the random source per Flow height.
The proposed solution can work by calling the random beacon history contract to obtain random source which can then be used by PRG implemented in Solidity. The only caveat is that the Flow height must be used when determining reveal phase. This means EVM block height can not be used to determine if we can already reveal the random because the new Flow block is required for the random source to be updated. This can be achieved by using Cadence arch method getFlowHeight which will be used along with the commit.
We can implement a new Cadence arch method called getRandomSource(flowHeight: uint64) uint64 that will return a random source that can be used to deterministically generate random values.

@sideninja
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants