Skip to content

Commit 2b00ef1

Browse files
authored
Merge branch 'main' into feat-fxhasher
2 parents bbcb365 + 7005337 commit 2b00ef1

File tree

18 files changed

+150
-36
lines changed

18 files changed

+150
-36
lines changed

.github/actions/nss/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ runs:
113113
- name: Cache NSS
114114
id: cache
115115
if: ${{ !steps.nss.outputs.use_system_nss && runner.environment == 'github-hosted' }}
116-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
116+
uses: actions/cache/restore@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
117117
with:
118118
path: dist
119119
key: nss-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-${{ steps.heads.outputs.nss_head }}-${{ steps.heads.outputs.NSPR_HEAD }}

.github/actions/pr-comment-data-export/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runs:
3535
echo "$LOG_URL" > comment-data/log-url
3636
fi
3737
- if: ${{ github.event_name == 'pull_request' }}
38-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
38+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
3939
with:
4040
name: ${{ inputs.name }}
4141
path: comment-data

.github/actions/quic-interop-runner/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ runs:
9999
exit $FAILED
100100
shell: bash
101101

102-
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
102+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
103103
if: ${{ always() }}
104104
id: upload-logs
105105
with:
@@ -116,7 +116,7 @@ runs:
116116
mv result.json.tmp result.json
117117
shell: bash
118118

119-
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
119+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
120120
if: ${{ always() }}
121121
with:
122122
name: '${{ inputs.client }} vs. ${{ inputs.server }} results'

.github/workflows/actionlint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
env:
5454
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5555

56-
- uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
56+
- uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
5757
with:
5858
sarif_file: results.sarif
5959
category: zizmor

.github/workflows/bench.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
bazel build -c opt --sandbox_writable_path=/home/bench/.cache/sccache quiche:quic_server quiche:quic_client
9191
9292
- name: Download cached main-branch results
93-
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
93+
uses: actions/cache/restore@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
9494
with:
9595
path: |
9696
target/criterion
@@ -357,7 +357,7 @@ jobs:
357357

358358
- name: Cache main-branch results
359359
if: ${{ github.ref == 'refs/heads/main' }}
360-
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
360+
uses: actions/cache/save@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
361361
with:
362362
path: |
363363
target/criterion
@@ -366,7 +366,7 @@ jobs:
366366

367367
- name: Export perf data
368368
id: export
369-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
369+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
370370
with:
371371
name: ${{ github.event.repository.name }}-${{ github.sha }}
372372
path: |

.github/workflows/check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135

136136
- name: Save simulation seeds artifact
137137
if: ${{ always() }}
138-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
138+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
139139
with:
140140
name: simulation-seeds-${{ matrix.os }}-${{ matrix.rust-toolchain }}-${{ matrix.type }}
141141
path: simulation-seeds

.github/workflows/deny.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ jobs:
3030
with:
3131
persist-credentials: false
3232

33-
- uses: EmbarkStudios/cargo-deny-action@e2f4ede4a4e60ea15ff31bc0647485d80c66cfba # v2.0.4
33+
- uses: EmbarkStudios/cargo-deny-action@0484eedcba649433ebd03d9b7c9c002746bbc4b9 # v2.0.6
3434
with:
3535
command: check ${{ matrix.checks }}

.github/workflows/firefox.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
145145
- name: Export binary
146146
id: upload
147-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
147+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
148148
with:
149149
name: ${{ runner.os }}-${{ env.FIREFOX }}-${{ matrix.type }}.tgz
150150
path: ${{ env.FIREFOX }}.tar
@@ -155,7 +155,7 @@ jobs:
155155
run: echo "$ARTIFACT_URL" >> artifact
156156

157157
- name: Export artifact URL
158-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
158+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
159159
with:
160160
name: artifact-${{ runner.os }}-${{ env.FIREFOX }}-${{ matrix.type }}
161161
path: artifact

.github/workflows/mutants.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
echo '```'
6868
} > "$GITHUB_STEP_SUMMARY"
6969
70-
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
70+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
7171
with:
7272
name: mutants.out
7373
path: mutants.out

.github/workflows/qns.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
# set latest tag for default branch
6060
type=raw,value=latest,enable={{is_default_branch}}
6161
62-
- uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
62+
- uses: docker/build-push-action@0adf9959216b96bec444f325f1e493d4aa344497 # v6.14.0
6363
if: ${{ github.event_name != 'pull_request' }}
6464
with:
6565
push: true
@@ -72,7 +72,7 @@ jobs:
7272
# platforms: 'linux/amd64, linux/arm64'
7373
platforms: 'linux/amd64'
7474

75-
- uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
75+
- uses: docker/build-push-action@0adf9959216b96bec444f325f1e493d4aa344497 # v6.14.0
7676
id: docker_build_and_push
7777
with:
7878
tags: ${{ steps.meta.outputs.tags }}
@@ -83,7 +83,7 @@ jobs:
8383
platforms: 'linux/amd64'
8484
outputs: type=docker,dest=/tmp/${{ env.LATEST }}.tar
8585

86-
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
86+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
8787
with:
8888
name: '${{ env.LATEST }} Docker image'
8989
path: /tmp/${{ env.LATEST }}.tar
@@ -198,7 +198,7 @@ jobs:
198198
pattern: '*results'
199199
path: results
200200

201-
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
201+
- uses: actions/cache/restore@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
202202
with:
203203
path: results-main
204204
key: qns-${{ github.sha }}
@@ -314,7 +314,7 @@ jobs:
314314
echo "${{ github.sha }}" > results-main/baseline-sha.txt
315315
316316
- if: ${{ github.ref == 'refs/heads/main' }}
317-
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
317+
uses: actions/cache/save@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
318318
with:
319319
path: results-main
320320
key: qns-${{ github.sha }}

.github/workflows/sanitize.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
8686
- name: Save simulation seeds artifact
8787
if: ${{ env.DUMP_SIMULATION_SEEDS }}
88-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
88+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
8989
with:
9090
name: simulation-seeds-${{ matrix.os }}-sanitizer-${{ matrix.sanitizer }}
9191
path: ${{ env.DUMP_SIMULATION_SEEDS }}

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ url = { version = "2.5.3", default-features = false, features = ["std"] }
4545
[workspace.lints.rust]
4646
absolute_paths_not_starting_with_crate = "warn"
4747
ambiguous_negative_literals = "warn"
48-
closure_returning_async_block = "warn"
4948
explicit_outlives_requirements = "warn"
5049
macro_use_extern_crate = "warn"
5150
missing_abi = "warn"
@@ -64,6 +63,7 @@ cargo = { level = "warn", priority = -1 }
6463
nursery = { level = "warn", priority = -1 }
6564
pedantic = { level = "warn", priority = -1 }
6665
multiple_crate_versions = "allow"
66+
literal_string_with_formatting_args = "allow" # FIXME: Re-enable "warn" when MRSV is > 1.87. See https://github.com/rust-lang/rust-clippy/pull/13953#issuecomment-2676336899
6767
cfg_not_test = "warn"
6868
clone_on_ref_ptr = "warn"
6969
create_dir = "warn"

neqo-http3/Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ sfv = { version = "0.9", default-features = false }
3030
url = { workspace = true }
3131

3232
[dev-dependencies]
33+
criterion = { version = "0.5", default-features = false }
3334
neqo-http3 = { path = ".", features = ["draft-29"] }
3435
neqo-transport = { path = "./../neqo-transport", features = ["draft-29"] }
3536
test-fixture = { path = "../test-fixture" }
@@ -45,3 +46,8 @@ ignored = ["log"]
4546
[lib]
4647
# See https://github.com/bheisler/criterion.rs/blob/master/book/src/faq.md#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
4748
bench = false
49+
50+
[[bench]]
51+
name = "streams"
52+
harness = false
53+
required-features = ["bench"]

neqo-http3/benches/streams.rs

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
2+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
4+
// option. This file may not be copied, modified, or distributed
5+
// except according to those terms.
6+
7+
#![allow(clippy::unwrap_used)] // OK in a bench.
8+
9+
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
10+
use neqo_crypto::AuthenticationStatus;
11+
use neqo_http3::{Http3Client, Http3Parameters, Http3Server, Priority};
12+
use neqo_transport::{ConnectionParameters, StreamType};
13+
use test_fixture::{
14+
fixture_init, http3_client_with_params, http3_server_with_params, now, DEFAULT_SERVER_NAME,
15+
};
16+
17+
const STREAM_TYPE: StreamType = StreamType::BiDi;
18+
const STREAMS_MAX: u64 = 1 << 60;
19+
20+
fn exchange_packets(client: &mut Http3Client, server: &mut Http3Server, is_handshake: bool) {
21+
let mut out = None;
22+
let mut auth_needed = is_handshake;
23+
loop {
24+
out = client.process(out, now()).dgram();
25+
let client_out_is_none = out.is_none();
26+
if auth_needed && client.peer_certificate().is_some() {
27+
client.authenticated(AuthenticationStatus::Ok, now());
28+
auth_needed = false;
29+
}
30+
out = server.process(out, now()).dgram();
31+
if client_out_is_none && out.is_none() {
32+
break;
33+
}
34+
}
35+
}
36+
37+
fn use_streams(client: &mut Http3Client, server: &mut Http3Server, streams: usize, data: &[u8]) {
38+
let stream_ids = (0..streams)
39+
.map(|_| {
40+
client
41+
.fetch(
42+
now(),
43+
"GET",
44+
&("https", DEFAULT_SERVER_NAME, "/"),
45+
&[],
46+
Priority::default(),
47+
)
48+
.unwrap()
49+
})
50+
.collect::<Vec<_>>();
51+
exchange_packets(client, server, false);
52+
for stream_id in &stream_ids {
53+
client.send_data(*stream_id, data).unwrap();
54+
}
55+
exchange_packets(client, server, false);
56+
for stream_id in &stream_ids {
57+
client.stream_close_send(*stream_id).unwrap();
58+
}
59+
exchange_packets(client, server, false);
60+
}
61+
62+
fn connect() -> (Http3Client, Http3Server) {
63+
let cp = ConnectionParameters::default()
64+
.max_streams(STREAM_TYPE, STREAMS_MAX)
65+
.pmtud(false)
66+
.pacing(false)
67+
.mlkem(false)
68+
.sni_slicing(false);
69+
let h3p = Http3Parameters::default().connection_parameters(cp);
70+
let mut client = http3_client_with_params(h3p.clone());
71+
let mut server = http3_server_with_params(h3p);
72+
exchange_packets(&mut client, &mut server, true);
73+
(client, server)
74+
}
75+
76+
fn criterion_benchmark(c: &mut Criterion) {
77+
fixture_init();
78+
79+
for (streams, data_size) in [
80+
(1, 1),
81+
(1000, 1),
82+
(10000, 1),
83+
(1, 1000),
84+
(100, 1000),
85+
(1000, 1000),
86+
] {
87+
let mut group = c.benchmark_group(format!("{streams} streams of {data_size} bytes"));
88+
group.bench_function("multistream", |b| {
89+
let data = vec![0; data_size];
90+
b.iter_batched_ref(
91+
connect,
92+
|(client, server)| use_streams(client, server, streams, &data),
93+
BatchSize::PerIteration,
94+
);
95+
});
96+
group.finish();
97+
}
98+
}
99+
100+
criterion_group!(benches, criterion_benchmark);
101+
criterion_main!(benches);

neqo-http3/tests/httpconn.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ fn connect_peers_with_network_propagation_delay(
155155
(out.dgram(), now)
156156
}
157157

158-
fn connect() -> (Http3Client, Http3Server, Option<Datagram>) {
158+
#[must_use]
159+
pub fn connect() -> (Http3Client, Http3Server, Option<Datagram>) {
159160
let mut hconn_c = default_http3_client();
160161
let mut hconn_s = default_http3_server();
161162

qns/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM lukemathwalker/cargo-chef@sha256:2c9b2693a474b223a20f1e2bf850816d51848920bd34794fdf7c09afcaaa0fa6 AS chef
1+
FROM lukemathwalker/cargo-chef@sha256:cfa0ec6aa6e83bb5be09c6b6bb6588bf5fc0dfdd3959f6bcb1aac06fb8b96fef AS chef
22

33
WORKDIR /app
44

test-fixture/src/lib.rs

+19-14
Original file line numberDiff line numberDiff line change
@@ -262,20 +262,13 @@ pub fn connect() -> (Connection, Connection) {
262262
/// When the client can't be created.
263263
#[must_use]
264264
pub fn default_http3_client() -> Http3Client {
265-
fixture_init();
266-
Http3Client::new(
267-
DEFAULT_SERVER_NAME,
268-
Rc::new(RefCell::new(CountingConnectionIdGenerator::default())),
269-
DEFAULT_ADDR,
270-
DEFAULT_ADDR,
265+
http3_client_with_params(
271266
Http3Parameters::default()
272267
.max_table_size_encoder(100)
273268
.max_table_size_decoder(100)
274269
.max_blocked_streams(100)
275270
.max_concurrent_push_streams(10),
276-
now(),
277271
)
278-
.expect("create a default client")
279272
}
280273

281274
/// Create a http3 client.
@@ -304,21 +297,33 @@ pub fn http3_client_with_params(params: Http3Parameters) -> Http3Client {
304297
/// When the server can't be created.
305298
#[must_use]
306299
pub fn default_http3_server() -> Http3Server {
300+
http3_server_with_params(
301+
Http3Parameters::default()
302+
.max_table_size_encoder(100)
303+
.max_table_size_decoder(100)
304+
.max_blocked_streams(100)
305+
.max_concurrent_push_streams(10),
306+
)
307+
}
308+
309+
/// Create a http3 server.
310+
///
311+
/// # Panics
312+
///
313+
/// When the server can't be created.
314+
#[must_use]
315+
pub fn http3_server_with_params(params: Http3Parameters) -> Http3Server {
307316
fixture_init();
308317
Http3Server::new(
309318
now(),
310319
DEFAULT_KEYS,
311320
DEFAULT_ALPN_H3,
312321
anti_replay(),
313322
Rc::new(RefCell::new(CountingConnectionIdGenerator::default())),
314-
Http3Parameters::default()
315-
.max_table_size_encoder(100)
316-
.max_table_size_decoder(100)
317-
.max_blocked_streams(100)
318-
.max_concurrent_push_streams(10),
323+
params,
319324
None,
320325
)
321-
.expect("create a default server")
326+
.expect("create a server")
322327
}
323328

324329
/// Split the first packet off a coalesced packet.

0 commit comments

Comments
 (0)