Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client/Monorepo: Use WASM Crypto (keccak256) for Hashing / Consistent…
… Hash Function Overwrite (#3192) * Add @polkadot/wasm crypto dependency * Use @polkadot/wasm keccak256 for trie key hashing in execution state manager for VM * Tighten calling for useKeyHashingFunction * Add customCrypto options dict to Common, first keccak256 usage and test * Add custom keccak256 usage to EVM keccak256 opcode * Add wasm based ecrecover option * export calcSigRecovery * use customcrypto if available * add test for custom ecrecover * Add optional common to trie interface * Add cli option * Rebuild package-lock.json * Add @polkadot/util as a dev dependency to the tx package for testing * Rebuild package-lock.json * Pass common into trie instantiations in snap sync fetchers * Use wasm keccak function if available in bytecodeFetcher * Use wasm keccak function if available in trienodeFetcher * Refactor default statemanager trie and keccak256 usage to allow option of WASM version * Refactor rpc statemanager trie and keccak256 usage to allow option of WASM version * Refactor verkle statemanager trie and keccak256 usage to allow option of WASM version * Fix reference to statemanager opts * Pass common to verifyProof trie instantiation * Test if trie shallowCopy is using the correct hashing function * Update packages/tx/src/capabilities/legacy.ts Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com> * Update packages/tx/src/capabilities/legacy.ts Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com> * Update packages/tx/src/capabilities/legacy.ts Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com> * Update packages/tx/src/capabilities/legacy.ts Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com> * tx: fix double declaration * Use wasm keccak function if available in block * Use consistent naming for opts parameter * Update package-lock * Use wasm keccak function if available in header * Use consistent naming for opts parameter * Explicitly declare return type * Pass common to tries instantiated in genTrieRoot functions * Fix tests * Fix test * Block: add suggestions from code review * Add test for Block hash() method with custom crypto * Some clean-up * Pass common in vm and testrunner tries * Update evm usage for customCrypto * Move wasm crypto tests to client * add optional wasm keccak in misc uses * Add polkadot/util * import util directly * resolve polkadot/util to fake dep * Devp2p: Use WASM Crypto * Devp2p: add keccak function and Common passing structure to RLPx, DPT, DNS * Client: pass in common along devp2p DPT instantiation * Devp2p: expand to ECIES, first replacement test * Devp2p: First full-round replacement (including concatBytes occurrences) for ECIES * Devp2p: integrate into DPT server and message * Devp2p: Add to DNS ENR * Devp2p: remove util keccak256 helper function * Mock polkadot util module * try installing peers * Add custom sha256 support and tests * Add wasm ecSign * Passing common in various places * Fix import * block/client: minor changes * Add ecrecover function --------- Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com> Co-authored-by: Amir <indigophi@protonmail.com> Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com> Co-authored-by: Gabriel Rocheleau <contact@rockwaterweb.com>
- Loading branch information