onflow / developer-grants

Grants for developers that contribute to the broader developer ecosystem
Apache License 2.0
50 stars 18 forks source link

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

Closed m-Peter closed 12 months ago

m-Peter commented 1 year ago

Improve Randomness in Emulator

Grant category

Please select one:

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.

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 https://github.com/onflow/flow-emulator/pull/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. markoupetr@gmail.com m_peter
m-Peter commented 1 year ago

The relevant PR (https://github.com/onflow/flow-emulator/pull/511) from Milestone 1 has been merged, so I think we can mark this as completed :pray:

franklywatson commented 12 months ago

Great work thanks!