A custom storage engine of Nethermind, benefiting from the alignment of the underlying data structure with the layout of State & Storage trees of Ethereum.
This PR reintroduces the ability for the SlottedArray to address 8kb. Also, removes the masking of the hash which could make the Prepare / Unprepare a bit faster. This is an enabler for #375 to make pages bigger and allow to amortize more.
To make it work, this PR splits the cases of keys:
0-length - encoded as 0b00 in preamble
1,2,3 - nibbles - length encoded as one nibble in the hash, marker set in preamble 0b01
4 nibbles - 0b10 in preamble to represent 4
5+ nibbles - 0b11 in preamble to represent 5+ as some key parts will be in the array
As the values above take 2 bits, 1 bit is used to mark Odd/Deleted. This leaves 13 out of 16 to address 8k
This PR reintroduces the ability for the
SlottedArray
to address 8kb. Also, removes the masking of the hash which could make thePrepare
/Unprepare
a bit faster. This is an enabler for #375 to make pages bigger and allow to amortize more.To make it work, this PR splits the cases of keys:
0b00
in preamble0b01
0b10
in preamble to represent 40b11
in preamble to represent 5+ as some key parts will be in the arrayAs the values above take 2 bits, 1 bit is used to mark Odd/Deleted. This leaves 13 out of 16 to address 8k
Benchmarks
Before
After