nimbus-eth2
nimbus-eth2 copied to clipboard
Refactoring idea: Don't deserialize the blocks into regular Nim objects. Keep them as SSZ byte blobs instead.
If the state transition functions are modified to use SSZ navigators when accessing the data stored in blocks, we won't ever need to deserialize a block to a regular Nim object in memory. Blocks always enter our system as compressed SSZ blobs (either from the network or from the database) and we can just decompress them and then pass them around as blobs. Some minor performance wins are expected due to reduced copying of data and less memory allocations (due to the dynamic lists stored in blocks).