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

[wip] trie: enable Commit for stacktrie #21282

Closed
wants to merge 6 commits into from

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants