Fix: SubstrateConfigBuilder::set_genesis_hash is a no-op#2236
Open
RomarQ wants to merge 2 commits into
Open
Conversation
…sis_hash `SubstrateConfigBuilder::set_genesis_hash` stored the value on the builder, but `build()` did not propagate it to `SubstrateConfigInner`, and `impl Config for SubstrateConfig` never overrode `genesis_hash()`, falling back to the trait default of `None`. As a result, offline workflows that rely on the configured genesis hash (e.g. `OfflineClient::new_with_config(...).at_block(...).tx().create_signable_offline(...)`) fail with `ExtrinsicError::GenesisHashNotProvided` even when the user calls `set_genesis_hash`. The online path is unaffected because the genesis hash comes from the network and is stored on `OnlineClient`. `PolkadotConfig` inherits the same behaviour since its `genesis_hash()` delegates to the wrapped `SubstrateConfig`. Add the missing wiring (one field, one impl method) and a couple of tests covering the two paths.
3010037 to
9ea70a5
Compare
bkchr
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SubstrateConfigBuilder::set_genesis_hashis a no-op: the value is stored on the builder butbuild()never copies it intoSubstrateConfigInner, andimpl Config for SubstrateConfignever overridesgenesis_hash(), so it falls back to the trait default ofNone.Offline workflows that rely on the configured genesis hash fail with
ExtrinsicError::GenesisHashNotProvided:The
OnlineClientpath is unaffected, since the hash is fetched from the network whengenesis_hashis None.This adds the missing
genesis_hashfield onSubstrateConfigInner, propagates it throughbuild(), and overridesConfig::genesis_hashforSubstrateConfig.