prysm-pulse/beacon-chain/db/slasherkv
Manu NALEPA cb80d5ad32
Slasher: Reduce surrounding/surrounded attestations processing time (#13629)
* Improve package documentation.

* `processAttestations`: Improve logging.

* Add `Benchmark_checkSurroundVotes` benchmark.

* Implement `saveChunksToDisk` as remplacement of `saveUpdatedChunks`.

The idea is to open only on DB transaction for all validator chunk indexes instead of
one DB transaction per validator chunk index.

It saves the overhead due to transaction start/stop of the DB.

Result of `Benchmark_checkSurroundVotes`:
- Before this commit: 133 seconds
- After this commit: 5.05 seconds

* `LoadSlasherChunks` and `SaveSlasherChunks`: Batch.

* `loadChunks` ==> `loadChunksFromDisk`

* `updatedChunkByChunkIndex`: Don't update if `latestEpochWritten == currentEpoch `.

* `updatedChunkByChunkIndex`: Load all needed chunks once.

* `latestEpochWritten` ==> `latestEpochUpdated`.

* `checkSurroundVotes`: Dump to disk at most every `25_600` chunks.

* `SaveAttestationRecordsForValidators`: Batch.

* `batchSize`: Use as package const and add comment.
2024-02-21 15:12:37 +00:00
..
BUILD.bazel Slasher: Reduce surrounding/surrounded attestations processing time (#13629) 2024-02-21 15:12:37 +00:00
kv_test.go Update to V5 (#13622) 2024-02-15 05:46:47 +00:00
kv.go Update to V5 (#13622) 2024-02-15 05:46:47 +00:00
log.go Optimized Slasher Database Methods (#8805) 2021-04-23 12:06:13 -05:00
metrics.go Optimized Slasher Database Methods (#8805) 2021-04-23 12:06:13 -05:00
pruning_test.go Update to V5 (#13622) 2024-02-15 05:46:47 +00:00
pruning.go Update to V5 (#13622) 2024-02-15 05:46:47 +00:00
schema.go Beacon node slasher improvement (#13549) 2024-01-31 09:49:14 +00:00
slasher_test.go Slasher: Reduce surrounding/surrounded attestations processing time (#13629) 2024-02-21 15:12:37 +00:00
slasher.go Slasher: Reduce surrounding/surrounded attestations processing time (#13629) 2024-02-21 15:12:37 +00:00
slasherkv_test.go Replace ioutil with io and os (#10541) 2022-04-18 20:42:07 +00:00