Skip to content

Add fork choice write lock tracing context#9306

Open
peter941221 wants to merge 1 commit into
sigp:unstablefrom
peter941221:issue/sigp-lighthouse-8147
Open

Add fork choice write lock tracing context#9306
peter941221 wants to merge 1 commit into
sigp:unstablefrom
peter941221:issue/sigp-lighthouse-8147

Conversation

@peter941221
Copy link
Copy Markdown

@peter941221 peter941221 commented May 15, 2026

Issue Addressed

Part of #8147.

Proposed Changes

Adds source-specific tracing spans around production fork-choice write-lock/update paths so lock wait spans have useful parent context in traces.

This is intentionally behavior-neutral:

  • does not change fork choice locking semantics
  • does not move DB writes outside the lock
  • does not introduce a custom lock wrapper
  • does not alter fork choice, payload, or block import logic

Covered paths include block import, payload envelope import, attestation/slashing application, recompute-head, finalization prune, and execution payload validity updates.

The instrumentation uses a frequency-aware span level split:

  • low-frequency or issue-critical paths use info_span! so parent/source context is visible alongside the existing default #[instrument] fork-choice write-lock span in info-level tracing configurations
  • high-volume attestation application paths use debug_span! to avoid adding info-level trace noise on gossip-heavy paths

Additional Info

This follows the instrumentation-first direction discussed in #8147.

Verifications Performed

  • cargo fmt --check
  • cargo check -p beacon_chain
  • git diff --check

@peter941221 peter941221 force-pushed the issue/sigp-lighthouse-8147 branch from 13fb58f to 5182232 Compare May 15, 2026 01:43
@peter941221 peter941221 force-pushed the issue/sigp-lighthouse-8147 branch from 5182232 to 2612423 Compare May 15, 2026 01:48
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.

1 participant