mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2875] Conformance tests: reuse keys #1078
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#1078
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @divergentdave on GitHub (Mar 19, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2875
I did an off-CPU analysis of the conformance test suite, and it appears that a significant amount of time is spent generating keypairs. (24% of samples have stack traces containing
Signer::gen_key()) We could speed things up by generating a handful of keys up front, and then re-using them in different tests as needed. We should still use different keys for different zones in the same test, to maintain test validity. Note also thatforwarder::dnssec::scenarios::bogus::wrong_keyexpects to generate two distinct KSKs for the same zone, so we will need an escape hatch.Methodology
I ran the tests with
RUSTFLAGS="-C force-frame-pointers=y" DNS_TEST_PEER=unbound DNS_TEST_SUBJECT="hickory /home/david/Code/hickory-dns dnssec-aws-lc-rs" cargo test --lib -p conformance-tests --manifest-path conformance/Cargo.tomlin one terminal. In another terminal, I ransudo offcputime-bpfcc -f -U --stack-storage-size 65536 -p `pgrep -n conformance_tes` 120 > out.stacks, using the Ubuntu package for BCC (bpfcc-tools). I then used https://github.com/brendangregg/FlameGraph to render the output, with~/Source/FlameGraph/flamegraph.pl --color=io --title="Off-CPU Time Flame Graph" --countname=us --reverse < out.stacks > out.svg.Note that BPF does not support stack walking with DWARF, so
force-frame-pointers=yhelps us get more complete stack traces. The-Uflag foroffcputime-bpfcclimits the output to only user-mode stack frames, and-fchooses the folded output format, whichflamegraph.plexpects. It's important thatoffcputime-bpfccexits before the workload it is tracing, since it only symbolizes at exit, and it needs the process to still be running in order to load the executable. Running for 120 seconds is good enough on my system.@djc commented on GitHub (Mar 19, 2025):
(Consider using the flamegraph Rust binary instead of the Perl tooling -- full disclosure, I'm the current maintainer.)
Curious why we need to generate so many keys at all? Do we a separate set of keys for each test?
@divergentdave commented on GitHub (Mar 19, 2025):
Yes, whenever we sign a zone file, we do so with a freshly-generated ZSK and KSK. A DNSSEC test may do so on multiple zone files.
@djc commented on GitHub (Mar 19, 2025):
Can we sign with ECDSA? That would probably be the easiest win?
@divergentdave commented on GitHub (Mar 19, 2025):
In most cases yes. That looks like it's 10x faster to generate.