Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/lean_spec/node/sync/head_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,12 @@ class HeadSyncResult:
"""
Result of processing a gossip block.

The SyncService only branches on the processed flag; the error string is
retained for incident-response logs and post-mortem inspection.
The SyncService only branches on the processed flag.
"""

processed: bool
"""True if the block was immediately integrated into the Store."""

error: str | None = None
"""Error message if processing failed."""


@dataclass(slots=True)
class HeadSync:
Expand Down Expand Up @@ -236,7 +232,6 @@ async def _process_block_with_descendants(
)
return HeadSyncResult(
processed=False,
error=str(exception),
), store

# Process cached descendants.
Expand Down
5 changes: 2 additions & 3 deletions tests/node/sync/test_head_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ def track_processing(s: Any, block: SignedBlock) -> Any:
class TestErrorHandling:
"""Tests for error handling during block processing."""

async def test_processing_error_captured_in_result(
async def test_processing_error_reported_as_not_processed(
self,
genesis_block,
peer_id: PeerId,
) -> None:
"""Processing errors are captured in the result, not raised."""
"""Processing errors are swallowed, reported as not processed, never raised."""
genesis_root = hash_tree_root(genesis_block)
store = cast(Store, MockForkchoiceStore())
store.blocks[genesis_root] = genesis_block
Expand All @@ -300,7 +300,6 @@ def fail_processing(s: Any, b: SignedBlock) -> Any:

assert head_sync_result == HeadSyncResult(
processed=False,
error="State transition failed",
)
assert returned_store is store # Original store returned on error

Expand Down
Loading