Skip to content

Conversation

winder
Copy link
Collaborator

@winder winder commented Oct 7, 2025

The go-ethereum hash function we need is a trivial wrapper around standard go libraries. Use them directly rather than calling into go-ethereum.

@winder winder force-pushed the will/no-evm-hasher branch from afc93df to b194d49 Compare October 7, 2025 17:00
@winder winder force-pushed the will/no-evm-hasher branch from b194d49 to 3e87205 Compare October 7, 2025 17:36
h.Write(data) //nolint:revive // keccak256 never returns an error
var out [32]byte
copy(out[:], h.Sum(nil))
h.Reset()
Copy link
Contributor

@0xAustinWang 0xAustinWang Oct 9, 2025

Choose a reason for hiding this comment

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

is this h.reset necessary? We already reset right before usage on line 24

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. The pool is private, so there's no benefit to the extra caution.

Copy link

github-actions bot commented Oct 9, 2025

Metric will/no-evm-hasher main
aggregator Coverage 47.1% 47.1%

@0xAustinWang
Copy link
Contributor

CI failing, but will approve after

Comment on lines +10 to +14
var hasherPool = sync.Pool{
New: func() any {
return sha3.NewLegacyKeccak256()
},
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this needed?

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.

3 participants