refactor(sync): drop process_block indirection on SyncService#737
Merged
tcoratger merged 2 commits intoMay 21, 2026
Merged
Conversation
Merge _default_process_block and _process_block_wrapper into a single process_block method on SyncService and remove the injectable process_block field. Tests that previously injected a custom processor now configure the mock store directly via opt-in on_block hooks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_default_process_blockand_process_block_wrapperinto a singleprocess_blockmethod onSyncServiceand drop the injectableprocess_block: Callable | Nonefield.HeadSyncis now wired directly toSyncService.process_block; the spec call, telemetry, counter, deconstruction, and persistence all live in one place.MockForkchoiceStoreexposes opt-inon_block_*hooks (post-state, justified/finalized advance) and now carries the attributes the full telemetry path needs (safe_target, realCheckpoint,parent_rooton the genesis stub).Test plan
uv run pytest tests/lean_spec/subspecs/sync tests/lean_spec/helpers --no-cov— 159 passed.ruff check,ruff format --check,ty check,codespell,mdformat --check,uv lock --check— all green.🤖 Generated with Claude Code