Summary
Phase 10 of the development plan: implement async/await support for leanSpec's networking and node code. Currently, chain/clock.py imports asyncio at module level, blocking its import.
Current behavior
import asyncio raises ModuleNotFoundError
chain/clock.py cannot be imported (defines SlotClock with async methods)
- All networking, sync, validator service, and API modules use async/await
Scope
Minimal async subset needed:
async def, await, async for, async with
asyncio.create_task, asyncio.gather, asyncio.sleep
asyncio.Queue, asyncio.Event
- Basic event loop
- Task cancellation
Impact
Blocks ~23 leanSpec files (~9,100 lines):
chain/clock.py, chain/service.py
subspecs/networking/ (discovery, gossipsub, reqresp)
subspecs/sync/ (checkpoint, head, backfill sync)
subspecs/validator/ (validator service)
subspecs/api/ (REST endpoints)
subspecs/node/ (full node orchestration)
Reference
- PLAN.md Phase 10
references/leanSpec/src/lean_spec/subspecs/chain/clock.py
Summary
Phase 10 of the development plan: implement
async/awaitsupport for leanSpec's networking and node code. Currently,chain/clock.pyimportsasyncioat module level, blocking its import.Current behavior
import asyncioraisesModuleNotFoundErrorchain/clock.pycannot be imported (definesSlotClockwith async methods)Scope
Minimal async subset needed:
async def,await,async for,async withasyncio.create_task,asyncio.gather,asyncio.sleepasyncio.Queue,asyncio.EventImpact
Blocks ~23 leanSpec files (~9,100 lines):
chain/clock.py,chain/service.pysubspecs/networking/(discovery, gossipsub, reqresp)subspecs/sync/(checkpoint, head, backfill sync)subspecs/validator/(validator service)subspecs/api/(REST endpoints)subspecs/node/(full node orchestration)Reference
references/leanSpec/src/lean_spec/subspecs/chain/clock.py