Skip to content

fix: add TTL to soft tx validation cache for relay node mempool cleanup (#737)#748

Merged
gilescope merged 2 commits into
mainfrom
ozgb-soft-cache-ttl-main
Feb 23, 2026
Merged

fix: add TTL to soft tx validation cache for relay node mempool cleanup (#737)#748
gilescope merged 2 commits into
mainfrom
ozgb-soft-cache-ttl-main

Conversation

@ozgb

@ozgb ozgb commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Overview

Rebase of #737

The soft validation cache only had time-to-idle (TTI), which resets on
every access. On relay nodes (non-block-producers), pool revalidation
continuously accesses cached entries, preventing TTI expiry. Since relay
nodes never call do_validate_guaranteed_execution (block authoring only),
the soft cache is never explicitly invalidated either — causing invalid
transactions to persist in the mempool indefinitely.

Adding a 60-second time-to-live (TTL) ensures entries are unconditionally
evicted, forcing a fresh apply() check against current ledger state on
the next revalidation cycle.

JIRA: https://shielded.atlassian.net/browse/PM-21787

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

…up (#737)

* fix: add TTL to soft tx validation cache to evict stale entries on relay nodes

The soft validation cache only had time-to-idle (TTI), which resets on
every access. On relay nodes (non-block-producers), pool revalidation
continuously accesses cached entries, preventing TTI expiry. Since relay
nodes never call do_validate_guaranteed_execution (block authoring only),
the soft cache is never explicitly invalidated either — causing invalid
transactions to persist in the mempool indefinitely.

Adding a 60-second time-to-live (TTL) ensures entries are unconditionally
evicted, forcing a fresh apply() check against current ledger state on
the next revalidation cycle.

JIRA: PM-21787

* chore: add change file for soft cache TTL fix

* fix: upgrade eslint and fix lint errors to resolve npm audit high vulnerabilities

Upgrade eslint (^4.0.0 → ^9.29.0), typescript-eslint (^7.3.1 → ^8.33.0),
and minimatch override (10.1.2 → 10.2.1) to resolve all 11 high severity
npm audit vulnerabilities. Fix switch fallthrough bug in run.ts and suppress
no-require-imports in standalone JS worker script.
@ozgb ozgb requested a review from a team as a code owner February 23, 2026 09:34
@gilescope gilescope enabled auto-merge February 23, 2026 09:36
@github-actions

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.16

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 96
LOW LOW 12
INFO INFO 83
TRACE TRACE 0
TOTAL TOTAL 191
Metric Values
Files scanned placeholder 31
Files parsed placeholder 31
Files failed to scan placeholder 0
Total executed queries placeholder 73
Queries failed to execute placeholder 0
Execution time placeholder 8

@gilescope

Copy link
Copy Markdown
Contributor

blocked on a fix in #745

@gilescope gilescope added this pull request to the merge queue Feb 23, 2026
@gilescope gilescope removed this pull request from the merge queue due to a manual request Feb 23, 2026
@gilescope gilescope added this pull request to the merge queue Feb 23, 2026
Merged via the queue into main with commit f776238 Feb 23, 2026
36 of 37 checks passed
@gilescope gilescope deleted the ozgb-soft-cache-ttl-main branch February 23, 2026 12:26
gilescope pushed a commit that referenced this pull request Apr 8, 2026
fixed:
- api.get_block() was calling substrate.get_block() twice

removed:
- devnet 1.5.1 nightly job

changed:
- ci-preview new deployment mc epoch
m2ux added a commit that referenced this pull request Apr 23, 2026
fixed:
- api.get_block() was calling substrate.get_block() twice

removed:
- devnet 1.5.1 nightly job

changed:
- ci-preview new deployment mc epoch
Signed-off-by: Mike Clay <mike.clay@shielded.io>
m2ux added a commit that referenced this pull request Apr 23, 2026
fixed:
- api.get_block() was calling substrate.get_block() twice

removed:
- devnet 1.5.1 nightly job

changed:
- ci-preview new deployment mc epoch
Signed-off-by: Mike Clay <mike.clay@shielded.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants