ssz
ssz copied to clipboard
Typescript implementation of Simple Serialize (SSZ)
see https://github.com/ChainSafe/lodestar/issues/3116
With typescript 4.4.2, the `node.ts` is compiled to: ```js export abstract class Node implements HashObject { // this is to save an extra variable to check if a node has...
Lodestar spends significant CPU time converting uint types from decimal to bytes and back. For example, converting the balance tree to flat and back consist of doing 200_000 ops of...
Using the iterable interface instead of Arrays is much slower, even a `for of` of an array is slower than a simple `for(;;)` iterating over an array. Since ssz is...
Keys with a trailing number like `signedHeader1` are not correctly cased: ``` signed_header1 ``` this breaks compatibility with the eth2 api spec
Generators and callback based iterators are shown to be slower than raw for loops. Replace where possible.
1. General methods (without prefix) 2. struct_* 3. tree_* 4. bytes_*
To research potential improvements I've written a manual createTreeBackedFromStruct() function for the validator object ```ts const pubkey_n4 = new LeafNode(validator.pubkey.slice(0, 32)); const pubkey_n5 = new LeafNode(validator.pubkey.slice(32, 64)); const pubkey_n6 =...
**Is your feature request related to a problem? Please describe.** We have no assurance in CI that code doesn't break in the browser, and it does. **Describe the solution you'd...
## Motivation: + Currently the struct `hashTreeRoot()` returns a Buffer while a TreeBacked returns Uint8Array, we want both of them to return Uint8Array