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

chore: add metrics on redundant proof nodes #14969

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Mar 11, 2025

This adds some metrics for checking how many proof nodes were already revealed over the life of a sparse state trie. These are some counters and some histograms, that get recorded when we calculate the root.

@Rjected Rjected added C-perf A change motivated by improving speed, memory usage or disk footprint A-trie Related to Merkle Patricia Trie implementation labels Mar 11, 2025
@Rjected Rjected force-pushed the dan/add-redundant-proof-nodes-metrics branch 5 times, most recently from f4282b7 to 53725df Compare March 11, 2025 22:47
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this seems fine,

pending @shekhirin

@@ -260,8 +265,10 @@ impl<F: BlindedProviderFactory> SparseStateTrie<F> {

// Reveal the remaining proof nodes.
for (path, bytes) in account_nodes {
self.metrics.increment_total_account_nodes();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see we can't incr with the len here because this is already an iter

@mattsse mattsse added the A-observability Related to tracing, metrics, logs and other observability tools label Mar 11, 2025
@@ -521,11 +530,17 @@ impl<F: BlindedProviderFactory> SparseStateTrie<F> {
///
/// If the trie has not been revealed, this function reveals the root node and returns its hash.
pub fn root(&mut self) -> SparseStateTrieResult<B256> {
// record revealed node metrics
self.metrics.record();
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be fine to run only at the end of computation, and not on every update_rlp_node_level

@Rjected Rjected added this pull request to the merge queue Mar 12, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 12, 2025
@Rjected Rjected force-pushed the dan/add-redundant-proof-nodes-metrics branch from 53725df to 67b8183 Compare March 12, 2025 22:55
@Rjected Rjected enabled auto-merge March 12, 2025 22:55
@Rjected Rjected added this pull request to the merge queue Mar 12, 2025
Merged via the queue into main with commit 3bebb0a Mar 12, 2025
43 checks passed
@Rjected Rjected deleted the dan/add-redundant-proof-nodes-metrics branch March 12, 2025 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-observability Related to tracing, metrics, logs and other observability tools 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.

3 participants