Simplify poseidon usage#571
Open
illuzen wants to merge 1 commit into
Open
Conversation
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.
shouldn't change any hashes, but simplifies Header definition
depends on the new qp-poseidon PR Quantus-Network/qp-poseidon#74
Note
High Risk
Header and block-hash logic are consensus-critical; the PR relies on a fixed-hash regression test to prove behavior is unchanged after dependency and type-parameter refactors.
Overview
This PR drops the
qp-poseidonwrapper across the workspace and wiresqp-poseidon-corefrom a local path (../qp-poseidon/core, 1.5.0 in the lockfile). Call sites that only needed hashing/serialization now depend on core directly;qp-poseidonis removed from node, runtime, wormhole, mining-rewards, dilithium-crypto, and relatedCargo.toml/ feature lists.The main API change is
qp_header::Header: it goes fromHeader<Number, BlockHashHasher, StateHasher>toHeader<Number, Hashing>, with all header roots andparent_hashasH256, Poseidon block hashing implemented insideqp-headerviaqp_poseidon_core, andHashing(e.g.BlakeTwo256) only for state trie / extrinsics roots. Runtime, opaque types, frame-system mocks, and wormhole tests are updated toHeader<BlockNumber, BlakeTwo256>andHash = H256instead ofPoseidonHasher.pallet-wormholeno longer requiresToFeltson balances, asset IDs, transfer counts, or account types—those bounds were tied to the old Poseidon pallet. Header stability is guarded by a test that pins a known devnet header hash rather than comparing two code paths.Reviewed by Cursor Bugbot for commit d066cd3. Bugbot is set up for automated code reviews on this repo. Configure here.