Skip to content

Conversation

@GabrielMartinezRodriguez
Copy link
Contributor

@GabrielMartinezRodriguez GabrielMartinezRodriguez commented Dec 13, 2024

Linked Issues

Description

This PR aims to add the remaining logic to make the Random oracle contracts fully functional. The pending logic includes the submission of DRAND randomness and the implementation of a mechanism to combine our commitment/reveal contract with DRAND randomness.

More context:

Key changes:

  • Implemented the Drand verification contract.
  • Implemented Random contract to combine Drand and RandomCommitment functionalities.
  • Added two new environment variables.
  • Renamed the Random contract to RandomCommitment.
  • RandomCommitment now uses blocks instead of timestamps
  • Created a folder to house the three random-related contracts.
  • RandomCommitment and Drand are abstract contracts, which are extended by the Random contract.
Toggle Checklist

Checklist

Basics

  • B1. I have applied the proper label & proper branch name (e.g. norswap/build-system-caching).
  • B2. This PR is not so big that it should be split & addresses only one concern.
  • B3. The PR targets the lowest branch it can (ideally master).

Correctness

  • C1. Builds and passes tests.

  • C2. The code is properly parameterized & compatible with different environments (e.g. local,
    testnet, mainnet, standalone wallet, ...).

  • C3. I have manually tested my changes & connected features.

  • C4. I have performed a thorough self-review of my code after submitting the PR,
    and updated the code & comments accordingly.

Architecture & Documentation

  • D1. I made it easy to reason locally about the code, by (1) using proper abstraction boundaries,
    (2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
  • D2. All public-facing APIs & meaningful (non-local) internal APIs are properly documented in code
    comments.
  • D3. If appropriate, the general architecture of the code is documented in a code comment or
    in a Markdown document.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 13, 2024

Deploying happychain with  Cloudflare Pages  Cloudflare Pages

Latest commit: d6eaecb
Status: ✅  Deploy successful!
Preview URL: https://37bc8364.happychain.pages.dev
Branch Preview URL: https://gabriel-drand-contract.happychain.pages.dev

View logs

@GabrielMartinezRodriguez GabrielMartinezRodriguez changed the title Add drand-based randomness implementation Add drand contract Dec 13, 2024
@GabrielMartinezRodriguez GabrielMartinezRodriguez marked this pull request as ready for review December 13, 2024 15:30
@linear
Copy link

linear bot commented Dec 13, 2024

HAPPY-243 Drand Contract

Currently, we have only created the Random contract, which is used to submit random commitments. Now, we need to create the Drand contract, which is designed to submit randomness generated by https://drand.love. This randomness will then be combined with the submitted random commitments to produce a random number every two seconds

@GabrielMartinezRodriguez GabrielMartinezRodriguez changed the title Add drand contract Random contract with drand Dec 16, 2024
@GabrielMartinezRodriguez GabrielMartinezRodriguez added the reviewing-1 Ready for, or undergoing first-line review label Dec 16, 2024
@GabrielMartinezRodriguez GabrielMartinezRodriguez changed the title Random contract with drand Random Oracle contracts Dec 16, 2024
@GabrielMartinezRodriguez GabrielMartinezRodriguez changed the title Random Oracle contracts Random oracle contracts Dec 16, 2024
Base automatically changed from gabriel/purge-only-finalized to master February 4, 2025 11:22
@GabrielMartinezRodriguez GabrielMartinezRodriguez merged commit 7045709 into master Feb 4, 2025
3 checks passed
@GabrielMartinezRodriguez GabrielMartinezRodriguez deleted the gabriel/drand-contract branch February 4, 2025 11:46
This was referenced Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-blocked Ready to merge, waiting for downstack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants