Skip to content

Instantly share code, notes, and snippets.

@adietrichs
Last active September 11, 2023 21:11
Show Gist options
  • Save adietrichs/4f41090c37d292a96b08c8cdbd076d90 to your computer and use it in GitHub Desktop.
Save adietrichs/4f41090c37d292a96b08c8cdbd076d90 to your computer and use it in GitHub Desktop.
MODULUS_OPTIONS = [98304, 93600, 8191]
def slots_hit(modulus, starting_slot, slot_time):
assert 0 <= starting_slot < modulus
slots = [starting_slot]
while True:
next_slot = (slots[-1] + slot_time) % modulus
if next_slot == slots[0]:
break
slots.append(next_slot)
return slots
for slot_time in range(1, 31):
print(f"Slot time: {slot_time}s")
for modulus in MODULUS_OPTIONS:
base_slots = slots_hit(modulus, 11, 12)
slots = slots_hit(modulus, base_slots[0], slot_time)
used = len(slots)
unused = len(set(base_slots) - set(slots))
print(f" Modulus: {modulus:5d} Active: {used:5d} ({used*100/modulus:6.2f}%) Inactive: {unused:5d} ({unused*100/modulus:6.2f}%)")
print()
Slot time: 1s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 93600 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 2s
Modulus: 98304 Active: 49152 ( 50.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 46800 ( 50.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 3s
Modulus: 98304 Active: 32768 ( 33.33%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 31200 ( 33.33%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 4s
Modulus: 98304 Active: 24576 ( 25.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 23400 ( 25.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 5s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 18720 ( 20.00%) Inactive: 6240 ( 6.67%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 6s
Modulus: 98304 Active: 16384 ( 16.67%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 15600 ( 16.67%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 7s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 93600 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 8s
Modulus: 98304 Active: 12288 ( 12.50%) Inactive: 4096 ( 4.17%)
Modulus: 93600 Active: 11700 ( 12.50%) Inactive: 3900 ( 4.17%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 9s
Modulus: 98304 Active: 32768 ( 33.33%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 10400 ( 11.11%) Inactive: 5200 ( 5.56%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 10s
Modulus: 98304 Active: 49152 ( 50.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 9360 ( 10.00%) Inactive: 6240 ( 6.67%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 11s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 93600 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 12s
Modulus: 98304 Active: 8192 ( 8.33%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 7800 ( 8.33%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 13s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 7200 ( 7.69%) Inactive: 7200 ( 7.69%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 14s
Modulus: 98304 Active: 49152 ( 50.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 46800 ( 50.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 15s
Modulus: 98304 Active: 32768 ( 33.33%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 6240 ( 6.67%) Inactive: 6240 ( 6.67%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 16s
Modulus: 98304 Active: 6144 ( 6.25%) Inactive: 6144 ( 6.25%)
Modulus: 93600 Active: 5850 ( 6.25%) Inactive: 5850 ( 6.25%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 17s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 93600 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 18s
Modulus: 98304 Active: 16384 ( 16.67%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 5200 ( 5.56%) Inactive: 5200 ( 5.56%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 19s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 93600 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 20s
Modulus: 98304 Active: 24576 ( 25.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 4680 ( 5.00%) Inactive: 6240 ( 6.67%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 21s
Modulus: 98304 Active: 32768 ( 33.33%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 31200 ( 33.33%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 22s
Modulus: 98304 Active: 49152 ( 50.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 46800 ( 50.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 23s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 93600 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 24s
Modulus: 98304 Active: 4096 ( 4.17%) Inactive: 4096 ( 4.17%)
Modulus: 93600 Active: 3900 ( 4.17%) Inactive: 3900 ( 4.17%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 25s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 3744 ( 4.00%) Inactive: 7488 ( 8.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 26s
Modulus: 98304 Active: 49152 ( 50.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 3600 ( 3.85%) Inactive: 7200 ( 7.69%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 27s
Modulus: 98304 Active: 32768 ( 33.33%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 10400 ( 11.11%) Inactive: 5200 ( 5.56%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 28s
Modulus: 98304 Active: 24576 ( 25.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 23400 ( 25.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 29s
Modulus: 98304 Active: 98304 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 93600 (100.00%) Inactive: 0 ( 0.00%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Slot time: 30s
Modulus: 98304 Active: 16384 ( 16.67%) Inactive: 0 ( 0.00%)
Modulus: 93600 Active: 3120 ( 3.33%) Inactive: 6240 ( 6.67%)
Modulus: 8191 Active: 8191 (100.00%) Inactive: 0 ( 0.00%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment