build: consume the Quantus forks from the Gitea registry

Wires this repo to the four forked @polkadot packages and @quantus/crypto, and
the extension now builds with post-quantum crypto in it.

Two mechanisms, for the reason established in quantus/ui: @quantus is routed as a
whole scope in .yarnrc.yml, which is safe because we own every name in it, while
the forked @polkadot packages are pinned individually to tarball URLs in
resolutions. Routing the @polkadot scope would send yarn hunting for the dozens
of packages in it that are not forked — api, types, rpc-provider, dev, x-*,
hw-ledger and more — all of which must keep coming from npm.

The forks carry -quantus.N versions, so a resolution left out fails with "No
candidates found" rather than being quietly satisfied from npm by the unforked
package.

buildHierarchy.spec.ts is rewritten rather than deleted. compareByNetwork
resolves a genesis hash through getNetworkMap(), which is built from
selectableNetworks — and this fork only offers chains whose accounts are
post-quantum, so Polkadot and Kusama are no longer in it. Both fixtures resolved
to '' and compared equal, meaning the network-ordering tests passed without
ordering anything. They now use Quantus and Heisenberg, whose display names sort
in the same direction the originals did, so the fixtures keep their shape.

Verified in the built artifacts rather than assumed: background.js carries
QUANTUS_EXTRINSIC, the dilithium keypair types, ext_poseidon_hash, ext_mldsa_sign
and the base64 wasm payload; extension.js carries the Quantus network entry, QTC
and the mainnet genesis hash. The split is right — signing lives in the service
worker, the UI only needs to render addresses.

65 tests pass; `yarn build:chrome` completes.

Refs quantus/extension#2

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012uDUodEcRbBwNRi3UCmw8f
This commit is contained in:
rob thijssen
2026-09-15 11:53:36 +03:00
co-authored by Claude Opus 5
parent d7c9ce2145
commit bff8eec1e6
10 changed files with 74 additions and 35 deletions
+10
View File
@@ -11,3 +11,13 @@ logFilters:
level: discard
nodeLinker: node-modules
# @quantus packages come from the Gitea registry. Routing the whole scope is safe
# because we own every name in it — unlike @polkadot, most of which is unforked
# and must keep coming from npm. The four forked @polkadot packages are pinned
# individually to tarball URLs in package.json resolutions.
#
# Reads are anonymous; publishing needs `pass gitea/package-publisher-token`.
npmScopes:
quantus:
npmRegistryServer: "https://git.lair.cafe/api/packages/quantus/npm/"
+4 -3
View File
@@ -52,12 +52,13 @@
},
"resolutions": {
"@polkadot/api": "^16.5.6",
"@polkadot/keyring": "^14.0.3",
"@polkadot/networks": "^14.0.3",
"@polkadot/keyring": "https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fkeyring/-/14.0.3-quantus.1/keyring-14.0.3-quantus.1.tgz",
"@polkadot/networks": "https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fnetworks/-/14.0.3-quantus.1/networks-14.0.3-quantus.1.tgz",
"@polkadot/rpc-provider": "^16.5.6",
"@polkadot/types": "^16.5.6",
"@polkadot/ui-keyring": "https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fui-keyring/-/3.16.7-quantus.1/ui-keyring-3.16.7-quantus.1.tgz",
"@polkadot/util": "^14.0.3",
"@polkadot/util-crypto": "^14.0.3",
"@polkadot/util-crypto": "https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Futil-crypto/-/14.0.3-quantus.1/util-crypto-14.0.3-quantus.1.tgz",
"@polkadot/x-fetch": "^14.0.3",
"safe-buffer": "^5.2.1",
"typescript": "^5.5.4"
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/extension-base', path: 'auto', type: 'auto', version: '0.63.2-1-x' };
export const packageInfo = { name: '@polkadot/extension-base', path: 'auto', type: 'auto', version: '0.64.0' };
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/extension-chains', path: 'auto', type: 'auto', version: '0.63.2-1-x' };
export const packageInfo = { name: '@polkadot/extension-chains', path: 'auto', type: 'auto', version: '0.64.0' };
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/extension-compat-metamask', path: 'auto', type: 'auto', version: '0.63.2-1-x' };
export const packageInfo = { name: '@polkadot/extension-compat-metamask', path: 'auto', type: 'auto', version: '0.64.0' };
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/extension-dapp', path: 'auto', type: 'auto', version: '0.63.2-1-x' };
export const packageInfo = { name: '@polkadot/extension-dapp', path: 'auto', type: 'auto', version: '0.64.0' };
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/extension-inject', path: 'auto', type: 'auto', version: '0.63.2-1-x' };
export const packageInfo = { name: '@polkadot/extension-inject', path: 'auto', type: 'auto', version: '0.64.0' };
@@ -8,9 +8,18 @@ import type { AccountJson, AccountWithChildren } from '@polkadot/extension-base/
import { buildHierarchy } from './buildHierarchy.js';
// Was Polkadot and Kusama. `compareByNetwork` resolves a genesis hash through
// `getNetworkMap()`, which is built from `selectableNetworks` — and this fork
// only offers chains whose accounts are post-quantum (quantus/common#1), so
// neither is in it any more. Both would resolve to '' and compare equal, so the
// network-ordering tests below would have passed without ordering anything.
//
// QUANTUS sorts before HEISENBERG, by display name 'Quantus' < 'Quantus
// Heisenberg' — the same direction 'Kusama' < 'Polkadot' ran, so the fixtures
// keep their shape.
const genesisExample = {
KUSAMA: '0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe',
POLKADOT: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3'
HEISENBERG: '0xa5aa9e5c84d4a3722c152295e7973c9af522f2fb1ef7db5afaa3d5f4dc8d3b4f',
QUANTUS: '0xfb5487c0be6ae4ade2d41d16e50465129861636c2b8d61fa94d7a19631626fba'
} as const;
const testHierarchy = (accounts: AccountJson[], expected: AccountWithChildren[]): void => {
@@ -69,15 +78,15 @@ describe('Use Account Hierarchy', () => {
it('sorts accounts by network', () => {
testHierarchy(
[{ address: 'b', genesisHash: genesisExample.KUSAMA }, { address: 'a', genesisHash: genesisExample.POLKADOT }, { address: 'c', genesisHash: genesisExample.KUSAMA }],
[{ address: 'b', genesisHash: genesisExample.KUSAMA }, { address: 'c', genesisHash: genesisExample.KUSAMA }, { address: 'a', genesisHash: genesisExample.POLKADOT }]
[{ address: 'b', genesisHash: genesisExample.QUANTUS }, { address: 'a', genesisHash: genesisExample.HEISENBERG }, { address: 'c', genesisHash: genesisExample.QUANTUS }],
[{ address: 'b', genesisHash: genesisExample.QUANTUS }, { address: 'c', genesisHash: genesisExample.QUANTUS }, { address: 'a', genesisHash: genesisExample.HEISENBERG }]
);
});
it('sorts accounts by network and name', () => {
testHierarchy(
[{ address: 'b', genesisHash: genesisExample.KUSAMA, name: 'b-last-kusama' }, { address: 'a', genesisHash: genesisExample.POLKADOT }, { address: 'c', genesisHash: genesisExample.KUSAMA, name: 'a-first-kusama' }],
[{ address: 'c', genesisHash: genesisExample.KUSAMA, name: 'a-first-kusama' }, { address: 'b', genesisHash: genesisExample.KUSAMA, name: 'b-last-kusama' }, { address: 'a', genesisHash: genesisExample.POLKADOT }]
[{ address: 'b', genesisHash: genesisExample.QUANTUS, name: 'b-last-quantus' }, { address: 'a', genesisHash: genesisExample.HEISENBERG }, { address: 'c', genesisHash: genesisExample.QUANTUS, name: 'a-first-quantus' }],
[{ address: 'c', genesisHash: genesisExample.QUANTUS, name: 'a-first-quantus' }, { address: 'b', genesisHash: genesisExample.QUANTUS, name: 'b-last-quantus' }, { address: 'a', genesisHash: genesisExample.HEISENBERG }]
);
});
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/extension', path: 'auto', type: 'auto', version: '0.63.2-1-x' };
export const packageInfo = { name: '@polkadot/extension', path: 'auto', type: 'auto', version: '0.64.0' };
+39 -20
View File
@@ -1282,28 +1282,29 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/keyring@npm:^14.0.3":
version: 14.0.3
resolution: "@polkadot/keyring@npm:14.0.3"
"@polkadot/keyring@https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fkeyring/-/14.0.3-quantus.1/keyring-14.0.3-quantus.1.tgz":
version: 14.0.3-quantus.1
resolution: "@polkadot/keyring@https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fkeyring/-/14.0.3-quantus.1/keyring-14.0.3-quantus.1.tgz"
dependencies:
"@polkadot/util": "npm:14.0.3"
"@polkadot/util-crypto": "npm:14.0.3"
"@polkadot/util-crypto": "npm:14.0.3-quantus.1"
"@quantus/crypto": "npm:^0.1.0"
tslib: "npm:^2.8.0"
peerDependencies:
"@polkadot/util": 14.0.3
"@polkadot/util-crypto": 14.0.3
checksum: 10/69f9f776363f8327d72b43794262ae709fc2824182637e499ed6e9ca94315645d78005bf1f25bdfb7305e5d79879cb932c114e6612467ddf21a760117834e8a2
checksum: 10/513818828aebd066ec618e114441bbd2aa9cb83527fce4a78867d3b9f982e4bb17527090642d704a2a8b1fd047276b30ce8c22efcdc10c81d3e318f4b42c7059
languageName: node
linkType: hard
"@polkadot/networks@npm:^14.0.3":
version: 14.0.3
resolution: "@polkadot/networks@npm:14.0.3"
"@polkadot/networks@https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fnetworks/-/14.0.3-quantus.1/networks-14.0.3-quantus.1.tgz":
version: 14.0.3-quantus.1
resolution: "@polkadot/networks@https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fnetworks/-/14.0.3-quantus.1/networks-14.0.3-quantus.1.tgz"
dependencies:
"@polkadot/util": "npm:14.0.3"
"@substrate/ss58-registry": "npm:^1.51.0"
tslib: "npm:^2.8.0"
checksum: 10/eb006f537f103b0d417e52966d0098b528326d1ebbae84e4c7834627bb3e863b7b849856992aa58c4a0aeb0ed1e1838a9619aeba7610d0e7c75e99ffcc6c9ecd
checksum: 10/5d93c35908eec5b41f29ffd4a5a79234c7329264e61d6b4346398e5b495b80109c5ce35a2f2bb95e9f6fc4eb22b9da047b9ca4191ec73a668c43da73861d7122
languageName: node
linkType: hard
@@ -1492,14 +1493,14 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/ui-keyring@npm:^3.16.7":
version: 3.16.7
resolution: "@polkadot/ui-keyring@npm:3.16.7"
"@polkadot/ui-keyring@https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fui-keyring/-/3.16.7-quantus.1/ui-keyring-3.16.7-quantus.1.tgz":
version: 3.16.7-quantus.1
resolution: "@polkadot/ui-keyring@https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Fui-keyring/-/3.16.7-quantus.1/ui-keyring-3.16.7-quantus.1.tgz"
dependencies:
"@polkadot/keyring": "npm:^14.0.3"
"@polkadot/keyring": "npm:14.0.3-quantus.1"
"@polkadot/ui-settings": "npm:3.16.7"
"@polkadot/util": "npm:^14.0.3"
"@polkadot/util-crypto": "npm:^14.0.3"
"@polkadot/util-crypto": "npm:14.0.3-quantus.1"
mkdirp: "npm:^3.0.1"
rxjs: "npm:^7.8.1"
store: "npm:^2.0.12"
@@ -1508,7 +1509,7 @@ __metadata:
"@polkadot/keyring": "*"
"@polkadot/ui-settings": "*"
"@polkadot/util": "*"
checksum: 10/12d3f7e39918f5ce5e017d26ba0cabf6253f3cd27d08bd5c1de95680f5bcb303381ed6ba82b49764b7295bf9e49b048a66052211c25495daf5b8484e50578759
checksum: 10/8f475e2fbbf795a82513e5195ec924f4c3077cb9cf6f09205db6507a814a527b0b99ba077e44ba506e3c8120366ae1f33371653858c7ed1f291bc1fd2917cb9f
languageName: node
linkType: hard
@@ -1541,24 +1542,25 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/util-crypto@npm:^14.0.3":
version: 14.0.3
resolution: "@polkadot/util-crypto@npm:14.0.3"
"@polkadot/util-crypto@https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Futil-crypto/-/14.0.3-quantus.1/util-crypto-14.0.3-quantus.1.tgz":
version: 14.0.3-quantus.1
resolution: "@polkadot/util-crypto@https://git.lair.cafe/api/packages/quantus/npm/%40polkadot%2Futil-crypto/-/14.0.3-quantus.1/util-crypto-14.0.3-quantus.1.tgz"
dependencies:
"@noble/curves": "npm:^1.3.0"
"@noble/hashes": "npm:^1.3.3"
"@polkadot/networks": "npm:14.0.3"
"@polkadot/networks": "npm:14.0.3-quantus.1"
"@polkadot/util": "npm:14.0.3"
"@polkadot/wasm-crypto": "npm:^7.5.3"
"@polkadot/wasm-util": "npm:^7.5.3"
"@polkadot/x-bigint": "npm:14.0.3"
"@polkadot/x-randomvalues": "npm:14.0.3"
"@quantus/crypto": "npm:^0.1.0"
"@scure/base": "npm:^1.1.7"
"@scure/sr25519": "npm:^0.2.0"
tslib: "npm:^2.8.0"
peerDependencies:
"@polkadot/util": 14.0.3
checksum: 10/e8f2da806cb81d3c014415bdd633f0fc5871132ce790ca892f65899010386d64fa25f7c047574cc96402afa03b5ff77e4dff904e69b90e714a7150e18ef0f507
checksum: 10/ae364a2c47ea6033222f34766f83f3c3740966f83f380978b716013d4ab3862f03355034afe6ef84e7f28c90bda1eb347114c342acd5f4844566580d13d34341
languageName: node
linkType: hard
@@ -1731,6 +1733,16 @@ __metadata:
languageName: node
linkType: hard
"@quantus/crypto@npm:^0.1.0":
version: 0.1.1
resolution: "@quantus/crypto@npm:0.1.1::__archiveUrl=https%3A%2F%2Fgit.lair.cafe%2Fapi%2Fpackages%2Fquantus%2Fnpm%2F%2540quantus%252Fcrypto%2F-%2F0.1.1%2Fcrypto-0.1.1.tgz"
dependencies:
fflate: "npm:^0.8.2"
tslib: "npm:^2.7.0"
checksum: 10/2ba96cc2310b7c9ede22ed848ba05a9c789345b4ecb4b880e100a65b8280497e79c76f48fa4721e15c8e5567c0278fd08987e7cb10492dfa4e53c0be1d741e68
languageName: node
linkType: hard
"@rollup/plugin-alias@npm:^5.1.1":
version: 5.1.1
resolution: "@rollup/plugin-alias@npm:5.1.1"
@@ -7389,6 +7401,13 @@ __metadata:
languageName: node
linkType: hard
"fflate@npm:^0.8.2":
version: 0.8.3
resolution: "fflate@npm:0.8.3"
checksum: 10/6ebf528dc9c56e78e715eac615b009b25dc33e15c1920b11ebba44e6d76181c647756a81a23e19247907496b93aa99928514c53090579a65109e026ac2824aa7
languageName: node
linkType: hard
"figures@npm:^3.0.0":
version: 3.2.0
resolution: "figures@npm:3.2.0"