Skip to content

refactor(sync): drop write-only HeadSyncResult.error field#978

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-14-drop-headsyncresult-error
Jun 12, 2026
Merged

refactor(sync): drop write-only HeadSyncResult.error field#978
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-14-drop-headsyncresult-error

Conversation

@tcoratger

Copy link
Copy Markdown
Collaborator

Summary

HeadSyncResult.error was a write-only field: it was assigned on the block-processing failure path but never read anywhere in src/, packages/, or tests/. The SyncService only branches on the processed flag.

This drops the dead field and its single assignment site, keeping HeadSyncResult minimal and the spec readable.

Changes

  • Remove the error field and its docstring from HeadSyncResult.
  • Remove its sole assignment on the processing-failure path.
  • Update the head-sync test: drop the error= assertion and rename the test to describe the now-accurate behavior — a processing failure is swallowed, reported as not processed, and never raised.

Verification

  • grep confirms .error is never read on a HeadSyncResult (only unrelated logger.error calls match).
  • uv run pytest tests/node/sync/test_head_sync.py — 13 passed.
  • just check — clean (ruff, format, ty, codespell, mdformat).

🤖 Generated with Claude Code

The error field was assigned on the processing-failure path but never
read anywhere. The SyncService only branches on the processed flag.
Remove the field, its sole assignment, and the test assertion that set
it; rename the test to describe the now-accurate behavior (errors are
swallowed and reported as not processed, never raised).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit db91e17 into leanEthereum:main Jun 12, 2026
14 checks passed
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