Skip to content

chore: drop Polygon; archive Solana (chain cut) - #46

Merged
marceloceccon merged 3 commits into
developfrom
chore/chain-cut-drop-polygon-archive-solana
Sep 24, 2026
Merged

marceloceccon merged 3 commits into
developfrom
chore/chain-cut-drop-polygon-archive-solana

Conversation

@marceloceccon

@marceloceccon marceloceccon commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Chain cut in merchant-sdk: Solana archived, Polygon dropped.

⚠️ This is a breaking API change, and the version is deliberately NOT bumped

Removed from the public surface: the ./solana subpath, SolanaCommitmentLevel,
ConfirmationPolicy.commitmentLevel(), createHighValueConfirmationPolicy(),
SolanaGasBreakdown, and 'solana' from the ChainFamily / PaymentFamily /
TelemetryChain unions.

I removed those rather than leaving them returning null for every chain. A policy
that still advertises a commitment vocabulary no chain uses is a trap for the next
integrator — and the work pack is explicit that dead toggles are not acceptable.

package.json still says 0.5.0 on purpose: ci.yml publishes
<version>-dev.<run> to GitHub Packages on every push to develop, so bumping
here would ship a breaking prerelease off the merge. The 0.6.0 release decision
is yours
— humanpending.md HP-3.

What changed

src/solana/ (11 files) and the two Solana specs moved to archive/solana/. They
are inert: tsconfig includes only src, ESLint globs only src/**, the Vite
entry map is explicit, and I added a test.exclude for archive/** to
vitest.config.ts — without it Vitest's default glob would still have collected
the archived spec. Six @solana/* dependencies gone; lockfile −12.8k lines.

Polygon: chainId 137 out of DEFAULT_CHAINS, CHAIN_ICONS,
COINGECKO_CHAIN_IDS, KNOWN_CONTRACT_ADDRESSES,
DEFAULT_CONFIRMATION_THRESHOLDS, CHAIN_FAMILY_REGISTRY,
DEFAULT_SECONDS_TO_FINALITY, the price-feed matic-network fallback, the wagmi
chain list, and both EVM chain-id allowlists.

New drop guards in confirmationPolicy.test.ts: 137 and the Solana sentinels
900–902 must be absent from every registry, must resolve as unknown chains (12
confirmations, 0s ETA) rather than as their old selves, and no registry entry may
claim a family outside evm|tron. Re-adding a dropped chain without a founder
decision now fails the suite.

Four fixes that are NOT about chains — please read

npm run typecheck could not run at all before this PR, which meant the cut was
unverifiable. Fixed minimally:

  1. tsconfig.json — dropped the deprecated baseUrl and the @/* paths
    alias it enabled (nothing imported it). TypeScript 6 makes baseUrl a hard
    error, so tsc aborted before reading a single source file.
  2. src/hooks/useWallet.ts — wagmi v3's useBalance no longer returns
    formatted; now formats value/decimals with viem's formatUnits. Public
    balance: string | null contract unchanged. This was a real compile error in
    mainline.
  3. src/css.d.ts (new) — TS6 needs a declaration for the side-effect
    import './styles.css'.
  4. .npmrc (new) — legacy-peer-deps=true. eslint-plugin-jsx-a11y@6.10.2
    (its newest release) peers eslint ^3…^9 while this package pins ^10, so a
    clean npm ci fails ERESOLVE. The committed lockfile was already built that
    way; this makes it explicit.

If you'd rather these landed separately, they are the only non-chain changes in the
whole nine-repo set — easy to split.

Verification — executed

  • npm ci → clean install, 465 packages (previously failed ERESOLVE).
  • npm run typecheck → PASS.
  • npm test → 165 passed, 4 failed. The same 4 permit.test.ts cases fail
    identically on the pre-cut tree — I verified by stashing the cut and re-running.
    They hit ADR-0004's KNOWN_PERMIT_TOKENS gate with a non-allow-listed token
    domain, and the shipped allowlist holds one placeholder digest. Making them pass
    means deciding the real allowlist contents, not editing a test
    (humanpending.md HP-5). The cut introduces no new failures.

Still red, pre-existing, not fixed here (humanpending.md HP-4): npm run lint
crashes because eslint-plugin-react is not ESLint-10 compatible, and
npm run build's Vite half fails on Tailwind v4's moved PostCSS plugin (and then
on a missing esbuild). I attempted the Tailwind fix, hit the second failure, and
reverted rather than ship an unverifiable dependency change inside a chain PR.


Locked decisions applied

# Decision Status
D1 Drop Polygon permanently from the mainline product LOCKED — applied
D2 Archive Solana out of mainline (quarantine, not delete) LOCKED — applied
D3 Active chain families: EVM (non-Polygon) + TRON LOCKED — applied
D4 GTM needs ≥4 mainnets; in-tree after the cut = Ethereum + Base + TRON = 3 BLOCKED on D4a
D4a Mainnet #4 = _________ OPEN — deliberately not invented
D5 First money stays testnet → canary → the four mainnets together; this pack is product/matrix cleanup, not deploy LOCKED — respected

No fourth chain is named anywhere in this PR set. Chain matrices carry an explicit
TODO(D4a) and no placeholder row appears in any catalog, seed or UI.

Inventory summary (WI-0)

Nine of ten repos needed changes. portal-shared needed none — its only
apparent hit was matic inside the word automatic, so no branch and no PR exist
for it.

Worth knowing about the scan: the work pack's regex over-matches badly (matic →
automatic, anchor → HTML anchors, spl → split), and the monorepo
.gitignore ignores every sub-repo directory, so a single rg from the workspace
root silently misses nine of the ten repos. The real surface was mapped with
per-repo, per-family patterns. Full classification (remove / archive /
keep-historical / testnet-only-ok) is in INVENTORY.md in the
web3settle-monorepo PR.

The whole PR set

Repo PR
smart-contracts https://github.com/web3settle/smart-contracts/pull/13
merchant-sdk #46
gateway-core-backend https://github.com/web3settle/gateway-core-backend/pull/9
merchant-portal https://github.com/web3settle/merchant-portal/pull/9
gateway-backoffice-portal https://github.com/web3settle/gateway-backoffice-portal/pull/9
www-web3settle-com https://github.com/web3settle/www-web3settle-com/pull/6
gateway-infra https://github.com/web3settle/gateway-infra/pull/8
merchant-integration-demo https://github.com/web3settle/merchant-integration-demo/pull/7
web3settle-monorepo https://github.com/web3settle/web3settle-monorepo/pull/4

⛔ MERGE = RED — wait for Marcelo

Not merged, not approved, not deployed, not published. Nothing touched mainnet.
tron-canary.yml remains hard-off. No Dependabot PR was merged.

Read humanpending.md (in the web3settle-monorepo PR) before merging — in
particular HP-2, a pre-deploy database check, and HP-1, decision D4a.

Product decisions locked 2026-09-24:
  D1 — Polygon dropped permanently from mainline product.
  D2 — Solana archived out of mainline (quarantine, not delete).
  D3 — Active chain families: EVM (non-Polygon) + TRON.

BREAKING for SDK consumers. Version deliberately NOT bumped — see CHANGELOG.

Solana (D2)
- git mv src/solana -> archive/solana; the two Solana test files moved to
  archive/solana/__tests__ (their relative imports fixed so the archive stays
  coherent). Nothing in the toolchain reaches outside src/: tsconfig include is
  ["src"], vitest include is src/__tests__/**, eslint files is src/**, and the
  Vite entry map is explicit — so the archive is not typechecked, linted,
  tested, or bundled.
- ./solana export removed from package.json; @solana/web3.js,
  @solana/wallet-adapter-base and @solana/wallet-adapter-react removed from
  peerDependencies, peerDependenciesMeta and devDependencies; lockfile
  regenerated (-7.5k lines, all @Solana subtree).
- Removed the Solana-shaped holes rather than leaving them null-for-every-chain:
  SolanaCommitmentLevel, ConfirmationPolicy.commitmentLevel(),
  createHighValueConfirmationPolicy(), SolanaGasBreakdown, 'solana' from
  ChainFamily / PaymentFamily / TelemetryChain, and the solana.* i18n namespace.

Polygon (D1)
- chainId 137 removed from DEFAULT_CHAINS, CHAIN_ICONS, COINGECKO_CHAIN_IDS,
  KNOWN_CONTRACT_ADDRESSES, DEFAULT_CONFIRMATION_THRESHOLDS,
  CHAIN_FAMILY_REGISTRY, DEFAULT_SECONDS_TO_FINALITY, the price-feed
  matic-network fallback, the wagmi chain list in Web3SettleProvider, and the
  EVM chain-id allowlists in TopUpModal and evm/confirmationPolicy.
- permit tests re-pointed from 137 to 8453 (the id was incidental there).

Drop guards (new tests)
- confirmationPolicy.test.ts asserts 137 and the Solana sentinels 900-902 are
  absent from every registry, resolve as *unknown* chains (12 confirmations,
  0s ETA) rather than as their old selves, and that no registry entry claims a
  family outside evm|tron. Re-adding a dropped chain without a founder decision
  now fails the suite.

Pre-existing breakage fixed minimally so the cut is verifiable (NOT caused by
the cut; each independent of the chain work)
- tsconfig.json: dropped deprecated baseUrl + the unused @/* paths alias. TS6
  makes baseUrl a hard error, so `npm run typecheck` aborted before reaching a
  single source file.
- src/hooks/useWallet.ts: wagmi v3's useBalance no longer returns `formatted`;
  format value/decimals with viem formatUnits. Public `balance: string | null`
  contract unchanged.
- src/css.d.ts: TS6 needs a declaration for the side-effect styles.css import.
- .npmrc: legacy-peer-deps=true. eslint-plugin-jsx-a11y@6.10.2 (its newest)
  peers eslint ^3..^9 while this package pins ^10, so a clean `npm ci` fails
  ERESOLVE. The committed lockfile was already built that way.

Verified locally (executed)
- npm ci: clean install, 465 packages.
- npm run typecheck: PASS (was aborting on the baseUrl error before).
- npm test: 165 passed, 4 failed — the same 4 permit.test.ts cases fail
  identically on the pre-cut tree (verified by stashing the cut and re-running);
  they hit the KNOWN_PERMIT_TOKENS gate from ADR-0004 with a non-allow-listed
  token domain. The cut introduces no new failures.

Still broken, pre-existing, deliberately NOT fixed here (out of scope, logged)
- npm run lint: eslint-plugin-react is incompatible with ESLint 10.
- npm run build (vite half): Tailwind v4 needs @tailwindcss/postcss, and the
  next failure after that is a missing esbuild vs the root overrides pin.
WI-3 acceptance asks that the site and SDK READMEs cross-link the single source
of truth for chain support. Adds that pointer to the chain-cut banner.
…wallet

The telemetry schema description used "phantom" as its example walletId provider
name. Phantom is Solana-only and the chain was archived (decision D2), so the
example now uses "metamask" / "tronlink" — providers the SDK can actually
report.
@marceloceccon
marceloceccon merged commit 2f1a2d1 into develop Sep 24, 2026
7 of 10 checks passed
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.

1 participant