Skip to content

chore: remove use of pedersen where possible#19823

Merged
ledwards2225 merged 1 commit intonextfrom
lde/remove-pedersen
Jan 22, 2026
Merged

chore: remove use of pedersen where possible#19823
ledwards2225 merged 1 commit intonextfrom
lde/remove-pedersen

Conversation

@ledwards2225
Copy link
Contributor

@ledwards2225 ledwards2225 commented Jan 21, 2026

Summary of changes:

  • Removed Pedersen re-exports from aztec-nr: Removed pedersen_hash and pedersen_commitment re-exports from aztec/src/hash.nr and protocol_types/src/hash.nr. (Can still use Pedersen via std::hash::pedersen_hash directly).
  • Migrated production contracts to Poseidon2: Updated card_game_contract, lending_contract, and boxes/vanilla to use poseidon2_hash instead of pedersen_hash.
  • Cleaned up dead C++ Pedersen code: Removed unused native Pedersen utility functions (hash_pair_native, hash_native, compute_tree_root_native, compute_tree_native) from barretenberg merkle tree infrastructure. Updated tests/benchmarks to use PedersenHashPolicy::hash_pair instead.
  • Updated test contracts: Changed test_contract to import pedersen_hash_with_separator from std::hash instead of the removed aztec-nr re-export.
  • Updated test snapshots: Refreshed snapshot tests in noir_test_gen.test.ts and contract_class_id.test.ts to reflect changed contract hashes.

@ledwards2225 ledwards2225 added the ci-full Run all master checks. label Jan 21, 2026
@ledwards2225 ledwards2225 marked this pull request as ready for review January 21, 2026 19:43
Copy link
Contributor

@LeilaWang LeilaWang left a comment

Choose a reason for hiding this comment

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

Thanks for removing it everywhere 🙏

Copy link
Contributor

@iAmMichaelConnor iAmMichaelConnor left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. Looks reasonable to me.
I'm not familiar with much of typescript-land, so might want sign-off from someone on that.
It's surprising how much typescript code was using pedersen -- it suggests many of those functions aren't used.

@ledwards2225
Copy link
Contributor Author

Thanks for doing this. Looks reasonable to me. I'm not familiar with much of typescript-land, so might want sign-off from someone on that. It's surprising how much typescript code was using pedersen -- it suggests many of those functions aren't used.

Is @nventuro the right person to weigh in on the TS? if some of this code can be removed altogether then even better

remove use from merkle infra

fix noir contracts failure

update snap

one more
@ledwards2225 ledwards2225 added this pull request to the merge queue Jan 22, 2026
@AztecBot
Copy link
Collaborator

AztecBot commented Jan 22, 2026

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/d27124a74db27cf1�d27124a74db27cf18;;�): yarn-project/scripts/run_test.sh ethereum/src/l1_tx_utils/l1_tx_utils.test.ts (106s) (code: 1) group:e2e-p2p-epoch-flakes (\033ledwards2225\033: chore: remove use of pedersen where possible (#19823))

Merged via the queue into next with commit 8c0fb5e Jan 22, 2026
17 of 18 checks passed
@ledwards2225 ledwards2225 deleted the lde/remove-pedersen branch January 22, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run all master checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments