Skip to content

Feat/multi 710 711 712 713 - #770

Open
Feyisara2108 wants to merge 4 commits into
Parashield-Protocol:mainfrom
Feyisara2108:feat/multi-710-711-712-713
Open

Feyisara2108 wants to merge 4 commits into
Parashield-Protocol:mainfrom
Feyisara2108:feat/multi-710-711-712-713

Conversation

@Feyisara2108

Copy link
Copy Markdown

Closes #710
Closes #711
Closes #712
Closes #713

…col#710)

Redis previously relied on ioredis' background retryStrategy, so a failed
initial connection never surfaced as a startup error and could reconnect
indefinitely without a clear signal.

Add a dedicated startup handshake: create the client with lazyConnect, retry
the first connection with exponential backoff, capped delay, jitter and a
per-attempt timeout, and fail startup with one actionable host:port error
(without leaking credentials). Once connected, runtime reconnection is handed
back to ioredis.

Retries are tunable via REDIS_STARTUP_MAX_ATTEMPTS,
REDIS_STARTUP_INITIAL_DELAY_MS, REDIS_STARTUP_MAX_DELAY_MS and
REDIS_STARTUP_ATTEMPT_TIMEOUT_MS; invalid values fail config validation.
…-Protocol#711)

Express advertises the stack via X-Powered-By, and reverse proxies/upstreams
can add Server, X-Runtime, Via and ASP.NET version headers. These give attackers
an easy fingerprint of the technology in use.

Disable X-Powered-By at the framework level, keep helmet applied, and strip the
leaky headers at the header level (wrapping res.setHeader/res.writeHead so it
also covers headers added after the middleware runs). Extra header names can be
stripped via extraHeadersToStrip.
…arashield-Protocol#712)

Trigger evaluation scaled product thresholds with parseFloat(threshold) * 1e7.
Binary floating point cannot represent most decimal fractions, so low-order
digits could be lost and a reading sitting exactly on the threshold could land
on the wrong side of the comparison — paying out (or not) incorrectly.

Add exact decimal helpers (src/common/utils/decimal.ts) that parse decimal
strings/numbers into BigInt scaled by 10^7, expanding scientific notation and
rounding only beyond the 7th decimal place. Use them in both evaluation paths
(claims autoProcess and the policy-state cache), keeping the strict boundary
semantics: 'LessThan' triggers strictly below, otherwise strictly above, and a
reading equal to the threshold never triggers.

Also surface OracleReading.bucketStart from database reads so the cache's
reading timestamp is available; fall back to the reading timestamp when absent.
…ol#713)

The version header was only set from the interceptor's tap callback, so it was
missing on error responses and could be absent from streamed responses (SSE /
NDJSON) whose headers flush before tap runs.

Centralise version resolution in src/common/versioning/api-version.ts and emit
the header before the handler executes. Also stamp it from the global exception
filter for error responses and from an early middleware for responses that never
reach either (CORS preflights, request timeouts). Expose the header (plus
Deprecation/Link) via CORS so browser clients can read it.
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@Feyisara2108 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant