Skip to content

feat: consume chain.getChainInfo discovery, bump truapi@0.9.0 - #298

Merged
valentinfernandez1 merged 6 commits into
mainfrom
vf/chain-discovery
Aug 18, 2026
Merged

feat: consume chain.getChainInfo discovery, bump truapi@0.9.0#298
valentinfernandez1 merged 6 commits into
mainfrom
vf/chain-discovery

Conversation

@valentinfernandez1

@valentinfernandez1 valentinfernandez1 commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

What

@parity/product-sdk-host gains getHostChainInfo(), a cached facade over truapi's chain.getChainInfo that resolves chain roles (AssetHub, Bulletin, People) to genesis hashes from the host's own configuration instead of the SDK hard-coding them. getChainAPI() can now be called with no argument inside a discovery-capable container, deriving the environment by matching the discovered asset hub genesis against the bundled descriptors. Calls that pass an environment behave exactly as before on hosts predating discovery; the zero-arg form throws there, and outside a container, asking for an explicit environment.

Cross-validated against dotli.dev, which implements the host side of the supported-chain genesis query, by linking this branch into host-playground locally and adding a method there that calls chain.getChainInfo.

@Imod7 Imod7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging that product-sdk/pending-changesets/deprecate-context-alias.md has a "Use instead" row pointing at SignerManager.getProductAccountAlias(context, location) and says the ring VRF operations are "host-backed so the host selects the member key within the ring". This PR falsifies both. Since #294's code is already on main, any release cut after this merges publishes that advice against a signature it does not contain, whichever wave promotes the changeset. Only those two clauses need touching; the rest of the file is historical record and should stay frozen.

Comment thread product-sdk/packages/chain-client/src/presets.ts Outdated
Comment thread product-sdk/packages/host/src/accounts.ts Outdated
Comment thread product-sdk/packages/host/src/testing.ts
Comment thread product-sdk/packages/host/src/chain-discovery.ts
Comment thread product-sdk/packages/chain-client/src/presets.ts Outdated
@peetzweg

Copy link
Copy Markdown
Member

Looking forward for this getting in and published!

Reconciles the truapi 0.9.0 bump with #292's `signVrf` surface: `ProductAccountLookup`
and the object-form `toWireProductAccountId` come from main, the `DerivationIndex`
selector it wraps is 0.9.0's `Index`, and main's three `signVrf` tests move off the
old `Left` tag accordingly.
@valentinfernandez1

Copy link
Copy Markdown
Collaborator Author

Will hold this until #299 lands on main

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

📦 Bundle size impact

Comparing 2026-08-18T17:22:29.351Z2026-08-18T17:22:19.755Z

Package Entry Bundled before Bundled after Δ Ship gzip Δ Shake ratio
🟢 @parity/product-sdk . 6.41 MB 6.42 MB +3.3 KB (+0.1%) 0 B 0% (was 0%)
🟢 @parity/product-sdk ./chain 6.17 MB 6.17 MB +3.3 KB (+0.1%) 0 B 0% (was 0%)
🟢 @parity/product-sdk ./cloud-storage 6.35 MB 6.35 MB +3.3 KB (+0.1%) 0 B 3% (was 3%)
🟢 @parity/product-sdk ./core 6.41 MB 6.42 MB +3.3 KB (+0.1%) 0 B 0% (was 0%)
🟢 @parity/product-sdk ./host 88.9 KB 90.0 KB +1.1 KB (+1.2%) 0 B 2% (was 2%)
🟢 @parity/product-sdk ./local-storage 58.4 KB 58.5 KB +13 B (+0.0%) 0 B 100% (was 100%)
🟢 @parity/product-sdk ./react 6.42 MB 6.43 MB +3.3 KB (+0.1%) 0 B 0% (was 0%)
🟢 @parity/product-sdk ./testing 58.3 KB 58.5 KB +244 B (+0.4%) 0 B 26% (was 26%)
🟢 @parity/product-sdk ./wallet 188.1 KB 188.2 KB +90 B (+0.0%) 0 B 1% (was 1%)
🟢 @parity/product-sdk-chain-client . 6.17 MB 6.17 MB +3.3 KB (+0.1%) +1.2 KB 0% (was 0%)
🟢 @parity/product-sdk-cloud-storage . 6.35 MB 6.35 MB +3.3 KB (+0.1%) 0 B 3% (was 3%)
🟢 @parity/product-sdk-host . 88.9 KB 90.0 KB +1.1 KB (+1.2%) +644 B 2% (was 2%)
🟢 @parity/product-sdk-host ./testing 9.8 KB 10.0 KB +242 B (+2.4%) +198 B 67% (was 69%)
🟢 @parity/product-sdk-local-storage . 58.4 KB 58.5 KB +13 B (+0.0%) 0 B 100% (was 100%)
🟢 @parity/product-sdk-signer . 188.1 KB 188.2 KB +90 B (+0.0%) +39 B 1% (was 1%)
🟢 @parity/product-sdk-statement-store . 100.5 KB 101.6 KB +1.1 KB (+1.1%) 0 B 10% (was 10%)

Thresholds — warn: ≥10% or ≥5.0 KB · fail: ≥20% or ≥15.0 KB (bundled). Percentage only applies once the baseline is ≥ 10 KB.

@valentinfernandez1
valentinfernandez1 merged commit 2436980 into main Aug 18, 2026
12 of 13 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.

3 participants