Commit 331b458
authored
refactor!: dropping pagination from getLogsByTags (#19161)
In this PR I drop pagination from `getLogsByTags` endpoint because
pagination here doesn't really make sense because we get more logs per
tag only if there are multiple devices sending logs from a given sender
to a recipient.
This is the final of 3 PRs in which I clean up the `getLogsByTags`
endpoint:
1. First PR - including block timestamp in return value,
2. This is the second PR - I type the tag arg of the function to be
`SiloedTag`,
3. in the last PR I will drop pagination from this endpoint.
# Potential DoS vector
Log tag is unconstrained and hence can be arbitrarily chosen by the
sender. This introduces a potential DoS vector because the node
currently loads all the logs into memory and returns them. Hence it
could be feasible to re-use the same tag thousands of time and then spam
a node by request for this tag.
I think the solution here is to simply define the maximum number of logs
a node is willing to store per tag in the db. Given that there is no
legitimate use case for log reuse I think making it even as low as 5
would be fine.
Note that this PR didn't introduce this DoS vector because even though I
dropped the pagination here it didn't seem to be enforced before (if
`limitPerTag` arg was undefined we just returned it all). For this
reason I think we can merge it and tackle the issue in a followup PR.File tree
8 files changed
+52
-130
lines changed- yarn-project
- archiver/src/archiver
- kv_archiver_store
- aztec-node/src/aztec-node
- stdlib/src/interfaces
8 files changed
+52
-130
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1415 | 1415 | | |
1416 | 1416 | | |
1417 | 1417 | | |
1418 | | - | |
1419 | | - | |
| 1418 | + | |
| 1419 | + | |
1420 | 1420 | | |
1421 | 1421 | | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
1427 | | - | |
| 1422 | + | |
| 1423 | + | |
1428 | 1424 | | |
1429 | 1425 | | |
1430 | 1426 | | |
| |||
2082 | 2078 | | |
2083 | 2079 | | |
2084 | 2080 | | |
2085 | | - | |
2086 | | - | |
| 2081 | + | |
| 2082 | + | |
2087 | 2083 | | |
2088 | | - | |
2089 | | - | |
2090 | | - | |
2091 | | - | |
2092 | | - | |
2093 | | - | |
| 2084 | + | |
| 2085 | + | |
2094 | 2086 | | |
2095 | 2087 | | |
2096 | 2088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
230 | 220 | | |
231 | 221 | | |
232 | 222 | | |
| |||
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 329 | + | |
334 | 330 | | |
335 | | - | |
| 331 | + | |
336 | 332 | | |
337 | 333 | | |
338 | 334 | | |
| |||
Lines changed: 9 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 287 | + | |
| 288 | + | |
292 | 289 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 290 | + | |
297 | 291 | | |
298 | | - | |
299 | | - | |
300 | | - | |
| 292 | + | |
| 293 | + | |
301 | 294 | | |
302 | 295 | | |
303 | 296 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| 297 | + | |
| 298 | + | |
309 | 299 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 300 | + | |
318 | 301 | | |
319 | 302 | | |
320 | 303 | | |
321 | 304 | | |
322 | 305 | | |
323 | 306 | | |
324 | | - | |
325 | | - | |
326 | | - | |
| 307 | + | |
327 | 308 | | |
328 | 309 | | |
329 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
699 | | - | |
| 698 | + | |
| 699 | + | |
700 | 700 | | |
701 | 701 | | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
| 702 | + | |
| 703 | + | |
708 | 704 | | |
709 | 705 | | |
710 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 341 | + | |
| 342 | + | |
347 | 343 | | |
348 | | - | |
| 344 | + | |
349 | 345 | | |
350 | 346 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 347 | + | |
| 348 | + | |
358 | 349 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 350 | + | |
364 | 351 | | |
365 | 352 | | |
366 | 353 | | |
| |||
496 | 483 | | |
497 | 484 | | |
498 | 485 | | |
499 | | - | |
500 | 486 | | |
501 | 487 | | |
502 | 488 | | |
| |||
618 | 604 | | |
619 | 605 | | |
620 | 606 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
| 607 | + | |
625 | 608 | | |
626 | 609 | | |
627 | 610 | | |
628 | 611 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
| 612 | + | |
634 | 613 | | |
635 | 614 | | |
636 | 615 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
| 16 | + | |
20 | 17 | | |
21 | | - | |
| 18 | + | |
22 | 19 | | |
23 | 20 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 21 | + | |
| 22 | + | |
31 | 23 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 24 | + | |
37 | 25 | | |
38 | 26 | | |
39 | 27 | | |
| |||
0 commit comments