You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: Ethereum/EVM validation is ~20× slower than other chains (BigInt Keccak) #1
src/utils/keccak256.ts runs Keccak-f[1600] on BigInt lanes. Every EVM validation hashes the address, even when it's all lowercase, to fill in details.checksum. So EVM chains are the slowest family, and detectBlockchain slows down with them.
npm run benchmark on Node 24:
before
after
ethereum
3,903 /s
~42,000 /s
EVM detection
3,193 /s
~13,800 /s
Proposed fix (PR to follow): store each 64-bit lane as two 32-bit halves in a Uint32Array and precompute the rho/pi index table. The output matches @noble/hashes for 9,795 differential cases, plus new block-boundary tests at 135, 136, 137, 271, 272, 273 and 500 bytes. Cost: +139 B gzip on the ethereum chunk.
Keccak-256 now runs on 32-bit lane halves instead of BigInt (commit f0962c9). Checksummed EVM validation goes from ~4.3k to ~49k ops/s; output still matches @noble/hashes across all differential cases.
I could reproduce the throughput gap on main (e15d788). On Node 22.16, the repository benchmark measured about 5,600 checksummed Ethereum validations/s and 218,000 Bitcoin validations/s on the same machine. This is worth addressing for batch users.
A focused Keccak change would be welcome on its own. Keeping valid and details.checksum identical gives us a clean way to evaluate it. Please include before/after numbers on the same host, the gzip delta, and differential checks against @noble/hashes around the 136-byte block boundary. #10 closed without merging, so its speedup is still a proposed improvement.
Activity
Dhananjay-alt commentedon Nov 21, 2026
Fixed in #10.
Keccak-256 now runs on 32-bit lane halves instead of BigInt (commit f0962c9). Checksummed EVM validation goes from ~4.3k to ~49k ops/s; output still matches @noble/hashes across all differential cases.
Samarth208P commentedon Nov 21, 2026
I could reproduce the throughput gap on
main(e15d788). On Node 22.16, the repository benchmark measured about 5,600 checksummed Ethereum validations/s and 218,000 Bitcoin validations/s on the same machine. This is worth addressing for batch users.A focused Keccak change would be welcome on its own. Keeping
validanddetails.checksumidentical gives us a clean way to evaluate it. Please include before/after numbers on the same host, the gzip delta, and differential checks against@noble/hashesaround the 136-byte block boundary. #10 closed without merging, so its speedup is still a proposed improvement.