Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept/Support Custom Header Hasher from Parachain #6992

Closed
2 tasks done
AurevoirXavier opened this issue Dec 24, 2024 · 2 comments
Closed
2 tasks done

Accept/Support Custom Header Hasher from Parachain #6992

AurevoirXavier opened this issue Dec 24, 2024 · 2 comments
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@AurevoirXavier
Copy link
Contributor

AurevoirXavier commented Dec 24, 2024

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

Some parachains use their own Hash type.

For instance, Hyperbridge defines a custom hash implementation (keccak256).

I discovered this while trying to match a Hyperbridge block with the Polkadot event’s parainclusion::CandidateIncluded.para_head field. Unfortunately, all the hash values were mismatched, making it impossible to index the Hyperbridge block based on the para_head value.

It seems that Polkadot assumes the use of blake2_256 for generating hashes, which may not align with Hyperbridge’s implementation.

Might relate to #5224?

Steps to reproduce

No response

@AurevoirXavier AurevoirXavier added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Dec 24, 2024
@bkchr
Copy link
Member

bkchr commented Dec 24, 2024

parainclusion::CandidateIncluded.para_head this is a field of a relay chain structure. That right now the hash matches most of the parachain header hashes is a coincidence, not done this way by design. There could be other chains which may insert different data to the head or just store a hash in para head. All of that is possible. These para_head hash is required by the internals of the relay chain and can not be changed.

For your request, the best is that you directly fetch all the heads and match them to the parachains. The paras::Heads will give you directly the mapping from ParaId to Head.

@bkchr bkchr closed this as completed Dec 24, 2024
@AurevoirXavier
Copy link
Contributor Author

AurevoirXavier commented Dec 24, 2024

That right now the hash matches most of the parachain header hashes is a coincidence, not done this way by design. There could be other chains which may insert different data to the head or just store a hash in para head.

Make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

2 participants