nimbus-eth2/beacon_chain/spec/eth2_apis
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
..
dynamic_fee_recipients.nim remove expensive logging from function called in prepareBeaconProposer inner loop (#5776) 2024-01-17 22:58:46 +00:00
eth2_rest_serialization.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
rest_beacon_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_beacon_client.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_builder_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_common.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_config_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_debug_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_event_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_keymanager_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_keymanager_types.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
rest_light_client_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_nimbus_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_node_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_remote_signer_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_types.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
rest_validator_calls.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00