Skip to content

Conversation

@chetanyb
Copy link
Contributor

@chetanyb chetanyb commented Dec 31, 2025

Summary

Adds comprehensive metrics instrumentation and justifications caching to identify and optimize block processing bottlenecks. Addresses #444

Metrics Added:

  • Granular block processing breakdown (header, attestations, operations)
  • State transition internal metrics (justification build, state update)
  • Block processing path counters (cached vs computed state)
  • Cache performance tracking

Caching Implementation:

  • Justifications HashMap caching between parent/child blocks
  • Configurable via cache_justifications flag
  • Integrated into state transition flow

Key Findings

Cache currently degrades performance - needs redesign before merging:

  • Current performance: 93.3 μs (with cache at 1.3k slots) vs 21 μs (without cache at 300 slots)
  • Root cause: HashMap cloning overhead exceeds build cost
  • TODO:: Add cache eviction (grows unbounded)
  • TODO: Move from cloning entire HashMap on every lookup

Testing

Tested on AWS deployment at 1.37k slots with lean-quickstart

@chetanyb chetanyb requested review from anshalshukla and removed request for anshalshukla December 31, 2025 18:32
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