-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
When a candidate block is present but no validator has a positive stake entry, the lottery pool is empty and pick_winner crashes.
Reproduction:
env PYTHONPATH=src .venv/bin/python - <<'PY'
import asyncio
from p2p import peer
async def main():
peer.validators.clear()
peer.tempblocks.clear()
peer.tempblocks.append({"Validator": "missing", "Index": 1, "BPM": 60, "Timestamp": "t", "PrevHash": "h", "Hash": "h2"})
q = asyncio.Queue()
t = asyncio.create_task(peer.pick_winner(q))
await asyncio.sleep(1.2)
print('task_done=', t.done())
print('task_exception=', repr(t.exception()))
asyncio.run(main())
PY
Observed output:
- task_done= True
- task_exception= IndexError('list index out of range')
Expected behavior:
- The round should be skipped safely when no eligible validator exists.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels