-
Notifications
You must be signed in to change notification settings - Fork 40
perf: inline SszEx.hash
function
#722
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ defmodule LambdaEthereumConsensus.SszEx do | |
@zero_chunk <<0::size(@bits_per_chunk)>> | ||
@zero_hashes ZeroHashes.compute_zero_hashes() | ||
|
||
@compile {:inline, hash: 1} | ||
@spec hash(iodata()) :: binary() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldnt this function live outside of SSZ? I see it's being used in other places too, like shuffling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe. We just added it here since adding a new module for this function seemed like too much |
||
def hash(data), do: :crypto.hash(:sha256, data) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ defmodule Types.Store do | |
proposer_boost_root: Types.root() | nil, | ||
equivocating_indices: MapSet.t(Types.validator_index()), | ||
checkpoint_states: %{Checkpoint.t() => BeaconState.t()}, | ||
# NOTE: the `Checkpoint` values in latest_messages are `LatestMessage`s | ||
latest_messages: %{Types.validator_index() => Checkpoint.t()}, | ||
Comment on lines
+42
to
43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was puzzled by this when working on other things, so I added this comment |
||
unrealized_justifications: %{Types.root() => Checkpoint.t()}, | ||
tree_cache: Tree.t() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL