Skip to content

refactor(sync): align __all__ with the package public surface#986

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-24-align-sync-all-exports
Jun 12, 2026
Merged

refactor(sync): align __all__ with the package public surface#986
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-24-align-sync-all-exports

Conversation

@tcoratger

Copy link
Copy Markdown
Collaborator

What

Reconcile the __all__ export block in the sync package init so it follows the same policy as every sibling node package.

The inconsistency

Every sibling package init (chain, storage, validator, genesis, metrics) follows one convention:

  • imports first, then __all__
  • entries sorted alphabetically

The sync init diverged on both points:

  • __all__ sat before the imports
  • entries were listed in import order (SyncService, BlockCache, NetworkRequester, PeerManager), not alphabetically

It also carried a from __future__ import annotations that no sibling init uses and that this module does not need — there are no annotations in the file.

The fix

  • Move __all__ below the imports.
  • Sort entries alphabetically: BlockCache, NetworkRequester, PeerManager, SyncService.
  • Drop the unused future-annotations import.

The public surface is unchanged — all four names are imported by real external callers (node.py, validator/service.py, networking/service/service.py, chain/service.py, api/aggregator_controller.py), so this is purely a policy alignment with no behavioral change. No backward-compat shims added.

Verification

  • uv run pytest tests/node/sync/ — 142 passed
  • just check — all checks pass

🤖 Generated with Claude Code

Match the export convention used by every sibling node package: place
__all__ after the imports and sort its entries alphabetically.

The list previously sat before the imports in import order, which
diverged from the chain, storage, validator, genesis, and metrics
packages. The unused future-annotations import is dropped as well,
since this module carries no annotations and no sibling uses it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit 80d2ad4 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