feat: supply chain audit - #1211
Conversation
|
@C0mberry is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR adds a production-dependency audit gate and supply-chain configuration for dependency and GitHub Action updates.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "added cooldown" | Re-trigger Greptile |
3ae28f9 to
494c18a
Compare
| # into one PR; majors are split out so each can be reviewed on its own. `cooldown` mirrors | ||
| # the 14-day `minimumReleaseAge` gate in pnpm-workspace.yaml so freshly published versions | ||
| # aren't proposed until they've aged the same amount. | ||
| - package-ecosystem: npm |
There was a problem hiding this comment.
Are you sure we need npm here and not pnpm?
There was a problem hiding this comment.
Potentially we could drop it
There was a problem hiding this comment.
@rogaldh
dependabot doesn't have a separate pnpm ecosystem
I'd keep it, it's what patches our runtime deps (root + workspace), which is the point of this supply-chain PR
| "private": true, | ||
| "scripts": { | ||
| "audit": "pnpm audit --audit-level high", | ||
| "audit:ci": "pnpm audit --audit-level critical", |
There was a problem hiding this comment.
| "audit:ci": "pnpm audit --audit-level critical", | |
| "audit:ci": "pnpm audit --prod --audit-level critical", |
I'd focus on the production packages, as they are the most critical
| # Pin resolution to the public npm registry so it can't silently inherit a | ||
| # global/org .npmrc mirror. Scoped keys (e.g. '@my-org') can be added here. | ||
| registries: | ||
| default: https://registry.npmjs.org/ |
|
|
|
I'd also add a cooldown to gituhb-actions section in Dependabot.yml to keep them in sync |
… sticks (#1226) ## Description Switching the cluster to **Mainnet Beta** does not stick. The Explorer snaps back to the cluster the page was first loaded with. ``` open /?cluster=devnet → click Testnet → /?cluster=testnet ✅ → click Mainnet → /?cluster=devnet ❌ ``` It reverts to the URL of the **initial page load**, not the previous one. Only Mainnet Beta is affected, and only on a production build. ### Why Mainnet Beta only The default cluster is expressed by the *absence* of the param, so Mainnet Beta is the one pill whose href carries no query string (`use-cluster-href.ts`): ```ts if (cluster === DEFAULT_CLUSTER) params.delete('cluster'); else params.set('cluster', clusterSlug(cluster)); ``` Testnet and Devnet navigate to `?cluster=…`, which misses the client route cache and forces a real fetch. Mainnet navigates to a bare pathname, and that is the case Next 16.2 gets wrong. ### Root cause — Next.js 16.2 Two places in Next's client router, one bug: - `router-reducer/create-initial-router-state.js` seeds a route-cache entry on first load. It keys the entry by `location.pathname` — **no search** — while storing `createHrefFromUrl(location)`, the full initial URL **including the query**, as that entry's `canonicalUrl`. - `segment-cache/navigation.js` reads it back on a cache hit: `const canonicalUrl = route.canonicalUrl + url.hash`. So a navigation to `/` hits the entry seeded for `/?cluster=devnet` and adopts its canonical URL. `app-router.js` then `replaceState`s the browser to it. No RSC request is made — the whole thing is served from the poisoned cache entry, which is why the URL flips with no network activity to explain it. Next fixed this in **16.3.0** by threading the search through: ```diff -discoverKnownRoute(Date.now(), location.pathname, null, null, …, canonicalUrl, …) +discoverKnownRoute(Date.now(), location.pathname, location.search, null, null, …, canonicalUrl, …) ``` ### Two more symptoms, same cause - **A custom endpoint cannot be left.** From `?cluster=custom&customUrl=…`, the Mainnet pill lands on `/?customUrl=…`, then the strip effect in `useClusterUrl` calls `router.replace('/')` — query-less, so it bounces straight back to the custom cluster. - **Cancel on the consent prompt does nothing.** `PendingCustomUrlConsent` replaces to `/`, Next restores the original URL, and the prompt re-opens. The safe outcome was unreachable: Connect or leaving the page were the only exits. ### The fix `next` and `eslint-config-next` 16.2.11 → 16.3.0. No app code changes — the href-building code is unchanged since the 2023 App Router port, and it is correct. 16.3.0 rather than 16.3.1 (current latest) because 16.3.1 was published 2026-08-13 and is inside the 14-day `minimumReleaseAge` window from #1211. 16.3.0 shipped 2026-08-03, carries the same fix, and needs no `minimumReleaseAgeExclude` entry. `bench/BUILD.md` moves with it: first-load JS drops ~20 kB on every route. ## Type of change - [x] Bug fix ## Testing Manual testing on the preview deployment. Each one is broken on `master` and fixed here. - [Home on devnet — open the switcher, click Testnet, then Mainnet Beta](https://explorer-git-fork-hoodieshq-fix-next-1-703a39-solana-foundation.vercel.app/?cluster=devnet) — the URL must end at `/` and the navbar must read Mainnet Beta. Clicking Mainnet Beta straight away must do the same. - [Custom endpoint — Connect, then Mainnet Beta](https://explorer-git-fork-hoodieshq-fix-next-1-703a39-solana-foundation.vercel.app/?cluster=custom&customUrl=https://example.com/rpc) — after Connect the switcher must be able to leave the custom cluster. On `master` it snaps back to `?cluster=custom&customUrl=…`. - [Custom endpoint — Cancel the prompt](https://explorer-git-fork-hoodieshq-fix-next-1-703a39-solana-foundation.vercel.app/?cluster=custom&customUrl=https://example.com/rpc) — must land on mainnet with the prompt gone and the param dropped. - [Ordinary mainnet page — unchanged](https://explorer-git-fork-hoodieshq-fix-next-1-703a39-solana-foundation.vercel.app) ## Related Issues Closes [HOO-1153](https://linear.app/solana-fndn/issue/HOO-1153/cluster-gets-stuck) ## Checklist - [x] My code follows the project's style guidelines - [x] All checks pass locally (`pnpm test`, `pnpm lint`, `pnpm typecheck`) - [x] I have run `build:info` script to update build information ## Additional Notes **No regression test.** The symptom needs a production build — the bug does not reproduce under `pnpm dev`, and `playwright.config.ts` starts the suite with `pnpm dev`. CI does not run `test:e2e` at all. A test there could not fail, so the guard is the exact version pin. **Why no app-side workaround.** Emitting `cluster=mainnet-beta` explicitly would dodge the bug, but it gives up clean mainnet URLs everywhere and does not cover the strip effect, which must be able to remove the last query param. The upstream fix covers every call site, including the latent ones: on 16.2, any bare-pathname link back to the initially loaded pathname bounces the same way.
Description
Type of change
Related Issues
HOO-857
Checklist