Skip to content

Deploy randomness service#416

Merged
GabrielMartinezRodriguez merged 38 commits intomasterfrom
gabriel/deploy-randomness
Feb 17, 2025
Merged

Deploy randomness service#416
GabrielMartinezRodriguez merged 38 commits intomasterfrom
gabriel/deploy-randomness

Conversation

@GabrielMartinezRodriguez
Copy link
Contributor

@GabrielMartinezRodriguez GabrielMartinezRodriguez commented Feb 5, 2025

Links

The randomness service is already deployed and functioning with this contract: https://happy-testnet-sepolia.explorer.caldera.xyz/address/0xf4822fC7CB2ec69A5f9D4b5d4a59B949eFfa8311?tab=txs

Description

This PR adds the necessary changes to deploy the randomness service:

The changes include:

Added a GitHub Action to deploy the randomness service
Compiled migrations to be included in the bundler
Increased the tip so that the block is regenerated even if the sequencer already has a generated block (reference)
Increased the polling interval so that the reveal transaction lands exactly in the next block

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).

Reminder: PR review guidelines

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 have 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 Feb 5, 2025

Deploying happychain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7b83dfb
Status: ✅  Deploy successful!
Preview URL: https://df3110da.happychain.pages.dev
Branch Preview URL: https://gabriel-deploy-randomness.happychain.pages.dev

View logs

@GabrielMartinezRodriguez GabrielMartinezRodriguez marked this pull request as draft February 5, 2025 14:04
@norswap norswap added the draft Not ready for review label Feb 5, 2025
@GabrielMartinezRodriguez GabrielMartinezRodriguez added reviewing-1 Ready for, or undergoing first-line review and removed draft Not ready for review labels Feb 6, 2025
@GabrielMartinezRodriguez GabrielMartinezRodriguez marked this pull request as ready for review February 6, 2025 16:16
@GabrielMartinezRodriguez GabrielMartinezRodriguez changed the title feat: add randomness deployment workflow Deploy randomness service Feb 6, 2025
const inAirAttempts = transaction.getInAirAttempts()

console.log("In air attempts", inAirAttempts.map((a) => a.nonce))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those log statements left here on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed them. I was adding those logs to debug in production. I left one for now in BlockMonitor because I'm trying to understand a behavior in production

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, I removed that comment from this branch, and I'm trying to debug the deployed randomness by deploying from a more specific branch

}

private onNewBlock(block: LatestBlock) {
console.log("onNewBlock", JSON.stringify(block, bigIntReplacer, 2))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left on purpose? What's the plan?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed them. I was adding those logs to debug in production. I left one for now in BlockMonitor because I'm trying to understand a behavior in production

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, I removed that comment from this branch, and I'm trying to debug the deployed randomness by deploying from a more specific branch

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add the logger in now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, we don't have a console log here

@norswap norswap added question Something has to be cleared up after review and removed reviewing-1 Ready for, or undergoing first-line review labels Feb 9, 2025
@GabrielMartinezRodriguez GabrielMartinezRodriguez merged commit ad1a832 into master Feb 17, 2025
3 checks passed
@GabrielMartinezRodriguez GabrielMartinezRodriguez deleted the gabriel/deploy-randomness branch February 17, 2025 13:26
@linear linear bot mentioned this pull request Mar 27, 2025
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-blocked-after-changes Ready to merge but waiting for downstack, after requested changes are made

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants