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(root): reveal proofs separately from state updates #14077

Closed
wants to merge 19 commits into from

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Jan 29, 2025

Unbundle sparse trie proof revealing from state updates, so that we can reveal proofs out-of-order and make the last reveal of the slowest proof as fast as possible. State updates for the sparse trie should still be applied in the order of sequence numbers, because updates can depend on each other.

This PR changes the ProofSequencer structure into the StateUpdateSequencer, and reveals proofs as soon as they come, only sequencing the state updates that should be applied in order.

I don't have a particularly good block on mainnet that will show the improvement, so here's just last 10 mainnet blocks. There's basically no difference, but in theory it should improve on situations when a slow proof is delaying not just all state updates, but also revealing other proofs.

Mainnet Block newPayload latency @ main newPayload latency @ this branch
21744021 826.29157ms 813.968945ms
21744022 89.802651ms 72.406547ms
21744023 100.292771ms 89.415594ms
21744024 59.863341ms 45.230231ms
21744025 148.03544ms 151.032709ms
21744026 30.603106ms 33.761105ms
21744027 308.403489ms 320.999399ms
21744028 117.503467ms 128.529333ms
21744029 72.660279ms 66.99271ms
21744030 54.977164ms 51.821672ms

@shekhirin shekhirin added C-perf A change motivated by improving speed, memory usage or disk footprint A-trie Related to Merkle Patricia Trie implementation labels Jan 29, 2025
Copy link

codspeed-hq bot commented Jan 29, 2025

CodSpeed Performance Report

Merging #14077 will not alter performance

Comparing alexey/state-root-task-proof-reveal-separate (1e5ff35) with main (bd5dde5)

Summary

✅ 77 untouched benchmarks

@shekhirin shekhirin marked this pull request as ready for review January 31, 2025 10:49
@shekhirin
Copy link
Collaborator Author

This does not significantly improve the latency, because revealing proofs is already very fast. We can try applying both proofs and state updates out-of-order in another PR.

@shekhirin shekhirin closed this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trie Related to Merkle Patricia Trie implementation C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants