nimbus-eth1/nimbus
Jacek Sieka df4a21c910
Store cached hash at the layer corresponding to the source data (#2492)
When lazily verifying state roots, we may end up with an entire state
without roots that gets computed for the whole database - in the current
design, that would result in hashes for the entire trie being held in
memory.

Since the hash depends only on the data in the vertex, we can store it
directly at the top-most level derived from the verticies it depends on
- be that memory or database - this makes the memory usage broadly
linear with respect to the already-existing in-memory change set stored
in the layers.

It also ensures that if we have multiple forks in memory, hashes get
cached in the correct layer maximising reuse between forks.

The same layer numbering scheme as elsewhere is reused, where -2 is the
backend, -1 is the balancer, then 0+ is the top of the stack and stack.

A downside of this approach is that we create many small batches - a
future improvement could be to collect all such writes in a single
batch, though the memory profile of this approach should be examined
first (where is the batch kept, exactly?).
2024-07-18 09:13:56 +02:00
..
beacon Use block number or timestamp to determine fork rules (#2496) 2024-07-17 17:05:53 +07:00
common Use block number or timestamp to determine fork rules (#2496) 2024-07-17 17:05:53 +07:00
core Simplify txPool gasLimit calculator (#2498) 2024-07-17 20:48:35 +07:00
db Store cached hash at the layer corresponding to the source data (#2492) 2024-07-18 09:13:56 +02:00
evm EVM: use assign2 whenever possible (#2499) 2024-07-17 20:48:50 +07:00
graphql Use simpler schema when writing transactions, receipts, and withdrawals (#2420) 2024-06-29 12:43:17 +07:00
rpc Core db remove legacy phrases (#2468) 2024-07-10 12:19:35 +00:00
stateless Cleanup stateless and block witness code. (#2295) 2024-06-08 15:05:00 +07:00
sync Use block number or timestamp to determine fork rules (#2496) 2024-07-17 17:05:53 +07:00
transaction odds and ends (#2481) 2024-07-13 20:42:49 +02:00
utils No ext update (#2494) 2024-07-16 19:47:59 +00:00
TODO-TRACER.md Aristo uses pre classified tree types (#2385) 2024-06-18 11:14:02 +00:00
common.nim implement better hardfork management 2022-12-02 13:51:42 +07:00
compile_info.nim Remove EVM indirect imports and unused EVM errors (#2370) 2024-06-17 09:56:39 +02:00
config.nim Not using deprecated functions in config anymore (#2495) 2024-07-17 02:57:19 +00:00
constants.nim Convert GasInt to uint64, bump nim-eth and nimbus-eth2 (#2461) 2024-07-07 06:52:11 +00:00
errors.nim Remove EVM indirect imports and unused EVM errors (#2370) 2024-06-17 09:56:39 +02:00
launcher.nim Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
makefile Snap sync fix trie interpolation fringe condition (#1457) 2023-02-01 18:56:06 +00:00
nim.cfg import: read from era files (#2254) 2024-05-31 09:13:56 +02:00
nimbus.nim metrics: enable during import (#2401) 2024-06-20 19:06:58 +02:00
nimbus_desc.nim rm full sync (#2324) 2024-06-08 07:41:44 +07:00
nimbus_import.nim Shift era helpers to a different file (#2475) 2024-07-12 03:15:14 +00:00
no-tracer.nim Core db remove legacy phrases (#2468) 2024-07-10 12:19:35 +00:00
rpc.nim Aristo uses pre classified tree types (#2385) 2024-06-18 11:14:02 +00:00
transaction.nim Convert GasInt to uint64, bump nim-eth and nimbus-eth2 (#2461) 2024-07-07 06:52:11 +00:00
version.nim Add startup banner (#2354) 2024-06-14 10:08:44 +02:00