Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

pallet-beefy-mmr: fix when using custom hashing #14273

Merged
merged 1 commit into from
May 31, 2023

Conversation

acatangiu
Copy link
Contributor

@acatangiu acatangiu commented May 31, 2023

Fix on top of #14214:

Hash is no longer part of pallet_mmr::Config, but this code would still build because it assumes we're referring to underlying <pallet_mmr::Config as frame_system::Config>::Hash which is not what we want when using different hashing between frame_system and pallet_mmr.

Disambiguate by using correct/custom pallet_mmr::Config::Hashing type.

`Hash` is no longer part of `pallet_mmr::Config`, but this code
would still build because it assumes we're referring to underlying
`<pallet_mmr::Config as frame_system::Config>::Hash` which is not
what we want when using different hashing between `frame_system`
and `pallet_mmr`.

Disambiguate by using correct `pallet_mmr::Config::Hashing` type.

Signed-off-by: acatangiu <adrian@parity.io>
@acatangiu acatangiu self-assigned this May 31, 2023
@acatangiu acatangiu added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels May 31, 2023
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

Why wasn't this detected by the CI? 🤔

@acatangiu acatangiu merged commit 5aa4677 into paritytech:master May 31, 2023
@acatangiu
Copy link
Contributor Author

acatangiu commented May 31, 2023

Why wasn't this detected by the CI? 🤔

Because it's only deployed in Rococo now, where frame_system::Config::Hash === pallet_mmr::Config::Hash so compiler was ultimately happy 😄

On Millau (bridges test chain) it complained loudly.

@acatangiu acatangiu deleted the fix-pallet-beefy-mmr branch May 31, 2023 15:47
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
`Hash` is no longer part of `pallet_mmr::Config`, but this code
would still build because it assumes we're referring to underlying
`<pallet_mmr::Config as frame_system::Config>::Hash` which is not
what we want when using different hashing between `frame_system`
and `pallet_mmr`.

Disambiguate by using correct `pallet_mmr::Config::Hashing` type.

Signed-off-by: acatangiu <adrian@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants