Skip to content

fix(common): introduce PERSISTENT_TTL_EXTEND_TO constant used by both TTL helpers - #918

Merged
chonilius merged 2 commits into
MergeFi:mainfrom
christianahtemitope2005:fix/issues-824-829-826-825
Nov 21, 2026
Merged

chonilius merged 2 commits into
MergeFi:mainfrom
christianahtemitope2005:fix/issues-824-829-826-825

Conversation

@christianahtemitope2005

Copy link
Copy Markdown
Contributor

Problem

extend_ttl_for_target hardcoded 500_000 as the minimum extend_to baseline with a comment stating it "mirrors extend_ttl's own extend_to". But extend_ttl also hardcoded 500_000 as a separate literal, so changing one did not change the other — the invariant the comment claimed was not enforced by code (#826).

Fix

Introduce pub const PERSISTENT_TTL_EXTEND_TO: u32 = 500_000 and use it in both helpers:

  • extend_ttl: extend_ttl(key, 100_000, PERSISTENT_TTL_EXTEND_TO)
  • extend_ttl_for_target: .max(PERSISTENT_TTL_EXTEND_TO as u64)

Tuning this one constant now keeps both helpers in sync automatically.

Closes #826
Closes #824
Closes #829
Closes #825

Replace the hardcoded 500_000 literal in extend_ttl_for_target with the
new pub const PERSISTENT_TTL_EXTEND_TO: u32 = 500_000, which extend_ttl
also now references. Tuning one constant now keeps both helpers in sync.

Closes MergeFi#826
Closes MergeFi#824
Closes MergeFi#829
Closes MergeFi#825
@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

@christianahtemitope2005 is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 21, 2026

Copy link
Copy Markdown

@christianahtemitope2005 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chonilius
chonilius merged commit 08fa318 into MergeFi:main Nov 21, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment