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

perf: state root cache test #1378

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

perf: state root cache test #1378

wants to merge 14 commits into from

Conversation

rodrigo-o
Copy link
Collaborator

@rodrigo-o rodrigo-o commented Feb 4, 2025

Description

This is just a test PR, to validate that moving the cache of the state root to the current block enhance block procesing by nearly 3s in mainnet. This is not intended to be merged, just used as reference on other tests

@rodrigo-o
Copy link
Collaborator Author

rodrigo-o commented Feb 4, 2025

This generates a couple of issues related to block signature that we need to check, it was just a POC of moving around the cache and make sure how much it enhance the block processing

@rodrigo-o
Copy link
Collaborator Author

The block processing has reduced its time by ~3/4 seconds

Before

INFO 19:30:26.903 [Fork choice] Adding new block slot=10997406 root=0x172..b1a8
INFO 19:30:42.722 [Fork choice] Block processed. Recomputing head. 
INFO 19:30:43.274 [Fork choice] Added new block slot=10997406 root=0x172..b1a8
INFO 19:30:43.274 [Fork choice] Recomputed head slot=10997406 root=0x172..b1a8
INFO 19:30:43.274 [Fork choice] Block processing time: 15.819s | Recompute head time: 0.176s 

INFO 19:30:43.276 [Fork choice] Adding new block slot=10997407 root=0xe95..672d
INFO 19:30:59.552 [Fork choice] Block processed. Recomputing head. 
INFO 19:31:00.352 [Fork choice] Added new block slot=10997407 root=0xe95..672d
INFO 19:31:00.353 [Fork choice] Recomputed head slot=10997407 root=0xe95..672d
INFO 19:31:00.353 [Fork choice] Block processing time: 16.276s | Recompute head time: 0.288s

After

INFO 18:22:35.125 [Fork choice] Adding new block slot=11011512 root=0x0b8..3c58
INFO 18:22:47.930 [Fork choice] Block processed. Recomputing head. 
INFO 18:22:48.380 [Fork choice] Added new block slot=11011512 root=0x0b8..3c58
INFO 18:22:48.380 [Fork choice] Recomputed head slot=11011512 root=0x0b8..3c58
INFO 18:22:48.380 [Fork choice] Block processing time: 12.805 s | Head recompute time: 0.451 s 

INFO 18:22:48.382 [Fork choice] Adding new block slot=11011513 root=0xfed..6abf
INFO 18:22:59.945 [Fork choice] Block processed. Recomputing head. 
INFO 18:23:00.447 [Fork choice] Added new block slot=11011513 root=0xfed..6abf
INFO 18:23:00.447 [Fork choice] Recomputed head slot=11011513 root=0xfed..6abf
INFO 18:23:00.447 [Fork choice] Block processing time: 11.563 s | Head recompute time: 0.502 s 

@ElFantasma
Copy link
Contributor

Added telemetry instrumentation for process_slot function to improve Grafana precision in fork choice handler times chart:
Now we can measure this PR impact on charts:
Before:
image

After:
image

@ElFantasma ElFantasma marked this pull request as ready for review February 11, 2025 15:36
@ElFantasma ElFantasma requested a review from a team as a code owner February 11, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants