Commit 65949e0
authored
feat: aggregate in the same slot (#394)
* update aggregation logic to aggregate in the same slot
* Add features.h to .gitignore
* Refactor test_upd_aggregate.rs: Clean up imports and formatting, update test cases
* add prev_twap_, prev_twac_ and prev_price_cumulative
* remove twap and twac from test_up_aggregate
* fix test_sizes
* fix borrow reference bug
* fix build
* fix logic
* fix test_publish
* format
* fix test_publish_batch
* fix test_upd_price_no_fail_on_error
* fix test_upd_price_v2
* fix logic
* refactor
* update function desc
* fix logic
* add comments
* fix tests
* add ema test
* reduce PC_NUM_COMP_PYTHNET to 64
* fix tests
* add comments
* revert to use PriceComponentArrayWrapper
* refactor
* update c format
* revert format
* revert format
* gitignore .clang-format
* remove clang-format
* revert format
* revert format
* format
* revert format
* revert format
* fix comment
* remove comment
* add comment
* refactor
* add guard for first price update after deployment
* add back deleted test in test_publish
* add tests for prev values to test_upd_price
* update comment
* add test
* use last_slot_ instead of agg_.pub_slot_
* add more asserts
* remove crank again asserts
* fix
* address comments
* address comments
* remove print statement
* add test to simulate program upgrade
* refactor
* address comments
* address comments
* address comments
* address comments
* merge test_upd_price with test_upd_price_v2
* add asserts1 parent 14fbdef commit 65949e0
File tree
16 files changed
+701
-667
lines changed- program
- c/src/oracle
- rust/src
- accounts
- processor
- tests
16 files changed
+701
-667
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | | - | |
13 | | - | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | 137 | | |
146 | 138 | | |
147 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
36 | 82 | | |
37 | 83 | | |
38 | 84 | | |
39 | 85 | | |
40 | 86 | | |
41 | 87 | | |
42 | | - | |
| 88 | + | |
43 | 89 | | |
44 | | - | |
| 90 | + | |
45 | 91 | | |
46 | | - | |
| 92 | + | |
47 | 93 | | |
48 | | - | |
| 94 | + | |
49 | 95 | | |
50 | | - | |
| 96 | + | |
51 | 97 | | |
52 | | - | |
| 98 | + | |
53 | 99 | | |
54 | | - | |
| 100 | + | |
55 | 101 | | |
56 | | - | |
| 102 | + | |
57 | 103 | | |
58 | | - | |
| 104 | + | |
59 | 105 | | |
60 | | - | |
| 106 | + | |
61 | 107 | | |
62 | | - | |
63 | | - | |
| 108 | + | |
| 109 | + | |
64 | 110 | | |
65 | | - | |
| 111 | + | |
66 | 112 | | |
67 | | - | |
68 | | - | |
| 113 | + | |
| 114 | + | |
69 | 115 | | |
70 | | - | |
| 116 | + | |
71 | 117 | | |
72 | | - | |
| 118 | + | |
73 | 119 | | |
74 | | - | |
| 120 | + | |
75 | 121 | | |
76 | | - | |
| 122 | + | |
77 | 123 | | |
78 | | - | |
| 124 | + | |
79 | 125 | | |
80 | | - | |
| 126 | + | |
81 | 127 | | |
82 | | - | |
| 128 | + | |
83 | 129 | | |
84 | 130 | | |
85 | 131 | | |
86 | 132 | | |
87 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
88 | 139 | | |
89 | | - | |
| 140 | + | |
90 | 141 | | |
91 | 142 | | |
92 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
153 | 163 | | |
154 | 164 | | |
155 | 165 | | |
| |||
161 | 171 | | |
162 | 172 | | |
163 | 173 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
168 | 206 | | |
169 | 207 | | |
170 | 208 | | |
| |||
173 | 211 | | |
174 | 212 | | |
175 | 213 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
187 | 220 | | |
188 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
189 | 238 | | |
190 | 239 | | |
191 | 240 | | |
192 | 241 | | |
193 | 242 | | |
194 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
195 | 249 | | |
196 | 250 | | |
197 | 251 | | |
| |||
261 | 315 | | |
262 | 316 | | |
263 | 317 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | 318 | | |
282 | 319 | | |
283 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
0 commit comments