Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch slashing protection registration #5604

Merged
merged 4 commits into from
Nov 19, 2023
Merged

Batch slashing protection registration #5604

merged 4 commits into from
Nov 19, 2023

Conversation

arnetheduck
Copy link
Member

This PR brings down the time to send 100 attestations from ~1s to ~100ms, making it feasible to run 10k validators on a single node (which regularly send 300 attestations / slot).

This is done by batching the slashing protection database write in a single transaction thus avoiding a slow fsync for every signature - effects will be more pronounced on slow drives.

The benefit applies both to beacon and client validators.

This PR brings down the time to send 100 attestations from ~1s to
~100ms, making it feasible to run 10k validators on a single node (which
regularly send 300 attestations / slot).

This is done by batching the slashing protection database write in a
single transaction thus avoiding a slow fsync for every signature -
effects will be more pronounced on slow drives.

The benefit applies both to beacon and client validators.
Copy link

github-actions bot commented Nov 16, 2023

Unit Test Results

         9 files  ±0    1 098 suites  ±0   27m 32s ⏱️ -7s
  3 951 tests ±0    3 604 ✔️ ±0  347 💤 ±0  0 ±0 
16 066 runs  ±0  15 668 ✔️ ±0  398 💤 ±0  0 ±0 

Results for commit 1c62fe3. ± Comparison against base commit 98e9690.

♻️ This comment has been updated with latest results.

source, target, attestation_signing_root)

template withContext*(db: SlashingProtectionDB, body: untyped): untyped =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the v1 slashing protection not ever write anymore? My understanding had been that it was there for read-only migration purposes only.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not v1 - it's a leftover of the v1/v2 abstraction scheme (that technically could be cleaned up)

@arnetheduck arnetheduck merged commit e1e809e into unstable Nov 19, 2023
11 checks passed
@arnetheduck arnetheduck deleted the slashing-batch branch November 19, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants