Skip to content

Conversation

@GabrielMartinezRodriguez
Copy link
Contributor

@GabrielMartinezRodriguez GabrielMartinezRodriguez commented Dec 9, 2024

Linked Issues

Description

Adds SQLite persistence to the randomness service for storing commitments. This ensures commitments are not lost on service restart and enables proper pruning of old commitments.

Key changes:

  • Added SQLite database integration with Kysely ORM
  • Created migration for commitments table
  • Implemented commitment persistence and pruning logic
  • Modified service startup to load existing commitments from database
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.
  • C3. I have manually tested my changes & connected features.

Tested with:

  • Local development environment

Scenarios tested:

  • Service startup with empty database

  • Service startup with existing commitments

  • Commitment persistence across restarts

  • Automatic pruning of old commitments

  • C4. I have performed a thorough self-review of my code.

Architecture & Documentation

  • D1. I made it easy to reason locally about the code.
  • D2. All public-facing APIs & meaningful internal APIs are properly documented.
  • D3. If appropriate, the general architecture is documented.

@cloudflare-workers-and-pages
Copy link

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

Deploying happychain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3dc92b0
Status: ✅  Deploy successful!
Preview URL: https://29f72172.happychain.pages.dev
Branch Preview URL: https://gabriel-db-randomnes-service.happychain.pages.dev

View logs

@GabrielMartinezRodriguez GabrielMartinezRodriguez added the reviewing-1 Ready for, or undergoing first-line review label Dec 9, 2024
import type { CommitmentInfo } from "../CommitmentManager"

export interface CommitmentInfoTable {
// The timestamp is stored as a number because Kisely automatically converts bigint to number
Copy link
Collaborator

Choose a reason for hiding this comment

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

@norswap norswap added updating Updating after review and removed reviewing-1 Ready for, or undergoing first-line review labels Jan 5, 2025
@norswap norswap added merge-after-changes Can be merged after requested changes are made and removed reviewing-2 Ready for, or undergoing final review labels Jan 12, 2025
@GabrielMartinezRodriguez GabrielMartinezRodriguez added merge-blocked Ready to merge, waiting for downstack and removed merge-after-changes Can be merged after requested changes are made labels Jan 14, 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.

5 participants