Skip to content

RFC 0026: Host chain discovery and name resolution - #354

Open
valentinfernandez1 wants to merge 6 commits into
mainfrom
rfc-0026-supported-chains
Open

RFC 0026: Host chain discovery and name resolution#354
valentinfernandez1 wants to merge 6 commits into
mainfrom
rfc-0026-supported-chains

Conversation

@valentinfernandez1

@valentinfernandez1 valentinfernandez1 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Closes #352.

@valentinfernandez1
valentinfernandez1 requested review from a team August 6, 2026 17:21
Add the RFC document plus its protocol surface: chain.getSupportedChains (wire id 166) enumerates the chains a host serves as (name, network, genesisHash) descriptors, and chain.resolveChain (168) maps a (name, network) pair to its genesis hash or NotFound. Both trait methods are stubs returning unavailable, so products stop hard-coding genesis hashes once hosts implement the backing syscall in a follow-up.
@valentinfernandez1
valentinfernandez1 force-pushed the rfc-0026-supported-chains branch from c9fecf0 to c94a07b Compare August 6, 2026 17:21

@pgherveou pgherveou 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.

I would add a single method that takes all the identifiant we want to resolve. It should be enough.

Also as you are adding this you can fix all the hard coded genesis hash from the other comment api tests

Comment thread rust/crates/truapi/src/v01/chain.rs Outdated
Comment thread rust/crates/truapi/src/v01/chain.rs Outdated
@johnthecat

Copy link
Copy Markdown
Contributor

I think more ergonomic and focused API would be

enum ChainIdentifier {
  relay,
  people,
  /// ...
}

struct ChainInfo {
  genesisHash: [u8; 32],
  name: String,
  /// ...
}

fn getChainInfo(ChainIdentifier): ChainInfo;

User don't need a full mapping every time where later he need to pick specific chain from list

Comment thread docs/rfcs/0026-supported-chains.md Outdated
@valentinfernandez1

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback, it's been implemented so feel free to review again

Comment thread docs/rfcs/0026-supported-chains.md Outdated
Comment thread docs/rfcs/0026-supported-chains.md Outdated
@valentinfernandez1
valentinfernandez1 added this pull request to the merge queue Aug 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 8, 2026
@filvecchiato
filvecchiato added this pull request to the merge queue Aug 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 8, 2026
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.

Let products discover the host's chains instead of hard-coding genesis hashes

4 participants