Skip to content

Only prune finalized randomness entries#305

Merged
GabrielMartinezRodriguez merged 1 commit intomasterfrom
gabriel/purge-only-finalized
Feb 4, 2025
Merged

Only prune finalized randomness entries#305
GabrielMartinezRodriguez merged 1 commit intomasterfrom
gabriel/purge-only-finalized

Conversation

@GabrielMartinezRodriguez
Copy link
Contributor

@GabrielMartinezRodriguez GabrielMartinezRodriguez commented Dec 11, 2024

Linked Issues

Description

Added a new constant FINALIZED_STATUSES to track completed randomness states and modified the pruning logic to only remove entries that have reached a final status. This prevents premature deletion of active randomness entries.

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

@GabrielMartinezRodriguez GabrielMartinezRodriguez marked this pull request as ready for review December 11, 2024 10:56
@GabrielMartinezRodriguez GabrielMartinezRodriguez added the reviewing-1 Ready for, or undergoing first-line review label Dec 11, 2024
@cloudflare-workers-and-pages
Copy link

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

Deploying happychain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 984cfaa
Status: ✅  Deploy successful!
Preview URL: https://9cc5c283.happychain.pages.dev
Branch Preview URL: https://gabriel-purge-only-finalized.happychain.pages.dev

View logs

@linear
Copy link

linear bot commented Dec 11, 2024

db
.deleteFrom("randomnesses")
.where("timestamp", "<", Number(latestBlockTimestamp) - COMMITMENT_PRUNE_INTERVAL_SECONDS)
.where("status", "in", FINALIZED_STATUSES)
Copy link
Contributor

Choose a reason for hiding this comment

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

mentioned in the other PR also, but do you want to prune this.map here as well?

@GabrielMartinezRodriguez GabrielMartinezRodriguez mentioned this pull request Dec 20, 2024
10 tasks
@norswap norswap added merge-blocked Ready to merge, waiting for downstack and removed reviewing-1 Ready for, or undergoing first-line review labels Jan 12, 2025
@GabrielMartinezRodriguez GabrielMartinezRodriguez mentioned this pull request Feb 3, 2025
10 tasks
Base automatically changed from gabriel/on-new-block to master February 4, 2025 11:08
@GabrielMartinezRodriguez GabrielMartinezRodriguez merged commit f8c5c0d into master Feb 4, 2025
3 checks passed
@GabrielMartinezRodriguez GabrielMartinezRodriguez deleted the gabriel/purge-only-finalized branch February 4, 2025 11:22
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.

3 participants