Expensive struct hashing. #14065
Labels
closed due inactivity
The issue/PR was automatically closed due to inactivity.
stale
The issue/PR was marked as stale because it has been open for too long.
I need to create a unique hash for a Struct.
Using
keccak256(abi.encode())
on all 10 fields costs 1210 gasAs a comparison, hashing directly
msg.data
(which contains all fields data but also includes lengths, abi offsets and methodsig) costs 143 gasI understand the compiler has some overheads (like validating the address range, and multiple keccak calls), but I don't think it warrants 8 times the gas price.
Remix example (the given struct to encode is taken from erc4337
Partly-related issues:
The text was updated successfully, but these errors were encountered: