Repository navigation
feat: unfreeze publisher caps - #4041
Merged
Merged
Conversation
Restore HermesClient.getLatestPublisherCaps and have the staking app read publisher caps from Hermes again instead of the frozen snapshot.
|
Greenlight — 🚫 Blocked — see reasons below ( Blocking reasons:
|
1 similar comment
|
Greenlight — 🚫 Blocked — see reasons below ( Blocking reasons:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Comment on lines
+17
to
+19
| export type PublisherCaps = z.infer< | ||
| typeof schemas.LatestPublisherStakeCapsUpdateDataResponse | ||
| >; |
Contributor
Contributor
Author
There was a problem hiding this comment.
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, | ||
| ); | ||
| } |
Contributor
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
This PR is a revert, so we just want to restore what we had there.
keyvankhademi
approved these changes
Sep 1, 2026
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Partially reverts the publisher-caps half of #4029:
HermesClient.getLatestPublisherCapsand thePublisherCapstype, plus thePublisherCapsre-export from@pythnetwork/pyth-sui-js.apps/stakingreads caps from Hermes again instead ofsrc/frozen/publisher-caps.ts, which is deleted.The
pull:schemaURL from #4029 (https://pyth.dourolabs.app/docs/hermes/openapi.json) is kept — that is what makes the generated zod schema containLatestPublisherStakeCapsUpdateDataResponseagain. Publisher rankings stay frozen.Why
https://hermes.pyth.network/v2/updates/publisher_stake_caps/latestand 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).https://hermes.pyth.network):getLatestPublisherCaps({ parsed: true })returns 93 publisher entries that pass the generated zod schema, and the exactgetPublisherCapexpression fromapps/staking/src/api.tsresolves7YQg8Tz9KHKsg7yHiAFRBsDkLoKvZbMXt7VbW44F7QMto188891953536126n(matching the frozen value) and an unknown publisher to0n.Note: the root
test:linttask (biome ci --changed) reports 6 pre-existinglint/suspicious/useAwaiterrors in the two touched files. They are present unchanged onmain(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.