efdf759cc0
This PR reduces the number of database queries for slashing protection from 5 reads and 1 write to 2 reads and 1 write in the optimistic case. In the process, it removes user-level support for writing the database in the version 1 format in order to simplify the code flow, and prevent code rot. In particular, the v1 format was not covered by any unit tests and has no advantages over v2. The concrete code to read and write it remains for now, in particular to support upgrades from v1 to v2. The branch also removes the use of concepts which doesn't work with checked exceptions - in particular, this highlights code that both raises exceptions and returns error codes, which could be cleaned up in the future. * Cache internal validator ID * Rely on unique index to check for trivial duplicate votes * Combine two surround vote queries into one * Combine API for checking and registering slashing into single function The slashing DB is normally not a bottleneck, but may become one with high attached validator counts. |
||
---|---|---|
.. | ||
README.md | ||
attestation_aggregation.nim | ||
keystore_management.nim | ||
slashing_protection.nim | ||
slashing_protection_common.nim | ||
slashing_protection_v1.nim | ||
slashing_protection_v2.nim | ||
validator_duties.nim | ||
validator_pool.nim |
README.md
Validators
This folder holds all modules related to a Beacon Chain Validator besides the binaries they interact directly with (nimbus_validator_cliant and nimbus_signing_process):
- Validator keystore
- Validator slashing protection
- Validator duties
- Validator pool