Skip to content

Commit

Permalink
fix: use hashtree for ssz benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Jun 12, 2024
1 parent 321a0e5 commit 00f8a99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/persistent-merkle-tree/src/hasher/hashtree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const hasher: Hasher = {

for (const [i, out] of output.entries()) {
const offset = i * 32;
out.applyHash(byteArrayToHashObject(result.slice(offset, offset + 32)));
out.applyHash(byteArrayToHashObject(result.subarray(offset, offset + 32)));
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions setHasher.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Set the hasher to as-sha256
// Used to run benchmarks with with visibility into as-sha256 performance, useful for Lodestar
// Set the hasher to hashtree
// Used to run benchmarks with with visibility into hashtree performance, useful for Lodestar
import {setHasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/index.js";
import {hasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/as-sha256.js";
import {hasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/hashtree.js";
setHasher(hasher);

0 comments on commit 00f8a99

Please sign in to comment.