nimbus-eth1/tests
Jacek Sieka f034af422a
Pre-allocate vids for branches (#2882)
Each branch node may have up to 16 sub-items - currently, these are
given VertexID based when they are first needed leading to a
mostly-random order of vertexid for each subitem.

Here, we pre-allocate all 16 vertex ids such that when a branch subitem
is filled, it already has a vertexid waiting for it. This brings several
important benefits:

* subitems are sorted and "close" in their id sequencing - this means
that when rocksdb stores them, they are likely to end up in the same
data block thus improving read efficiency
* because the ids are consequtive, we can store just the starting id and
a bitmap representing which subitems are in use - this reduces disk
space usage for branches allowing more of them fit into a single disk
read, further improving disk read and caching performance - disk usage
at block 18M is down from 84 to 78gb!
* the in-memory footprint of VertexRef reduced allowing more instances
to fit into caches and less memory to be used overall.

Because of the increased locality of reference, it turns out that we no
longer need to iterate over the entire database to efficiently generate
the hash key database because the normal computation is now faster -
this significantly benefits "live" chain processing as well where each
dirtied key must be accompanied by a read of all branch subitems next to
it - most of the performance benefit in this branch comes from this
locality-of-reference improvement.

On a sample resync, there's already ~20% improvement with later blocks
seeing increasing benefit (because the trie is deeper in later blocks
leading to more benefit from branch read perf improvements)

```
blocks: 18729664, baseline: 190h43m49s, contender: 153h59m0s
Time (total): -36h44m48s, -19.27%
```

Note: clients need to be resynced as the PR changes the on-disk format

R.I.P. little bloom filter - your life in the repo was short but
valuable
2024-12-04 11:42:04 +01:00
..
bootstrap config: fix new config based on input from jamie and zahary 2021-09-18 17:34:51 +07:00
customgenesis Revert "Adopt latest changes to requests hash computation" (#2892) 2024-11-29 16:13:08 +07:00
db Added support for namespaces to RocksDb kvstore. (#2066) 2024-03-12 11:04:46 +08:00
engine_api Revert "Adopt latest changes to requests hash computation" (#2892) 2024-11-29 16:13:08 +07:00
fixtures Fix EIP-2537: Precompile for BLS12-381 curve operations (#2603) 2024-09-10 06:56:08 +00:00
graphql Workaround for 0 gas price estimation (#2180) 2024-05-28 13:36:38 +07:00
invalid_keystore Fix keystore loader bug (#2774) 2024-10-24 04:07:06 +00:00
keystore implement more eth rpc and keystore management 2020-07-23 14:54:32 +07:00
replay Cleanup db/core_apps error handling (#2838) 2024-11-07 08:24:21 +07:00
test_aristo Pre-allocate vids for branches (#2882) 2024-12-04 11:42:04 +01:00
test_coredb Cleanup db/core_apps error handling (#2838) 2024-11-07 08:24:21 +07:00
test_forked_chain Add desc validator to fc unit tests (#2899) 2024-12-02 17:49:53 +00:00
test_jwt_auth Enable JWT authentication for websockets (#1039) 2022-04-06 15:11:13 +01:00
test_txpool Bump nim-eth and nimbus-eth2 (#2741) 2024-10-16 13:51:38 +07:00
all_tests.nim Port p2p to server API (#2769) 2024-11-02 10:30:45 +01:00
all_tests_macro.nim Cache code and invalid jump destination tables (fixes #2268) (#2404) 2024-06-21 09:44:10 +02:00
asynctest.nim Core db and aristo updates for destructor and tx logic (#1894) 2023-11-16 19:35:03 +00:00
macro_assembler.nim Speed up evm stack (#2881) 2024-11-30 10:07:10 +01:00
nim.cfg import: read from era files (#2254) 2024-05-31 09:13:56 +02:00
persistBlockTestGen.nim Use eth/common transaction signature utilities (#2696) 2024-10-04 16:34:31 +02:00
test_allowed_to_fail.nim ForkedChain implementation (#2405) 2024-06-26 07:27:48 +07:00
test_aristo.nim Small deserialization speedup (#2852) 2024-11-20 16:04:32 +01:00
test_block_fixture.nim replace deprecated types (#2704) 2024-10-16 08:34:12 +07:00
test_blockchain_json.nim Simplify state root api (#2864) 2024-11-22 14:15:35 +01:00
test_config.nim Bump nim-eth, nim-web3, nimbus-eth2 (#2344) 2024-06-14 14:31:08 +07:00
test_configuration.nim rm --protocol CLI flag (#2793) 2024-10-28 22:17:07 +00:00
test_coredb.nim Cleanup (#2565) 2024-08-15 12:31:07 +00:00
test_coredb.nim.cfg Store keys together with node data (#2849) 2024-11-20 09:56:27 +01:00
test_difficulty.nim switch to Nim v2.0.12 (#2817) 2024-11-01 19:06:26 +00:00
test_engine_api.nim Cleanup db/core_apps error handling (#2838) 2024-11-07 08:24:21 +07:00
test_evm_support.nim Speed up evm stack (#2881) 2024-11-30 10:07:10 +01:00
test_filters.nim replace deprecated types (#2704) 2024-10-16 08:34:12 +07:00
test_forked_chain.nim Add desc validator to fc unit tests (#2899) 2024-12-02 17:49:53 +00:00
test_forkid.nim replace deprecated types (#2704) 2024-10-16 08:34:12 +07:00
test_generalstate_json.nim Remove trie_defs imports (#2872) 2024-11-25 16:37:57 +01:00
test_genesis.nim Revert "Adopt latest changes to requests hash computation" (#2892) 2024-11-29 16:13:08 +07:00
test_getproof_json.nim Remove trie_defs imports (#2872) 2024-11-25 16:37:57 +01:00
test_graphql.nim move db init to init (#2552) 2024-08-08 07:45:30 +02:00
test_helpers.nim switch to Nim v2.0.12 (#2817) 2024-11-01 19:06:26 +00:00
test_jwt_auth.nim replace deprecated types (#2704) 2024-10-16 08:34:12 +07:00
test_ledger.nim Cleanup db/core_apps error handling (#2838) 2024-11-07 08:24:21 +07:00
test_multi_keys.nim Cleanup stateless and block witness code. (#2295) 2024-06-08 15:05:00 +07:00
test_op_arith.nim Fix styles and reduce compiler warnings (#2086) 2024-03-20 14:35:38 +07:00
test_op_bit.nim Fix styles and reduce compiler warnings (#2086) 2024-03-20 14:35:38 +07:00
test_op_custom.nim Fix styles and reduce compiler warnings (#2086) 2024-03-20 14:35:38 +07:00
test_op_env.nim post-merge nrpc fix (#2685) 2024-10-03 11:42:24 +00:00
test_op_memory.nim switch to Nim v2.0.12 (#2817) 2024-11-01 19:06:26 +00:00
test_op_misc.nim Fix styles and reduce compiler warnings (#2086) 2024-03-20 14:35:38 +07:00
test_persistblock_json.nim Consolidate block type for block processing (#2325) 2024-06-09 16:32:20 +02:00
test_precompiles.nim Bump nim-eth and nimbus-eth2 (#2741) 2024-10-16 13:51:38 +07:00
test_rpc.nim Engine API: Route more wiring from CoreDb to ForkedChain (#2844) 2024-11-07 03:43:25 +00:00
test_tools_build.nim Remove `hunter` (#2697) 2024-10-06 10:11:44 +00:00
test_tracer_json.nim Store keys together with node data (#2849) 2024-11-20 09:56:27 +01:00
test_transaction_json.nim Unify tx validation (#2777) 2024-10-26 09:19:48 +02:00
test_txpool.nim Bump nim-eth and nimbus-eth2 (#2741) 2024-10-16 13:51:38 +07:00
test_txpool2.nim Cleanup db/core_apps error handling (#2838) 2024-11-07 08:24:21 +07:00
tracerTestGen.nim Remove EVM indirect imports and unused EVM errors (#2370) 2024-06-17 09:56:39 +02:00