nimbus-eth2/beacon_chain/spec
Jacek Sieka 1ef7d237cc
Shared validator pubkey (#5883)
This PR allows sharing the pubkey data between validators by using a
thread-local cache for pubkey data, netting about a 400mb mem usage
reduction on holesky due to us keeping 3 permanent + several ephemeral
state copies in memory at all times and each state copy holding a full
validator.

The PR also introduces a hash cache for the key which gives ~14% speedup
for a full state `hash_tree_root` - the key makes up for a large part of
the `Validator` htr time.

Finally, the time it takes to copy a state goes down as well from ~80m
ms to ~60, for reasons similar to htr.

We use a `ptr` even if a `ref` could in theory have been used - there is
not much practical benefit to a `ref` (given it's mutable) while a `ptr`
is cheaper and easier to copy (when copying temporary states).

We could go further and cache a cooked pubkey but it turns out this is
quite intrusive - in all the relevant places, we're already using a
cooked key from the immutable validator data so there are no immediate
performance gains of doing so while managing the compressed -> cooked
key mapping would become more difficult - something for a future PR
perhaps.

Co-authored-by: Etan Kissling <etan@status.im>
2024-02-21 20:06:19 +01:00
..
datatypes Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
eth2_apis Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
mev add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
presets automated consensus spec URL updating to v1.4.0-beta.6 (#5804) 2024-01-20 11:19:47 +00:00
beacon_time.nim automated consensus spec URL updating to v1.4.0-beta.6 (#5804) 2024-01-20 11:19:47 +00:00
beaconstate.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
block_id.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
crypto.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
deposit_snapshots.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
digest.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
engine_authentication.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
english_word_list.txt
eth2_merkleization.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
eth2_ssz_serialization.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
forks.nim prevent accidentally hashing `BeaconState`/`BeaconBlock` in Deneb (#5852) 2024-02-06 19:57:53 +01:00
forks_light_client.nim fix LC header production for Deneb (#5763) 2024-01-16 22:54:20 +00:00
helpers.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
keystore.nim Clean up debug/heads v2 types (#5859) 2024-02-07 17:51:12 +01:00
light_client_sync.nim add missing `std/` prefix to more imports (#5696) 2024-01-06 07:18:28 +01:00
network.nim automated consensus spec URL updating to v1.4.0-beta.6 (#5804) 2024-01-20 11:19:47 +00:00
presets.nim automated consensus spec URL updating to v1.4.0-beta.6 (#5804) 2024-01-20 11:19:47 +00:00
signatures.nim update builder API spec reference URLs to v0.4.0 (#5812) 2024-01-22 08:36:46 +01:00
signatures_batch.nim automated consensus spec URL updating to v1.4.0-beta.6 (#5804) 2024-01-20 11:19:47 +00:00
ssz_codec.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
state_transition.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
state_transition_block.nim search for validator indices backwards while processing deposits (#5914) 2024-02-20 06:34:57 +02:00
state_transition_epoch.nim refactor epoch state transition to facilitate individual validator balance change calculations (#5910) 2024-02-20 05:14:52 +00:00
validator.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
weak_subjectivity.nim automated consensus spec URL updating to v1.4.0-beta.6 (#5804) 2024-01-20 11:19:47 +00:00