[Trie] Allow swapping out keccak256
implementation
#1918
Replies: 2 comments
-
It does feel a bit awkward how https://github.com/faustbrian/ethereumjs-monorepo/commit/566c6e714aa6cecf16c65bd6b8f1289625cb937e is implemented because instead of using a shared object between all files without requiring constructor parameters the function has to be passed around everywhere where it is used. This is how the library is architected but nevertheless it does feel a bit awkward compared to a shared object that holds implementations of functions that are used throughout the library. |
Beta Was this translation helpful? Give feedback.
-
A bit in the same spirit as my answer on the other thread: currently we are very much (95%+) focused on getting the breaking releases out of the door, basically the whole month of June will be dedicated to that. Since the suggestion here would be a non-breaking change I would put a bit aside. |
Beta Was this translation helpful? Give feedback.
-
Currently when you use the
SecureTrie
from thetrie
package you are automatically getting thekeccak256
function from https://github.com/ethereum/js-ethereum-cryptography which is a pure JS implementation of that algorithm. There might be scenarios where you want to swap out that implementation for something more performant like https://github.com/bcoin-org/bcrypto, especially if you have high frequency read and write operations. The implementation for this should be fairly straightforward because it would only concern theTrie
,SecureTrie
andTrieNode
implementations.Could look something like https://github.com/faustbrian/ethereumjs-monorepo/commit/566c6e714aa6cecf16c65bd6b8f1289625cb937e
Beta Was this translation helpful? Give feedback.
All reactions