NethermindEth / Paprika

A custom storage engine of Nethermind, benefiting from the alignment of the underlying data structure with the layout of State & Storage trees of Ethereum.
GNU Lesser General Public License v3.0
91 stars 14 forks source link

RawState much faster application #418

Closed Scooletz closed 2 weeks ago

Scooletz commented 2 weeks ago

This PR changes how RawState commits its data. Previously the algorithm was to commit data locally, therefore copying them over to a new structure and only then apply this on the database. With the new one, the data are applied directly on the batch, making ApplyRaw void returning as no committed representation is needed. To properly construct the next block, we get the read transaction after _current.ApplyRaw and batch.Commit happens, leaving no need to actually take a dependency on the now non-existent ancestor.

If the usage of such structure shows some bottleneck around the read dependency from the database, then it's the database to blame and requires further digging in.

github-actions[bot] commented 2 weeks ago

Code Coverage

Package Line Rate Branch Rate Health
Paprika 85% 80%
Summary 85% (4735 / 5574) 80% (1573 / 1962)

Minimum allowed line rate is 75%