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

Bring randomness in Emulator on par with testnet & mainnet #236

Closed
2 of 3 tasks
m-Peter opened this issue Nov 16, 2023 · 2 comments
Closed
2 of 3 tasks

Bring randomness in Emulator on par with testnet & mainnet #236

m-Peter opened this issue Nov 16, 2023 · 2 comments
Assignees

Comments

@m-Peter
Copy link

m-Peter commented Nov 16, 2023

Improve Randomness in Emulator

Grant category

Please select one:

  • Open source maintenance
  • Developer tools / services
  • Educational material

Description

The recent introduction of on-chain native randomness brought excitement to the community builders. This feature is available for usage in testnet & mainnet environments.

Problem statement

This feature, however, cannot be utilized from the Flow Emulator, as it does not have the notion of a system chunk transaction on every block commit. Hence, the RandomBeaconHistory contract does not record anything.

Proposed solution

The RandomBeaconHistory contract available on the emulator's service account needs a couple changes to be fully functional and mimic the behavior from testnet/mainnet environments.

  • We need to add the option fvm.WithRandomSourceHistoryCallAllowed(true) when configuring Emulator's blockchain
  • Up until now, the emulator did not have the notion of a system chunk transaction for every committed block. We need to add one, at least with a call on RandomBeaconHistory's heartbeat.

Impact

The Flow Emulator has evolved into a swiss army knife, which can be used for local development when building a dApp, or as a 3rd party library in all sorts of tools (including the Cadence testing framework). Having the randomness feature be on par with testnet & mainnet, will greatly enhance the DevEx.

Milestones and funding

Milestone Deliverables Timeline Risks USD proposal
1 - Implementation Merge onflow/flow-emulator#511 2 weeks - 3500

Total funding proposed: 3500 $

Team

Name Role Bio Contact
Ardit Marku Back-end Engineer A seasoned back-end engineer with a focus on problem solving and designing robust software systems. Over 9 years of experience building high-traffic search engines, marketplaces, exchanges and in-house analytics solutions. Led cross-functional teams to deliver both web and mobile apps, participating in all steps of the software development lifecycle. Open source lover and advocate. [email protected] m_peter
@m-Peter
Copy link
Author

m-Peter commented Nov 21, 2023

The relevant PR (onflow/flow-emulator#511) from Milestone 1 has been merged, so I think we can mark this as completed 🙏

@franklywatson
Copy link
Contributor

Great work thanks!

@github-project-automation github-project-automation bot moved this to Closed (withdrawn or passed) in Grants Overview Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed (withdrawn or passed)
Development

No branches or pull requests

2 participants