Skip to content

Conversation

@gballet
Copy link
Member

@gballet gballet commented Jul 1, 2020

No description provided.

Comment on lines +482 to +484
d := hasherPoolNoCache.Get().(crypto.KeccakState)
d.Reset()
defer hasherPoolNoCache.Put(d)
Copy link
Contributor

Choose a reason for hiding this comment

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

As an alternative, you let the outer world provide a hasher, which is reused by this stacktrie. Something like :

hasker := crypto.NewKeccakState()
st := NewStacktrie( hasher)
for {
  st.TryUpdate(key, value)
}
h := st.Hash()

Then you wouldn't need the pooling, but you'd instead need to separate between the public StackTrie and the internal stackTrie node representations.

@holiman
Copy link
Contributor

holiman commented Sep 18, 2020

This can be closed now, I think.. ?
Deprecated by #21407

@holiman holiman closed this Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants