Skip to content

feat(staking): persistent 'OIS rewards paused' banner - #3980

Merged
aditya520 merged 4 commits into
mainfrom
hydra/i-tamqdyn/head
Aug 13, 2026
Merged

aditya520 merged 4 commits into
mainfrom
hydra/i-tamqdyn/head

Conversation

@aditya520

@aditya520 aditya520 commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Replaces the auto-opening Changelog modal on the staking app with a persistent, non-dismissible banner announcing that Oracle Integrity Staking rewards are paused.

The modal was dismissible and only appeared once per page load, so a user could miss it entirely and not realise that stake assigned to a publisher is still subject to slashing while earning nothing. The banner states that plainly and stays on the page.

Changes

  • ois-paused-banner.tsx (new) — the banner. Rendered under the header, above the page content. Hidden on the geo-blocked, governance-only, and vpn-blocked segments, which render blocked/restricted screens where OIS is unavailable and the legal notice may already be showing. Renders an empty node when hidden so the <body> grid row count stays stable.
  • Root/index.tsx — swaps <Changelog /> for <OisPausedBanner /> and adds the matching grid-rows track (5→6 at mobile, 4→5 at lg).
  • Changelog/index.tsx — deleted; the banner supersedes it and nothing else referenced it.
  • config/server.ts — adds the OIS_PAUSED flag, defaulting to on. OIS_PAUSED=false removes the banner when rewards resume.
  • turbo.json — declares OIS_PAUSED for the build:vercel task so turbo caching keys on it.

Copy and the link target match the OIS docs banner and callout that landed in #3968, so the two surfaces stay consistent.

OIS_PAUSED is a build-time flag

/ is statically prerendered, so the flag is baked in at build time — flipping it in the Vercel dashboard does nothing until a redeploy. This is noted in the doc comment on the export. Please confirm that redeploy-to-toggle is acceptable before merging.

Unrecognised values throw rather than defaulting. Parsing anything-but-"true" as false would mean OIS_PAUSED=1 or a typo like =ture silently removing a notice about ongoing slashing risk; throwing fails the build instead, which is the safer failure for permanent copy making an explicit risk claim.

Notes

  • /region-blocked is a legacy route that nothing links or rewrites to (the middleware only rewrites to geo-blocked, governance-only, and vpn-blocked). It renders a blocked screen and does show the banner. The gating matches the three segments actually in the blocking flow; left alone rather than adding a fourth magic string for an unreachable page.
  • config/server.ts carried eslint-disable comments for a linter this repo no longer has a config for. Biome lints changed files in full, so editing the file surfaced its pre-existing process.env usages; the comments are swapped for the biome equivalents, matching apps/mcp/src/config.ts.

Verification

CI=1 pnpm exec turbo build test --filter @pythnetwork/staking — 16/16 tasks, 53 tests.

Behaviour exercised against a running dev server, driving x-vercel-ip-country with BLOCKED_REGIONS=fr GOVERNANCE_ONLY_REGIONS=us:

request banner
DE (unrestricted) shown
US (governance-only) hidden
FR (geo-blocked) hidden

Flag matrix, same server:

OIS_PAUSED result
unset / true / TRUE banner shown
false / False banner hidden
1 / ture throws InvalidEnvironmentError

A production next build confirms / is ○ (Static), that the prerendered index.html contains the banner while geo-blocked/governance-only/vpn-blocked do not, and that an invalid OIS_PAUSED fails the build rather than shipping a page missing the notice.


Open in Devin Review

aditya520 and others added 4 commits August 13, 2026 14:02
Replace the auto-opening Changelog modal with a persistent, non-dismissible
banner announcing that Oracle Integrity Staking rewards are paused.

The modal popped on every page load, was dismissed with no persistence, and
left no in-app signal that OIS is paused once closed. Its copy was also
imprecise: only the reward rate is 0 (OP-PIP-103, 22 April 2026) — staking
and slashing remain live, so stake assigned to a publisher is still subject
to slashing. The banner says so explicitly and links to the April 2026
governance update.

The banner is suppressed on the geo-blocked and governance-only segments,
where the legal notice already renders and OIS is unavailable, and is gated
behind the OIS_PAUSED env var (enabled by default) so it can be removed with
a single config change when rewards resume.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Addresses PR review feedback: the banner rendered above the VPN-blocked
screen, advertising unstake/withdraw on a route that exposes no staking
functionality. Adds VPN_BLOCKED_SEGMENT to the restricted-mode check and
a component test covering the enabled, disabled, and restricted-segment
states.
`asBoolean` treated any value other than "true" as false, so `OIS_PAUSED=1`
or a typo like `=ture` silently removed a notice about ongoing slashing
risk. Match "true"/"false" explicitly and throw otherwise, which fails the
build rather than shipping a page missing the notice.

Swap the file's dead eslint-disable comments for the biome equivalents;
the repo has no eslint config, and biome lints changed files in full, so
editing this file surfaced its pre-existing process.env usages.
@aditya520
aditya520 requested a review from a team as a code owner August 13, 2026 14:17
@vercel
vercel Bot temporarily deployed to Preview – insights August 13, 2026 14:17 Inactive
@dourolabs-greenlight

Copy link
Copy Markdown

Greenlight — 🚫 Blocked — see reasons below (b7bfc19)

Blocking reasons:

  • path not auto-approvable: apps/staking/package.json (+7 more)

Open in Greenlight →

1 similar comment
@dourolabs-greenlight

Copy link
Copy Markdown

Greenlight — 🚫 Blocked — see reasons below (b7bfc19)

Blocking reasons:

  • path not auto-approvable: apps/staking/package.json (+7 more)

Open in Greenlight →

@vercel
vercel Bot temporarily deployed to Preview – developer-hub August 13, 2026 14:17 Inactive
@vercel

vercel Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
staking Building Building Preview Aug 13, 2026 2:18pm
6 Skipped Deployments
Project Deployment Actions Updated (UTC)
api-reference Skipped Skipped Aug 13, 2026 2:18pm
component-library Skipped Skipped Aug 13, 2026 2:18pm
developer-hub Skipped Skipped Aug 13, 2026 2:18pm
entropy-explorer Skipped Skipped Aug 13, 2026 2:18pm
insights Skipped Skipped Aug 13, 2026 2:18pm
proposals Skipped Skipped Aug 13, 2026 2:18pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – component-library August 13, 2026 14:17 Inactive
@vercel
vercel Bot temporarily deployed to Preview – entropy-explorer August 13, 2026 14:17 Inactive
@vercel
vercel Bot temporarily deployed to Preview – proposals August 13, 2026 14:17 Inactive
@vercel
vercel Bot temporarily deployed to Preview – api-reference August 13, 2026 14:17 Inactive

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 OIS_PAUSED is a build-time constant on a statically prerendered route

OIS_PAUSED is read at module evaluation in apps/staking/src/config/server.ts:67-71 and consumed by the root layout, which is statically prerendered for /. Changing the env var in Vercel will not remove the banner without a redeploy. The author flags this and asks for sign-off — worth an explicit confirmation from an owner, since the intended off-switch ("when rewards resume") is slower than an env-var flip suggests.

(Refers to lines 67-71)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +21 to +31
const isRestrictedMode =
segment === GEO_BLOCKED_SEGMENT ||
segment === GOVERNANCE_ONLY_SEGMENT ||
segment === VPN_BLOCKED_SEGMENT;

// These segments render the restricted / blocked screens, where OIS is
// unavailable and the legal notice may already be showing, so the banner
// would either stack with it or advertise actions the user can't take.
// Render an empty node when hidden to keep the `<body>` grid row count
// stable.
return isEnabled && !isRestrictedMode ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Banner hidden on governance-only/vpn-blocked where unstake/withdraw is still possible

Users rewritten to governance-only and vpn-blocked can still reach unstake/withdraw flows (see the restricted-region copy at apps/staking/src/components/Root/restricted-region-banner.tsx:28-30), yet the slashing/zero-rewards notice is suppressed for them. RestrictedRegionBanner only covers geo-blocked and governance-only, so on vpn-blocked no notice at all is shown. Intentional per the PR description (avoid stacking with the legal notice), but the vpn-blocked case leaves the user with neither banner.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@KemarTiti
KemarTiti self-requested a review August 13, 2026 15:17
@aditya520
aditya520 merged commit a1da9bc into main Aug 13, 2026
17 checks passed
@aditya520
aditya520 deleted the hydra/i-tamqdyn/head branch August 13, 2026 15:28

This branch was successfully deployed

1 active and 6 inactive deployments
Preview – staking — b7bfc195 Deployed Aug 13, 2026 by vercel[bot]
Preview – component-library — b7bfc195 Deployed Aug 13, 2026 by vercel[bot]
Preview – entropy-explorer — b7bfc195 Deployed Aug 13, 2026 by vercel[bot]
Preview – proposals — b7bfc195 Deployed Aug 13, 2026 by vercel[bot]
Preview – api-reference — b7bfc195 Deployed Aug 13, 2026 by vercel[bot]
Preview – developer-hub — b7bfc195 Deployed Aug 13, 2026 by vercel[bot]
Preview – insights — b7bfc195 Deployed Aug 13, 2026 by vercel[bot]
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