diff --git a/CHANGELOG.md b/CHANGELOG.md index a52752a..522c71a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.12.1 + +### Fixed + +- **All three built-in network genesis hashes refreshed after chain resets.** `PASEO_ASSET_HUB`, `PREVIEWNET`, and `PREVIEWNET_ASSET_HUB` all pinned genesis values from earlier deployments of those chains. Each was verified dead against live RPC via `chain_getBlockHash(0)`: + + | Constant | Was | Now | + |---|---|---| + | `PASEO_ASSET_HUB` | `0xbf0488…ef19f` | `0x23e730eb1c6fecae09c917439a5038cb6122d0d48980e8b9bbf0ff56f94a2ca6` | + | `PREVIEWNET` | `0x477dd8…12525` | `0x8c27ddf678c2ae9bef0efebfc485a9309f3d735c6d3fbb8d947afc3ace0e80f4` | + | `PREVIEWNET_ASSET_HUB` | `0x860d75…c7867c` | `0x4d11c803cc6921429e3876638977ad006ea1bba8cd3976a0bca2f164e7026210` | + +### Internal + +- The chain-feature integration test now reads the expected genesis from `PASEO_ASSET_HUB.genesisHash` instead of repeating the literal, so the next reset is a one-line change in `src/networks.ts`. + ## 0.12.0 ### Breaking changes diff --git a/forum-post.md b/forum-post.md index d291a34..ffe4257 100644 --- a/forum-post.md +++ b/forum-post.md @@ -749,3 +749,29 @@ Alias errors moved out of `RequestCredentialsErr` into their own enum (`RingNotF 1. Upgrade to `0.12.0` and move your product side to `@parity/truapi@^0.6.0` or `@novasamatech/host-api-wrapper@^0.9.1` in the same commit. 2. Through the wrapper, nothing else. Hand-built requests: wrap indices in `derivationIndexOf()` and adjust the three shapes above. 3. If your fixtures still pass `chain:`, see 0.10.0 — it is silently ignored, so any `rpcUrl` override you set is being dropped. + +--- + +# host-api-test-sdk 0.12.1 + +One fix. Drop-in upgrade from `0.12.0`. + +## Fixed + +- **All three built-in network genesis hashes refreshed after chain resets.** `PASEO_ASSET_HUB`, `PREVIEWNET`, and `PREVIEWNET_ASSET_HUB` were all pinned to genesis values from earlier deployments of those chains, verified dead against live RPC: + + | Constant | Was | Now | + |---|---|---| + | `PASEO_ASSET_HUB` | `0xbf0488…ef19f` | `0x23e730eb1c6fecae09c917439a5038cb6122d0d48980e8b9bbf0ff56f94a2ca6` | + | `PREVIEWNET` | `0x477dd8…12525` | `0x8c27ddf678c2ae9bef0efebfc485a9309f3d735c6d3fbb8d947afc3ace0e80f4` | + | `PREVIEWNET_ASSET_HUB` | `0x860d75…c7867c` | `0x4d11c803cc6921429e3876638977ad006ea1bba8cd3976a0bca2f164e7026210` | + +The host routes each connection request to a network by genesis hash, so a stale pin means the host does not recognise the chain your product is asking for. The symptom is the product stuck at `connection-status: "connecting"` until the test times out, with a reachable RPC endpoint and nothing obviously wrong in the logs. + +One thing worth calling out: before this release the pins were wrong but *consistent*. A test host and a set of descriptors both generated against the same dead chain agree with each other perfectly, so a suite can be green while connected to a chain that no longer exists. If your e2e went green across one of these resets without you touching anything, that is what happened. + +## What you need to do + +- Upgrade to `0.12.1`. If you use the built-in network configs, that is the whole change — the correct hashes come with the upgrade. +- If you hard-coded any of the three old hashes in your own `NetworkConfig` or in test assertions, update them. Better still, read them off the exported config (`PASEO_ASSET_HUB.genesisHash`) so the next reset costs you nothing. +- These chains reset periodically. Treat a genesis literal in your own repo as something that will go stale, not as a constant. diff --git a/package.json b/package.json index 73e7558..f3b98c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@parity/host-api-test-sdk", - "version": "0.12.0", + "version": "0.12.1", "description": "Lightweight test host for Spektr product E2E testing — embeds dapps with auto-signing dev accounts, no Docker needed", "license": "MIT", "repository": { diff --git a/src/networks.ts b/src/networks.ts index 7a54a98..b81af5e 100644 --- a/src/networks.ts +++ b/src/networks.ts @@ -3,7 +3,7 @@ import type { NetworkConfig, HexString } from './types.js'; export const PASEO_ASSET_HUB: NetworkConfig = { id: 'paseo-asset-hub', name: 'Paseo Asset Hub', - genesisHash: '0xbf0488dbe9daa1de1c08c5f743e26fdc2a4ecd74cf87dd1b4b1eeb99ae4ef19f' as HexString, + genesisHash: '0x23e730eb1c6fecae09c917439a5038cb6122d0d48980e8b9bbf0ff56f94a2ca6' as HexString, rpcUrl: 'wss://paseo-asset-hub-next-rpc.polkadot.io', tokenSymbol: 'PAS', tokenDecimals: 10, @@ -12,7 +12,7 @@ export const PASEO_ASSET_HUB: NetworkConfig = { export const PREVIEWNET: NetworkConfig = { id: 'previewnet', name: 'Previewnet', - genesisHash: '0x477dd87a881ae4d8072030073406be59de42215b4a7c4c337ce1a25727912525' as HexString, + genesisHash: '0x8c27ddf678c2ae9bef0efebfc485a9309f3d735c6d3fbb8d947afc3ace0e80f4' as HexString, rpcUrl: 'wss://previewnet.substrate.dev/relay/alice', tokenSymbol: 'UNIT', tokenDecimals: 12, @@ -21,7 +21,7 @@ export const PREVIEWNET: NetworkConfig = { export const PREVIEWNET_ASSET_HUB: NetworkConfig = { id: 'previewnet-asset-hub', name: 'Previewnet Asset Hub', - genesisHash: '0x860d75a890388e2ad02c54aa451264d04af89765773a51cd56868b4293c7867c' as HexString, + genesisHash: '0x4d11c803cc6921429e3876638977ad006ea1bba8cd3976a0bca2f164e7026210' as HexString, rpcUrl: 'wss://previewnet.substrate.dev/asset-hub', tokenSymbol: 'UNIT', tokenDecimals: 12, diff --git a/test/integration.spec.ts b/test/integration.spec.ts index 6d0d925..1e27c0f 100644 --- a/test/integration.spec.ts +++ b/test/integration.spec.ts @@ -12,7 +12,7 @@ import { test, expect } from '@playwright/test'; import { Keyring } from '@polkadot/keyring'; import { cryptoWaitReady, sr25519Verify } from '@polkadot/util-crypto'; import { compactFromU8a, hexToU8a, u8aToHex } from '@polkadot/util'; -import { createTestHostServer } from '../dist/index.js'; +import { createTestHostServer, PASEO_ASSET_HUB } from '../dist/index.js'; import { loadHost, serveProduct } from './support'; // ── Helpers ───────────────────────────────────────────────────────── @@ -1239,10 +1239,11 @@ test.describe('Feature check', () => { try { const product = await loadHostAndProduct(page, host.url, productServer.url); - // Default chain is PASEO_ASSET_HUB - const result = await product.evaluate(() => - window.__TEST_PRODUCT__.featureSupported('Chain', - '0xbf0488dbe9daa1de1c08c5f743e26fdc2a4ecd74cf87dd1b4b1eeb99ae4ef19f')); + // Default chain is PASEO_ASSET_HUB. Read the genesis from the config + // rather than repeating the literal, so a chain reset only needs one edit. + const result = await product.evaluate((genesis: string) => + window.__TEST_PRODUCT__.featureSupported('Chain', genesis), + PASEO_ASSET_HUB.genesisHash); expect(result.ok).toBe(true); expect(result.supported).toBe(true); } finally {