Commit 226b98c
authored
fix(sim): Make simulation process actually continuous (#86)
* fix(sim): Make simulation process actually continuous
Right now, the simulator stops as soon as there are no more items to simulate. This actually is not correct behavior, as we could be early in the slot, with more items coming in later in the slot which could yield a higher total payout on the block.
What we actually want, is to simply skip doing the round at all if there are no items, sleep for a certain amount of time (bounded by the deadline), and either break (if we slept until the deadline) or continue if there's still time remaining.
The resulting behavior is that the simulator always runs until the deadline, ensuring that items that come later in the slot, up until the deadline, can be simulated and included in the block.
* chore: properly break if we sleep until deadline
* chore: make amount of time in ms that the sim sleeps a constant
* chore: rm dumb comparison
* chore: rm newline
* chore: simplify logic
* chore:
comment
* chore: bias select!1 parent f22f7d0 commit 226b98c
1 file changed
+25
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
79 | 102 | | |
80 | 103 | | |
81 | 104 | | |
| 105 | + | |
82 | 106 | | |
83 | 107 | | |
84 | 108 | | |
| |||
87 | 111 | | |
88 | 112 | | |
89 | 113 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 114 | | |
95 | 115 | | |
96 | 116 | | |
| |||
0 commit comments