Commit dbe74e4
authored
va: log experiment results without base64 encoding (#8707)
Go's JSON marshaling encodes `[]byte` in base64. Previously, experiment
results were logging `*vapb.ValidationResult`, which contained `repeated
corepb.ValidationRecord`. In turn, `corepb.ValidationRecord` contains
three `[]byte` fields:
```proto
repeated bytes addressesResolved = 3; // netip.Addr.MarshalText()
bytes addressUsed = 4; // netip.Addr.MarshalText()
repeated bytes addressesTried = 7; // netip.Addr.MarshalText()
```
By contrast, `core.ValidationRecord` (a non-protobuf struct), has fields
of type `netip.Addr`:
```go
AddressesResolved []netip.Addr `json:"addressesResolved,omitempty"`
AddressUsed netip.Addr `json:"addressUsed"`
AddressesTried []netip.Addr `json:"addressesTried,omitempty"`
```
Those get serialized like `127.0.01`, which is what we want.
This PR reworks the `runExperiment` function so that instead of
receiving `remoteResult` (which could contain `*vapb.IsCAAValidResponse`
or `*vapb.ValidationResult`), it receives a problem and an (optional)
`core.ValidationRecord`. This allows us to more straightforwardly log
things without running into base64-encoding problems.
To test this I modified `TestExperimentalVAConcurrence` to use HTTP-01
validation, since the affected log fields don't show up under DNS-01
validation. I also tweaked `ipFakeDNS` to allow customizing the IP
address it returns.
Fixes #87011 parent 289c88b commit dbe74e4
4 files changed
+96
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | 109 | | |
116 | 110 | | |
117 | 111 | | |
118 | 112 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | | - | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
56 | | - | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| |||
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
68 | 81 | | |
69 | 82 | | |
70 | | - | |
| 83 | + | |
71 | 84 | | |
72 | 85 | | |
73 | | - | |
| 86 | + | |
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
310 | 319 | | |
311 | 320 | | |
312 | 321 | | |
313 | | - | |
| 322 | + | |
314 | 323 | | |
315 | | - | |
316 | | - | |
| 324 | + | |
| 325 | + | |
317 | 326 | | |
318 | 327 | | |
319 | 328 | | |
| |||
322 | 331 | | |
323 | 332 | | |
324 | 333 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
330 | 339 | | |
331 | 340 | | |
332 | 341 | | |
| |||
835 | 844 | | |
836 | 845 | | |
837 | 846 | | |
838 | | - | |
839 | | - | |
840 | | - | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
841 | 863 | | |
842 | 864 | | |
843 | 865 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | 397 | | |
407 | | - | |
| 398 | + | |
| 399 | + | |
408 | 400 | | |
409 | 401 | | |
410 | 402 | | |
| 403 | + | |
411 | 404 | | |
412 | | - | |
413 | 405 | | |
414 | 406 | | |
415 | 407 | | |
416 | 408 | | |
417 | 409 | | |
418 | 410 | | |
419 | 411 | | |
420 | | - | |
421 | | - | |
| 412 | + | |
| 413 | + | |
422 | 414 | | |
423 | 415 | | |
424 | 416 | | |
425 | 417 | | |
426 | 418 | | |
427 | | - | |
428 | | - | |
| 419 | + | |
| 420 | + | |
429 | 421 | | |
430 | 422 | | |
431 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
432 | 427 | | |
433 | 428 | | |
434 | 429 | | |
435 | | - | |
436 | | - | |
| 430 | + | |
| 431 | + | |
437 | 432 | | |
438 | 433 | | |
439 | 434 | | |
| |||
442 | 437 | | |
443 | 438 | | |
444 | 439 | | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
449 | 453 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
454 | 458 | | |
455 | 459 | | |
456 | 460 | | |
| |||
465 | 469 | | |
466 | 470 | | |
467 | 471 | | |
468 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
469 | 476 | | |
470 | 477 | | |
471 | 478 | | |
| |||
0 commit comments