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

chore: replace eth2_hashing with ethereum_hashing #1445

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 12 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion trin-validation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors = ["https://github.com/ethereum/trin/graphs/contributors"]
alloy-primitives.workspace = true
anyhow.workspace = true
enr = "0.10.0"
eth2_hashing = "0.2.0"
ethereum_hashing = "0.7.0"
ethereum_ssz.workspace = true
ethereum_ssz_derive.workspace = true
ethportal-api.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions trin-validation/src/accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ impl PreMergeAccumulator {
// convert total difficulty to B256
let header_difficulty = B256::from(header_record.total_difficulty.to_le_bytes());
// calculate hash of the header record
let header_record_hash = B256::from_slice(&eth2_hashing::hash32_concat(
let header_record_hash = B256::from_slice(&ethereum_hashing::hash32_concat(
header_record.block_hash.as_slice(),
header_difficulty.as_slice(),
));
// iterate over every header record in the epoch acc to create the leaves
let leaves = epoch_acc
.iter()
.map(|record| {
B256::from_slice(&eth2_hashing::hash32_concat(
B256::from_slice(&ethereum_hashing::hash32_concat(
record.block_hash.as_slice(),
record.total_difficulty.as_le_slice(),
))
Expand Down
2 changes: 1 addition & 1 deletion trin-validation/src/merkle/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// https://github.com/sigp/lighthouse/blob/bf533c8e42/consensus/merkle_proof/src/lib.rs
use crate::merkle::safe_arith::ArithError;
use alloy_primitives::B256;
use eth2_hashing::{hash, hash32_concat, ZERO_HASHES};
use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES};
use lazy_static::lazy_static;

const MAX_TREE_DEPTH: usize = 32;
Expand Down
Loading