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

Offload signature checking to taskpools (gigagas!) #2927

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Offload signature checking to taskpools (gigagas!) #2927

merged 2 commits into from
Dec 13, 2024

Conversation

arnetheduck
Copy link
Member

In block processing, depending on the complexity of a transaction and hotness of caches etc, signature checking can actually make up the majority of time needed to process a transaction (60% observed in some randomly sampled block ranges).

Fortunately, this is a task that trivially can be offloaded to a task pool similar to how nimbus-eth2 does it.

This PR introduces taskpools in the most simple way possible, by performing signature checking concurrently with other TX processing, assigning a taskpool task per TX effectively.

With this little trick, we're in gigagas land 🎉 on my laptop!

INF 2024-12-10 21:05:35.170+01:00 Imported blocks
blockNumber=3874817 b... mgps=1222.707 ...

Tests don't use the taskpool for now because it needs manual cleanup and we don't have a good mechanism in place. Future PR:s should address this by creating a common shutdown sequence that also closes and cleans up other resources like the DB.

@arnetheduck arnetheduck changed the title Offload signature checking to taskpools Offload signature checking to taskpools (gigagas!) Dec 11, 2024
In block processing, depending on the complexity of a transaction and
hotness of caches etc, signature checking can actually make up the
majority of time needed to process a transaction (60% observed in some
randomly sampled block ranges).

Fortunately, this is a task that trivially can be offloaded to a task
pool similar to how nimbus-eth2 does it.

This PR introduces taskpools in the most simple way possible, by
performing signature checking concurrently with other TX processing,
assigning a taskpool task per TX effectively.

With this little trick, we're in gigagas land 🎉 on my laptop!

```
INF 2024-12-10 21:05:35.170+01:00 Imported blocks
blockNumber=3874817 b... mgps=1222.707 ...
```

Tests don't use the taskpool for now because it needs manual cleanup and
we don't have a good mechanism in place. Future PR:s should address this
by creating a common shutdown sequence that also closes and cleans up
other resources like the DB.
@jangko jangko merged commit 3d58393 into master Dec 13, 2024
26 checks passed
@jangko jangko deleted the tp-sigs branch December 13, 2024 04:53
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.

2 participants