Skip to content

feat: unfreeze publisher caps - #4041

Merged
guibescos merged 1 commit into
mainfrom
hydra/i-hjotgnq/head
Sep 3, 2026
Merged

guibescos merged 1 commit into
mainfrom
hydra/i-hjotgnq/head

Conversation

@guibescos

@guibescos guibescos commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

What

Partially reverts the publisher-caps half of #4029:

  • Restore HermesClient.getLatestPublisherCaps and the PublisherCaps type, plus the PublisherCaps re-export from @pythnetwork/pyth-sui-js.
  • apps/staking reads caps from Hermes again instead of src/frozen/publisher-caps.ts, which is deleted.

The pull:schema URL from #4029 (https://pyth.dourolabs.app/docs/hermes/openapi.json) is kept — that is what makes the generated zod schema contain LatestPublisherStakeCapsUpdateDataResponse again. Publisher rankings stay frozen.

Why

https://hermes.pyth.network/v2/updates/publisher_stake_caps/latest and the publisher-caps entry in the OpenAPI schema both work again, so the frozen snapshot is no longer needed and the staking page can show live caps.

Verification

  • pnpm turbo test --filter=@pythnetwork/hermes-client --filter=@pythnetwork/staking --filter=@pythnetwork/pyth-sui-js — 14 tasks pass (build, types, unit, format, per-package lint).
  • Exercised the restored client against live Hermes (https://hermes.pyth.network): getLatestPublisherCaps({ parsed: true }) returns 93 publisher entries that pass the generated zod schema, and the exact getPublisherCap expression from apps/staking/src/api.ts resolves 7YQg8Tz9KHKsg7yHiAFRBsDkLoKvZbMXt7VbW44F7QM to 188891953536126n (matching the frozen value) and an unknown publisher to 0n.

Note: the root test:lint task (biome ci --changed) reports 6 pre-existing lint/suspicious/useAwait errors in the two touched files. They are present unchanged on main (getLatestPriceUpdates, getPriceUpdatesAtTimestamp, getPriceUpdatesStream, getPublisherRankings, createStakeAccountAndDeposit, reassignPublisherAccount) and only surface because those files are now in biome's changed set; this PR neither adds nor removes any.


Devin Review

Restore HermesClient.getLatestPublisherCaps and have the staking app read
publisher caps from Hermes again instead of the frozen snapshot.
@guibescos
guibescos requested a review from a team as a code owner September 1, 2026 10:09
@dourolabs-greenlight

Copy link
Copy Markdown

Greenlight — 🚫 Blocked — see reasons below (36cb0bf)

Blocking reasons:

  • path not auto-approvable: apps/hermes/client/js/src/hermes-client.ts (+3 more)

Open in Greenlight →

1 similar comment
@dourolabs-greenlight

Copy link
Copy Markdown

Greenlight — 🚫 Blocked — see reasons below (36cb0bf)

Blocking reasons:

  • path not auto-approvable: apps/hermes/client/js/src/hermes-client.ts (+3 more)

Open in Greenlight →

@vercel
vercel Bot temporarily deployed to Preview – entropy-explorer September 1, 2026 10:09 Inactive
@vercel

vercel Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
api-reference Ready Ready Preview Sep 1, 2026 10:14am UTC
component-library Ready Ready Preview Sep 1, 2026 10:14am UTC
developer-hub Ready Ready Preview Sep 1, 2026 10:14am UTC
insights Error Error Sep 1, 2026 10:14am UTC
proposals Ready Ready Preview Sep 1, 2026 10:14am UTC
staking Ready Ready Preview Sep 1, 2026 10:14am UTC
1 Skipped Deployment
Project Deployment Actions Updated
entropy-explorer Skipped Skipped Sep 1, 2026 10:14am UTC

Request Review

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

Devin Review

Comment on lines +17 to +19
export type PublisherCaps = z.infer<
typeof schemas.LatestPublisherStakeCapsUpdateDataResponse
>;

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.

🔍 Published package versions remain unchanged

The public HermesClient API and Sui exports expand without package version bumps. Repository rules require SemVer updates for published packages.

Devin Review

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This PR reverts the source code to something that was published.

Comment on lines +162 to +180
async getLatestPublisherCaps({
fetchOptions,
...options
}: {
encoding?: EncodingType;
parsed?: boolean;
fetchOptions?: RequestInit;
} = {}): Promise<PublisherCaps> {
const url = this.buildURL("updates/publisher_stake_caps/latest");
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (options) {
this.appendUrlSearchParams(url, options);
}
return await this.httpRequest(
url.toString(),
schemas.LatestPublisherStakeCapsUpdateDataResponse,
fetchOptions,
);
}

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.

🔍 Restored endpoint lacks regression coverage

No unit test covers getLatestPublisherCaps path construction, options, or response parsing. Repository standards require tests for new public functionality.

Devin Review

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This PR is a revert, so we just want to restore what we had there.

@guibescos
guibescos merged commit a61db35 into main Sep 3, 2026
9 checks passed
@guibescos
guibescos deleted the hydra/i-hjotgnq/head branch September 3, 2026 12:45

This branch had an error being deployed

1 failed, 5 active, and 1 inactive deployments
Preview – developer-hub — 36cb0bf2 Deployed Sep 1, 2026 by vercel[bot]
Preview – api-reference — 36cb0bf2 Deployed Sep 1, 2026 by vercel[bot]
Preview – proposals — 36cb0bf2 Deployed Sep 1, 2026 by vercel[bot]
Preview – staking — 36cb0bf2 Deployed Sep 1, 2026 by vercel[bot]
Preview – component-library — 36cb0bf2 Deployed Sep 1, 2026 by vercel[bot]
Preview – insights — 36cb0bf2 Deployed Sep 1, 2026 by vercel[bot]
Preview – entropy-explorer — 36cb0bf2 Deployed Sep 1, 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