Commit a1d32aa
committed
perf(wotoken-yield,es-address-yield): prefetch day rates in one parallel batch
The per-day pass awaited getR (previewRedeem / accRewardPerShare) sequentially — one RPC
round-trip per transfer block and per day-end, the cold-run bottleneck. Now every block
that needs a rate (transfers + each day-end, via the new dayEndBlocks helper) is fetched
up front with a single Promise.all, which the RPC client coalesces into batched eth_calls.
Rates are stored in the existing in-memory rCache Map and read back from it, so this holds
one RPC per block per batch with or without the server RPC cache — it does not rely on
RPC caching to avoid duplicate calls. Output-preserving: the ES launch window reproduces
the exact same checksum (f3e9b04d…) as the pre-prefetch runs, zero errors.1 parent 640f022 commit a1d32aa
3 files changed
Lines changed: 49 additions & 5 deletions
File tree
- src
- templates
- exponential-staking
- wotoken-yield
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
149 | 162 | | |
150 | 163 | | |
151 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
177 | 189 | | |
178 | 190 | | |
179 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
23 | 40 | | |
24 | 41 | | |
25 | 42 | | |
| |||
28 | 45 | | |
29 | 46 | | |
30 | 47 | | |
| 48 | + | |
| 49 | + | |
31 | 50 | | |
32 | 51 | | |
33 | 52 | | |
34 | 53 | | |
35 | 54 | | |
36 | | - | |
| 55 | + | |
37 | 56 | | |
38 | 57 | | |
39 | 58 | | |
40 | 59 | | |
41 | 60 | | |
42 | 61 | | |
| 62 | + | |
| 63 | + | |
43 | 64 | | |
44 | | - | |
45 | | - | |
46 | 65 | | |
47 | 66 | | |
0 commit comments