Commit 065e281
The main bottleneck of validating blocks with many HTTPS outcalls
responses is signature verification. Therefore, in
#10345 we started using batch
verification which has better performance than validating signatures
one-by-one.
With this PR we additionally pass a rayon thread pool to the HTTPS
outcalls payload builder. This thread pool has 16 threads, and is
already used by other payload builders to reduce validation times (the
`ChainKeyPayloadBuilder` for instance). Similar to that, we use the
thread pool to split all signatures of the current block in to at most
16 batches (one for each thread), and then validate each batch in
parallel, with a single batch verification call. This reduces the
validation time of full HTTPS outcalls payloads by up to ~80%.
### Before
```sql
canister_http_payload_verification/mixed_subnet34
time: [107.00 ms 107.66 ms 108.38 ms]
canister_http_payload_verification/many_replicated_responses_subnet34
time: [149.01 ms 149.87 ms 150.85 ms]
canister_http_payload_verification/many_non_replicated_responses_subnet34
time: [8.2811 ms 8.3068 ms 8.3353 ms]
canister_http_payload_verification/many_divergence_responses_subnet34
time: [79.840 ms 80.548 ms 81.381 ms]
canister_http_payload_verification/many_flexible_responses_subnet34
time: [179.01 ms 180.38 ms 181.82 ms]
```
### After
```sql
canister_http_payload_verification/mixed_subnet34
time: [21.519 ms 21.788 ms 22.066 ms]
change: [-80.032% -79.762% -79.482%] (p = 0.00 < 0.05)
Performance has improved.
canister_http_payload_verification/many_replicated_responses_subnet34
time: [22.973 ms 23.205 ms 23.457 ms]
change: [-84.695% -84.517% -84.330%] (p = 0.00 < 0.05)
Performance has improved.
canister_http_payload_verification/many_non_replicated_responses_subnet34
time: [3.0804 ms 3.1072 ms 3.1346 ms]
change: [-62.932% -62.595% -62.245%] (p = 0.00 < 0.05)
Performance has improved.
canister_http_payload_verification/many_divergence_responses_subnet34
time: [14.198 ms 14.318 ms 14.452 ms]
change: [-82.456% -82.225% -81.996%] (p = 0.00 < 0.05)
Performance has improved.
canister_http_payload_verification/many_flexible_responses_subnet34
time: [43.591 ms 43.947 ms 44.336 ms]
change: [-75.914% -75.637% -75.337%] (p = 0.00 < 0.05)
Performance has improved.
```
---------
Co-authored-by: IDX GitHub Automation <infra+github-automation@dfinity.org>
Co-authored-by: Pierugo Pace <pierugo.pace@dfinity.org>
1 parent 5b49fd2 commit 065e281
20 files changed
Lines changed: 73 additions & 61 deletions
File tree
- rs
- consensus
- chain_key/src
- idkg/src
- src
- consensus
- tests
- framework
- utils
- src
- https_outcalls/consensus
- benches
- src
- payload_builder
- replay/src
- replica/setup_ic_network/src
- state_machine_tests/src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
661 | 662 | | |
662 | 663 | | |
663 | 664 | | |
| |||
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
679 | | - | |
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
| |||
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
| 876 | + | |
882 | 877 | | |
883 | 878 | | |
884 | 879 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
189 | 192 | | |
190 | | - | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | 551 | | |
553 | 552 | | |
| 553 | + | |
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
500 | 499 | | |
501 | 500 | | |
502 | 501 | | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | 502 | | |
514 | 503 | | |
515 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 85 | | |
89 | 86 | | |
90 | 87 | | |
| |||
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 99 | | |
113 | 100 | | |
114 | 101 | | |
| |||
622 | 609 | | |
623 | 610 | | |
624 | 611 | | |
| 612 | + | |
625 | 613 | | |
626 | 614 | | |
627 | 615 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2160 | 2160 | | |
2161 | 2161 | | |
2162 | 2162 | | |
2163 | | - | |
2164 | | - | |
| 2163 | + | |
2165 | 2164 | | |
2166 | 2165 | | |
2167 | 2166 | | |
2168 | 2167 | | |
| 2168 | + | |
2169 | 2169 | | |
2170 | 2170 | | |
2171 | 2171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
0 commit comments