Skip to content

Commit

Permalink
chores: replace eth2_hashing with ethereum_hashing
Browse files Browse the repository at this point in the history
This is a necessary step to update ring, which is necessary to build in risc-v.

Part of #1444.
  • Loading branch information
come-maiz committed Sep 13, 2024
1 parent e58bcb4 commit 91c1031
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 37 deletions.
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

0 comments on commit 91c1031

Please sign in to comment.