Skip to content

Simplify poseidon usage#571

Open
illuzen wants to merge 1 commit into
mainfrom
illuzen/simpler-poseidon
Open

Simplify poseidon usage#571
illuzen wants to merge 1 commit into
mainfrom
illuzen/simpler-poseidon

Conversation

@illuzen
Copy link
Copy Markdown
Contributor

@illuzen illuzen commented May 27, 2026

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-poseidon wrapper across the workspace and wires qp-poseidon-core from 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-poseidon is removed from node, runtime, wormhole, mining-rewards, dilithium-crypto, and related Cargo.toml / feature lists.

The main API change is qp_header::Header: it goes from Header<Number, BlockHashHasher, StateHasher> to Header<Number, Hashing>, with all header roots and parent_hash as H256, Poseidon block hashing implemented inside qp-header via qp_poseidon_core, and Hashing (e.g. BlakeTwo256) only for state trie / extrinsics roots. Runtime, opaque types, frame-system mocks, and wormhole tests are updated to Header<BlockNumber, BlakeTwo256> and Hash = H256 instead of PoseidonHasher.

pallet-wormhole no longer requires ToFelts on 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.

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.

1 participant