blastdns 2.0.2__tar.gz → 2.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blastdns-2.0.3/.github/dependabot.yml +53 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/.github/workflows/benchmark.yml +7 -7
- blastdns-2.0.3/.github/workflows/cla.yml +18 -0
- blastdns-2.0.3/.github/workflows/publish.yml +79 -0
- blastdns-2.0.3/.github/workflows/stable-guard.yml +12 -0
- blastdns-2.0.3/.github/workflows/tests.yml +53 -0
- blastdns-2.0.3/.gitignore +4 -0
- blastdns-2.0.3/AGENTS.md +71 -0
- blastdns-2.0.3/CLAUDE.md +1 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/Cargo.lock +7 -7
- {blastdns-2.0.2 → blastdns-2.0.3}/Cargo.toml +2 -2
- blastdns-2.0.2/README.md → blastdns-2.0.3/PKG-INFO +33 -1
- blastdns-2.0.2/PKG-INFO → blastdns-2.0.3/README.md +18 -14
- {blastdns-2.0.2 → blastdns-2.0.3}/pyproject.toml +2 -2
- blastdns-2.0.3/scripts/ci-setup.sh +7 -0
- blastdns-2.0.3/scripts/ci-teardown.sh +5 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/client.rs +18 -3
- {blastdns-2.0.2 → blastdns-2.0.3}/src/controller.rs +491 -4
- blastdns-2.0.3/src/limiter.rs +373 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/worker.rs +7 -1
- {blastdns-2.0.2 → blastdns-2.0.3}/uv.lock +35 -36
- blastdns-2.0.2/.github/dependabot.yml +0 -17
- blastdns-2.0.2/.github/workflows/cla.yml +0 -68
- blastdns-2.0.2/.github/workflows/python-tests.yml +0 -265
- blastdns-2.0.2/.github/workflows/rust-tests.yml +0 -92
- blastdns-2.0.2/src/limiter.rs +0 -182
- {blastdns-2.0.2 → blastdns-2.0.3}/LICENSE +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/__init__.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/client.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/exceptions.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/models.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/tests/test_batching.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/tests/test_client.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/tests/test_exceptions.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/tests/test_mock_client.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/tests/test_zone_transfer.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/blastdns/zone_transfer.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/examples/resolve-batch.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/examples/resolve-single-host.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/scripts/benchmark.py +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/scripts/start-test-axfr.sh +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/scripts/start-test-dns.sh +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/scripts/stop-test-axfr.sh +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/scripts/stop-test-dns.sh +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/scripts/test-zone/db.zonetransfer.test +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/scripts/test-zone/named.conf +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/cache.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/config.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/error.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/health.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/lib.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/main.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/mock.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/python.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/resolver.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/sim.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/utils.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/src/zone_transfer.rs +0 -0
- {blastdns-2.0.2 → blastdns-2.0.3}/tests/cli_tests.py +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "cargo"
|
|
4
|
+
directory: "/"
|
|
5
|
+
target-branch: "dev"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "weekly"
|
|
8
|
+
groups:
|
|
9
|
+
cargo-minor-patch:
|
|
10
|
+
patterns:
|
|
11
|
+
- "*"
|
|
12
|
+
update-types:
|
|
13
|
+
- "minor"
|
|
14
|
+
- "patch"
|
|
15
|
+
cargo-major:
|
|
16
|
+
patterns:
|
|
17
|
+
- "*"
|
|
18
|
+
update-types:
|
|
19
|
+
- "major"
|
|
20
|
+
- package-ecosystem: "uv"
|
|
21
|
+
directory: "/"
|
|
22
|
+
target-branch: "dev"
|
|
23
|
+
schedule:
|
|
24
|
+
interval: "weekly"
|
|
25
|
+
groups:
|
|
26
|
+
uv-minor-patch:
|
|
27
|
+
patterns:
|
|
28
|
+
- "*"
|
|
29
|
+
update-types:
|
|
30
|
+
- "minor"
|
|
31
|
+
- "patch"
|
|
32
|
+
uv-major:
|
|
33
|
+
patterns:
|
|
34
|
+
- "*"
|
|
35
|
+
update-types:
|
|
36
|
+
- "major"
|
|
37
|
+
- package-ecosystem: "github-actions"
|
|
38
|
+
directory: "/"
|
|
39
|
+
target-branch: "dev"
|
|
40
|
+
schedule:
|
|
41
|
+
interval: "weekly"
|
|
42
|
+
groups:
|
|
43
|
+
github-actions-minor-patch:
|
|
44
|
+
patterns:
|
|
45
|
+
- "*"
|
|
46
|
+
update-types:
|
|
47
|
+
- "minor"
|
|
48
|
+
- "patch"
|
|
49
|
+
github-actions-major:
|
|
50
|
+
patterns:
|
|
51
|
+
- "*"
|
|
52
|
+
update-types:
|
|
53
|
+
- "major"
|
|
@@ -16,16 +16,16 @@ jobs:
|
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
18
|
# The PR merged into its base, so the comparison isolates exactly this change.
|
|
19
|
-
- uses: actions/checkout@v7
|
|
19
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
20
|
|
|
21
21
|
- name: Check out base
|
|
22
|
-
uses: actions/checkout@v7
|
|
22
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
23
23
|
with:
|
|
24
24
|
ref: ${{ github.event.pull_request.base.sha }}
|
|
25
25
|
path: .bench-base
|
|
26
26
|
|
|
27
27
|
- name: Install Rust toolchain
|
|
28
|
-
uses: actions-rust-lang/setup-rust-toolchain@v2
|
|
28
|
+
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
|
|
29
29
|
with:
|
|
30
30
|
# A base built with a newer toolchain can carry warnings; that's for the
|
|
31
31
|
# test workflows to catch, not a reason to skip the comparison.
|
|
@@ -35,12 +35,12 @@ jobs:
|
|
|
35
35
|
.bench-base -> target
|
|
36
36
|
|
|
37
37
|
- name: Set up Python
|
|
38
|
-
uses: actions/setup-python@v7
|
|
38
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
39
39
|
with:
|
|
40
40
|
python-version: '3.x'
|
|
41
41
|
|
|
42
42
|
- name: Install uv
|
|
43
|
-
uses: astral-sh/setup-uv@v7
|
|
43
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
44
44
|
|
|
45
45
|
- name: Build head
|
|
46
46
|
run: uv sync && uv run maturin develop --release
|
|
@@ -76,7 +76,7 @@ jobs:
|
|
|
76
76
|
|
|
77
77
|
- name: Upload benchmark results
|
|
78
78
|
if: always()
|
|
79
|
-
uses: actions/upload-artifact@v7
|
|
79
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
80
80
|
with:
|
|
81
81
|
name: benchmark-results
|
|
82
82
|
path: benchmark_report.md
|
|
@@ -88,7 +88,7 @@ jobs:
|
|
|
88
88
|
|
|
89
89
|
- name: Comment benchmark results on PR
|
|
90
90
|
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
|
|
91
|
-
uses: actions/github-script@v9
|
|
91
|
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
92
92
|
with:
|
|
93
93
|
script: |
|
|
94
94
|
const fs = require('fs');
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: CLA
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
pull_request_target:
|
|
7
|
+
types: [opened, closed, synchronize]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
pull-requests: write
|
|
11
|
+
statuses: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
cla:
|
|
15
|
+
uses: blacklanternsecurity/release-workflows/.github/workflows/cla-reusable.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
|
|
16
|
+
secrets:
|
|
17
|
+
APP_ID: ${{ secrets.APP_ID }}
|
|
18
|
+
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [stable]
|
|
6
|
+
|
|
7
|
+
permissions: {}
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: publish-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: false
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
check:
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
actions: read
|
|
18
|
+
pull-requests: read
|
|
19
|
+
uses: blacklanternsecurity/release-workflows/.github/workflows/release-check.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
|
|
20
|
+
secrets:
|
|
21
|
+
BLS_RELEASE_PRIVATE_KEY: ${{ secrets.BLS_RELEASE_PRIVATE_KEY }}
|
|
22
|
+
|
|
23
|
+
tests:
|
|
24
|
+
needs: check
|
|
25
|
+
if: needs.check.outputs.release == 'true'
|
|
26
|
+
permissions:
|
|
27
|
+
contents: read
|
|
28
|
+
uses: ./.github/workflows/tests.yml
|
|
29
|
+
|
|
30
|
+
wheels:
|
|
31
|
+
needs: tests
|
|
32
|
+
permissions:
|
|
33
|
+
contents: read
|
|
34
|
+
uses: blacklanternsecurity/release-workflows/.github/workflows/maturin-wheels.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
|
|
35
|
+
|
|
36
|
+
crates:
|
|
37
|
+
needs: [check, pypi]
|
|
38
|
+
if: needs.check.outputs.release == 'true'
|
|
39
|
+
permissions:
|
|
40
|
+
contents: read
|
|
41
|
+
id-token: write
|
|
42
|
+
uses: blacklanternsecurity/release-workflows/.github/workflows/crates.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
|
|
43
|
+
with:
|
|
44
|
+
version: ${{ needs.check.outputs.version }}
|
|
45
|
+
|
|
46
|
+
pypi:
|
|
47
|
+
needs: wheels
|
|
48
|
+
runs-on: ubuntu-24.04
|
|
49
|
+
environment: release
|
|
50
|
+
permissions:
|
|
51
|
+
contents: read
|
|
52
|
+
id-token: write
|
|
53
|
+
attestations: write
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
56
|
+
with:
|
|
57
|
+
pattern: ${{ needs.wheels.outputs.artifacts }}
|
|
58
|
+
path: dist
|
|
59
|
+
merge-multiple: true
|
|
60
|
+
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
|
|
61
|
+
with:
|
|
62
|
+
subject-path: dist/*
|
|
63
|
+
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
64
|
+
with:
|
|
65
|
+
skip-existing: true
|
|
66
|
+
|
|
67
|
+
release:
|
|
68
|
+
needs: [check, wheels, crates, pypi]
|
|
69
|
+
if: needs.check.outputs.release == 'true'
|
|
70
|
+
permissions:
|
|
71
|
+
contents: read
|
|
72
|
+
uses: blacklanternsecurity/release-workflows/.github/workflows/publish.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
|
|
73
|
+
with:
|
|
74
|
+
tag: ${{ needs.check.outputs.tag }}
|
|
75
|
+
version: ${{ needs.check.outputs.version }}
|
|
76
|
+
artifacts: ${{ needs.wheels.outputs.artifacts }}
|
|
77
|
+
assets: dist/*
|
|
78
|
+
secrets:
|
|
79
|
+
BLS_RELEASE_PRIVATE_KEY: ${{ secrets.BLS_RELEASE_PRIVATE_KEY }}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
workflow_call:
|
|
6
|
+
|
|
7
|
+
concurrency:
|
|
8
|
+
group: tests-${{ github.workflow_ref }}-${{ github.event.pull_request.number || github.ref }}
|
|
9
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
rust:
|
|
16
|
+
uses: blacklanternsecurity/release-workflows/.github/workflows/rust-tests.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
|
|
17
|
+
with:
|
|
18
|
+
cargo-args: --all --locked
|
|
19
|
+
test-args: --include-ignored
|
|
20
|
+
setup-script: scripts/ci-setup.sh
|
|
21
|
+
teardown-script: scripts/ci-teardown.sh
|
|
22
|
+
|
|
23
|
+
clippy-python-feature:
|
|
24
|
+
runs-on: ubuntu-24.04
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
- uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
|
|
30
|
+
with:
|
|
31
|
+
components: clippy
|
|
32
|
+
- run: cargo clippy --all-targets --all-features --locked -- -D warnings
|
|
33
|
+
|
|
34
|
+
python:
|
|
35
|
+
uses: blacklanternsecurity/release-workflows/.github/workflows/python-tests.yml@c53c202eedeb26a86088936363e6cb06ce99ac15 # v1.0.0
|
|
36
|
+
with:
|
|
37
|
+
pytest-args: blastdns/tests tests/cli_tests.py -vv
|
|
38
|
+
setup-script: scripts/ci-setup.sh
|
|
39
|
+
teardown-script: scripts/ci-teardown.sh
|
|
40
|
+
|
|
41
|
+
# Reports the contexts the protecc ruleset requires today. Remove once it requires rust / passed and python / passed.
|
|
42
|
+
required:
|
|
43
|
+
name: ${{ matrix.context }}
|
|
44
|
+
if: always()
|
|
45
|
+
needs: [rust, clippy-python-feature, python]
|
|
46
|
+
runs-on: ubuntu-24.04
|
|
47
|
+
strategy:
|
|
48
|
+
matrix:
|
|
49
|
+
context: ["python-tests (3.11)", "python-tests (3.12)", "python-tests (3.13)", "python-tests (3.14)", "python-tests (3.15)", rust-tests]
|
|
50
|
+
steps:
|
|
51
|
+
- uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
|
|
52
|
+
with:
|
|
53
|
+
jobs: ${{ toJSON(needs) }}
|
blastdns-2.0.3/AGENTS.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Fast DNS resolver in Rust with Python bindings via maturin.
|
|
4
|
+
|
|
5
|
+
## Toolchain
|
|
6
|
+
|
|
7
|
+
| Concern | This repository |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Language | Rust, edition in Cargo.toml. Python bindings, `requires-python` in pyproject.toml |
|
|
10
|
+
| Package manager | cargo, uv |
|
|
11
|
+
| Lint and format | clippy and rustfmt, no rust-toolchain.toml yet. ruff, version in the `dev` group of pyproject.toml |
|
|
12
|
+
| Tests | cargo test, pytest |
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
uv sync && uv run maturin develop
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Tests
|
|
21
|
+
|
|
22
|
+
Integration tests need two local servers: dnsmasq (see "Integration Tests" in README.md) and a BIND9 AXFR server. Without dnsmasq the Python client tests fail with `ResolverError`. Without BIND9 the zone transfer tests fail.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
sudo ./scripts/start-test-dns.sh # dnsmasq on 127.0.0.1:5353
|
|
26
|
+
./scripts/start-test-axfr.sh # BIND9 in Docker on 127.0.0.1:5354
|
|
27
|
+
cargo test --all --locked -- --include-ignored
|
|
28
|
+
uv run maturin develop --release && uv run pytest blastdns/tests
|
|
29
|
+
cargo build --release --locked && uv run pytest tests/cli_tests.py
|
|
30
|
+
./scripts/stop-test-axfr.sh && sudo ./scripts/stop-test-dns.sh
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`tests/cli_tests.py` does not match pytest's default `test_*.py` pattern, so a bare `uv run pytest` skips it. It runs the binary at `target/release/blastdns`.
|
|
34
|
+
|
|
35
|
+
## Lint
|
|
36
|
+
|
|
37
|
+
CI fails on any of these.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
cargo fmt --all -- --check
|
|
41
|
+
cargo clippy --all-targets --all-features --locked -- -D warnings
|
|
42
|
+
uv run ruff check
|
|
43
|
+
uv run ruff format --check
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Clippy runs with `-D warnings` on unpinned stable Rust, so a new Rust release can break CI with no code change, for example a newly deprecated std API.
|
|
47
|
+
|
|
48
|
+
## Benchmarks
|
|
49
|
+
|
|
50
|
+
`benchmark.yml` runs `scripts/benchmark.py` on every pull request, comparing the head build against the base branch, and comments the report on the PR. To run it locally, build each side into its own environment with `maturin develop --release` and start dnsmasq, then:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv run python scripts/benchmark.py --base BASE/.venv/bin/python --head .venv/bin/python
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Standards
|
|
57
|
+
|
|
58
|
+
Org-wide, in [blacklanternsecurity/.github/standards](https://github.com/blacklanternsecurity/.github/tree/main/standards). Read the one your task touches, not all of them.
|
|
59
|
+
|
|
60
|
+
| Document | Read it when |
|
|
61
|
+
|---|---|
|
|
62
|
+
| [principles.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/principles.md) | Always |
|
|
63
|
+
| [toolchain.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/toolchain.md) | Touching dependencies, linting, formatting, or language versions |
|
|
64
|
+
| [git.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/git.md) | Branching, commit messages, opening or reviewing a pull request |
|
|
65
|
+
| [rfc.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/rfc.md) | A change needs agreement before work starts, or an RFC is ending |
|
|
66
|
+
| [testing.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/testing.md) | Writing or changing tests, or anything that has them |
|
|
67
|
+
| [ci.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/ci.md) | Touching a workflow, an action pin, or a permissions block |
|
|
68
|
+
| [releases.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/releases.md) | Versioning, tagging, or publishing |
|
|
69
|
+
| [repository-setup.md](https://github.com/blacklanternsecurity/.github/blob/main/standards/repository-setup.md) | Creating a repository, or auditing one |
|
|
70
|
+
|
|
71
|
+
Never restate a standard here. If this file and a standard disagree, the standard wins and this file is the bug.
|
blastdns-2.0.3/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
See @AGENTS.md.
|
|
@@ -109,7 +109,7 @@ checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
|
|
|
109
109
|
|
|
110
110
|
[[package]]
|
|
111
111
|
name = "blastdns"
|
|
112
|
-
version = "2.0.
|
|
112
|
+
version = "2.0.3"
|
|
113
113
|
dependencies = [
|
|
114
114
|
"anyhow",
|
|
115
115
|
"clap",
|
|
@@ -795,9 +795,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
|
|
|
795
795
|
|
|
796
796
|
[[package]]
|
|
797
797
|
name = "libc"
|
|
798
|
-
version = "0.2.
|
|
798
|
+
version = "0.2.191"
|
|
799
799
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
800
|
-
checksum = "
|
|
800
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
801
801
|
|
|
802
802
|
[[package]]
|
|
803
803
|
name = "litemap"
|
|
@@ -822,9 +822,9 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
|
|
822
822
|
|
|
823
823
|
[[package]]
|
|
824
824
|
name = "lru"
|
|
825
|
-
version = "0.
|
|
825
|
+
version = "0.19.0"
|
|
826
826
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
827
|
-
checksum = "
|
|
827
|
+
checksum = "4a9f71e3591c7ec44d3e563e87bf14ddc2bada8519dca046e5b0e560cd004e2d"
|
|
828
828
|
dependencies = [
|
|
829
829
|
"hashbrown 0.17.0",
|
|
830
830
|
]
|
|
@@ -1454,9 +1454,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|
|
1454
1454
|
|
|
1455
1455
|
[[package]]
|
|
1456
1456
|
name = "tokio"
|
|
1457
|
-
version = "1.
|
|
1457
|
+
version = "1.54.1"
|
|
1458
1458
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1459
|
-
checksum = "
|
|
1459
|
+
checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
|
|
1460
1460
|
dependencies = [
|
|
1461
1461
|
"bytes",
|
|
1462
1462
|
"libc",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "blastdns"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.3"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
description = "Async DNS lookup library for bulk/parallel DNS resolution"
|
|
6
6
|
license = "AGPL-3.0"
|
|
@@ -26,7 +26,7 @@ hickory-proto = { version = "0.25.2", features = ["serde", "dnssec-aws-lc-rs", "
|
|
|
26
26
|
hickory-client = { version = "0.25.2", features = ["serde", "dnssec-aws-lc-rs"] }
|
|
27
27
|
hickory-resolver = { version = "0.25.2", default-features = false, features = ["system-config"] }
|
|
28
28
|
libc = "0.2"
|
|
29
|
-
lru = "0.
|
|
29
|
+
lru = "0.19"
|
|
30
30
|
regex = "1"
|
|
31
31
|
serde = { version = "1.0.228", features = ["derive"] }
|
|
32
32
|
serde_json = "1.0.150"
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: blastdns
|
|
3
|
+
Version: 2.0.3
|
|
4
|
+
Requires-Dist: orjson>=3.11.4
|
|
5
|
+
Requires-Dist: pydantic>=2.12.4
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Summary: Async Python interface on top of the BlastDNS resolver
|
|
8
|
+
Keywords: dns,async,resolver,networking,osint
|
|
9
|
+
Author-email: TheTechromancer <thetechromancer@protonmail.com>
|
|
10
|
+
License-Expression: AGPL-3.0-or-later
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
|
|
1
14
|
# BlastDNS
|
|
2
15
|
|
|
3
|
-
[](LICENSE)
|
|
4
17
|
[](https://www.rust-lang.org)
|
|
5
18
|
[](https://crates.io/crates/blastdns)
|
|
6
19
|
[](https://www.python.org/downloads/)
|
|
@@ -648,6 +661,16 @@ The global ratio is judged once enough queries have finished to trust it, over a
|
|
|
648
661
|
|
|
649
662
|
Per-resolver judgement needs enough queries against that one resolver to trust the ratio, which only happens when a resolver is carrying real load. A ratio built from a handful is mostly noise, and noise reads as a resolver that keeps starting to fail. So a resolver's window stays open for up to five request timeouts while it gathers a hundred queries, and a resolver that cannot gather them is left to the aggregate. Spread a few hundred queries per second across thousands of resolvers and no single one is individually measurable, so at brute-force scale the politeness bound is `max_inflight_per_resolver` rather than the controller — each resolver is capped at roughly `max_inflight_per_resolver / RTT` regardless.
|
|
650
663
|
|
|
664
|
+
### Shared Bottlenecks
|
|
665
|
+
|
|
666
|
+
Retries also hide congestion that every resolver shares, such as a home router or a carrier-grade NAT that drops UDP past some packet rate. Names still get answered by a retry elsewhere, so outright failures stay near zero while most attempts time out, and everything else on the link (other connections, the host's own lookups) is crowded out. No single resolver sees enough queries to judge, and the global signal sees nothing fail. So a third brake watches per-attempt loss across every resolver that has answered at least once, and paces attempts per second when that loss is well above what the path loses at a clearly lower load.
|
|
667
|
+
|
|
668
|
+
Each window spans four request timeouts and at least 500 finished attempts. Timed-out attempts are retried together, so retries arrive in waves a timeout apart, and a shorter window lands on a peak or a trough at random. A window's loss is compared with the median loss measured at no more than 60% of the current rate. When no such window is on record, the brake probes: it runs two windows at half the rate, then restores it. Loss more than three points above that reference lowers the attempt rate by 15%; otherwise the rate eases back up by 5% per window, and the limit is released once traffic no longer reaches it. As in TCP, backing off is fast and creeping back up is slow: a cut followed by a clear window still leaves the rate lower, so the rate settles at the edge of congestion rather than past it. Cutting stops when answered attempts per second fall more than 20% below what a higher rate delivered recently, so pacing protects the link first but does not grind throughput down for diminishing returns.
|
|
669
|
+
|
|
670
|
+
The limit is on attempts per second, applied right before each send. A link that polices packets or new flows tolerates a rate, not a number of queries in flight: with fewer timeouts each in-flight slot turns over faster and sends more, so capping in-flight queries does not hold a packet rate. The pace comes from a token bucket refilled every two milliseconds and holding at most ten milliseconds of burst, so a change takes effect at once in either direction.
|
|
671
|
+
|
|
672
|
+
On a path without a shared bottleneck, the probe finds the same loss at half the rate and nothing is paced. Each probe that finds nothing doubles the time until the next, up to eight minutes, so a healthy path is probed less and less often. After a minute without traffic the brake starts over rather than trusting conditions that may have changed, and with fewer than eight responding resolvers it stays off, since each resolver then carries enough queries for its own controller. Measured on a congested link, brute-forcing through 500 public resolvers while 20 concurrent HTTPS fetches and a few lookups per second through the system resolver ran alongside: unpaced, the fetches fell to under a fifth of their idle throughput and the lookups' median went from 20 milliseconds to 2.5 seconds; paced, the fetches kept over 80% of their idle throughput, the lookups were unaffected, and brute-forcing ran at about 660 names per second while attempts per name fell from about 2.7 to 1.3. On an uncongested link, pacing never engaged.
|
|
673
|
+
|
|
651
674
|
### Optional Startup Probe
|
|
652
675
|
|
|
653
676
|
With `resolver_probe` enabled, each resolver is queried once at startup and those that do not answer are dropped for the life of the client. This is aimed at large public resolver lists, where a substantial fraction of entries are typically dead. Probing queries the root nameservers, so liveness does not depend on any external zone.
|
|
@@ -750,3 +773,12 @@ uv run ruff check --fix
|
|
|
750
773
|
# Run ruff for formatting
|
|
751
774
|
uv run ruff format
|
|
752
775
|
```
|
|
776
|
+
|
|
777
|
+
## Releasing
|
|
778
|
+
|
|
779
|
+
A release is a reviewed pull request into `stable` that bumps the manifest version. The merge starts `publish.yml`, which tests and builds, waits for a `bbot-leads` approval of the `release` environment, publishes, then creates the `v<version>` tag and the GitHub release with its SBOM. See the org [publishing policy](https://github.com/blacklanternsecurity/.github/blob/main/standards/releases.md).
|
|
780
|
+
|
|
781
|
+
Each job that touches a credential runs in the `release` environment, so one release asks for approval four times: release-check's `credentials` job, `pypi`, `crates`, and the GitHub release.
|
|
782
|
+
|
|
783
|
+
Wheels are built for released CPython in its default build only. PyPy and free-threaded (`t`) interpreters install from the sdist, which needs a Rust toolchain.
|
|
784
|
+
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: blastdns
|
|
3
|
-
Version: 2.0.2
|
|
4
|
-
Requires-Dist: orjson>=3.11.4
|
|
5
|
-
Requires-Dist: pydantic>=2.12.4
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Summary: Async Python interface on top of the BlastDNS resolver
|
|
8
|
-
Keywords: dns,async,resolver,networking,osint
|
|
9
|
-
Author-email: TheTechromancer <thetechromancer@protonmail.com>
|
|
10
|
-
License-Expression: AGPL-3.0
|
|
11
|
-
Requires-Python: >=3.9
|
|
12
|
-
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
-
|
|
14
1
|
# BlastDNS
|
|
15
2
|
|
|
16
|
-
[](LICENSE)
|
|
17
4
|
[](https://www.rust-lang.org)
|
|
18
5
|
[](https://crates.io/crates/blastdns)
|
|
19
6
|
[](https://www.python.org/downloads/)
|
|
@@ -661,6 +648,16 @@ The global ratio is judged once enough queries have finished to trust it, over a
|
|
|
661
648
|
|
|
662
649
|
Per-resolver judgement needs enough queries against that one resolver to trust the ratio, which only happens when a resolver is carrying real load. A ratio built from a handful is mostly noise, and noise reads as a resolver that keeps starting to fail. So a resolver's window stays open for up to five request timeouts while it gathers a hundred queries, and a resolver that cannot gather them is left to the aggregate. Spread a few hundred queries per second across thousands of resolvers and no single one is individually measurable, so at brute-force scale the politeness bound is `max_inflight_per_resolver` rather than the controller — each resolver is capped at roughly `max_inflight_per_resolver / RTT` regardless.
|
|
663
650
|
|
|
651
|
+
### Shared Bottlenecks
|
|
652
|
+
|
|
653
|
+
Retries also hide congestion that every resolver shares, such as a home router or a carrier-grade NAT that drops UDP past some packet rate. Names still get answered by a retry elsewhere, so outright failures stay near zero while most attempts time out, and everything else on the link (other connections, the host's own lookups) is crowded out. No single resolver sees enough queries to judge, and the global signal sees nothing fail. So a third brake watches per-attempt loss across every resolver that has answered at least once, and paces attempts per second when that loss is well above what the path loses at a clearly lower load.
|
|
654
|
+
|
|
655
|
+
Each window spans four request timeouts and at least 500 finished attempts. Timed-out attempts are retried together, so retries arrive in waves a timeout apart, and a shorter window lands on a peak or a trough at random. A window's loss is compared with the median loss measured at no more than 60% of the current rate. When no such window is on record, the brake probes: it runs two windows at half the rate, then restores it. Loss more than three points above that reference lowers the attempt rate by 15%; otherwise the rate eases back up by 5% per window, and the limit is released once traffic no longer reaches it. As in TCP, backing off is fast and creeping back up is slow: a cut followed by a clear window still leaves the rate lower, so the rate settles at the edge of congestion rather than past it. Cutting stops when answered attempts per second fall more than 20% below what a higher rate delivered recently, so pacing protects the link first but does not grind throughput down for diminishing returns.
|
|
656
|
+
|
|
657
|
+
The limit is on attempts per second, applied right before each send. A link that polices packets or new flows tolerates a rate, not a number of queries in flight: with fewer timeouts each in-flight slot turns over faster and sends more, so capping in-flight queries does not hold a packet rate. The pace comes from a token bucket refilled every two milliseconds and holding at most ten milliseconds of burst, so a change takes effect at once in either direction.
|
|
658
|
+
|
|
659
|
+
On a path without a shared bottleneck, the probe finds the same loss at half the rate and nothing is paced. Each probe that finds nothing doubles the time until the next, up to eight minutes, so a healthy path is probed less and less often. After a minute without traffic the brake starts over rather than trusting conditions that may have changed, and with fewer than eight responding resolvers it stays off, since each resolver then carries enough queries for its own controller. Measured on a congested link, brute-forcing through 500 public resolvers while 20 concurrent HTTPS fetches and a few lookups per second through the system resolver ran alongside: unpaced, the fetches fell to under a fifth of their idle throughput and the lookups' median went from 20 milliseconds to 2.5 seconds; paced, the fetches kept over 80% of their idle throughput, the lookups were unaffected, and brute-forcing ran at about 660 names per second while attempts per name fell from about 2.7 to 1.3. On an uncongested link, pacing never engaged.
|
|
660
|
+
|
|
664
661
|
### Optional Startup Probe
|
|
665
662
|
|
|
666
663
|
With `resolver_probe` enabled, each resolver is queried once at startup and those that do not answer are dropped for the life of the client. This is aimed at large public resolver lists, where a substantial fraction of entries are typically dead. Probing queries the root nameservers, so liveness does not depend on any external zone.
|
|
@@ -764,3 +761,10 @@ uv run ruff check --fix
|
|
|
764
761
|
uv run ruff format
|
|
765
762
|
```
|
|
766
763
|
|
|
764
|
+
## Releasing
|
|
765
|
+
|
|
766
|
+
A release is a reviewed pull request into `stable` that bumps the manifest version. The merge starts `publish.yml`, which tests and builds, waits for a `bbot-leads` approval of the `release` environment, publishes, then creates the `v<version>` tag and the GitHub release with its SBOM. See the org [publishing policy](https://github.com/blacklanternsecurity/.github/blob/main/standards/releases.md).
|
|
767
|
+
|
|
768
|
+
Each job that touches a credential runs in the `release` environment, so one release asks for approval four times: release-check's `credentials` job, `pypi`, `crates`, and the GitHub release.
|
|
769
|
+
|
|
770
|
+
Wheels are built for released CPython in its default build only. PyPy and free-threaded (`t`) interpreters install from the sdist, which needs a Rust toolchain.
|
|
@@ -4,9 +4,9 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "blastdns"
|
|
7
|
-
|
|
7
|
+
dynamic = ["version"]
|
|
8
8
|
description = "Async Python interface on top of the BlastDNS resolver"
|
|
9
|
-
license = "AGPL-3.0"
|
|
9
|
+
license = "AGPL-3.0-or-later"
|
|
10
10
|
repository = "https://github.com/blacklanternsecurity/blastdns"
|
|
11
11
|
homepage = "https://github.com/blacklanternsecurity/blastdns"
|
|
12
12
|
authors = [{name = "TheTechromancer", email = "thetechromancer@protonmail.com"}]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# CI fixtures for the DNS tests: dnsmasq on 5353 and BIND9 AXFR on 5354.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
5
|
+
command -v dnsmasq >/dev/null || { sudo apt-get update && sudo apt-get install -y dnsmasq; }
|
|
6
|
+
sudo ./start-test-dns.sh
|
|
7
|
+
./start-test-axfr.sh
|
|
@@ -22,7 +22,7 @@ use crate::{
|
|
|
22
22
|
controller::AdaptiveController,
|
|
23
23
|
error::BlastDNSError,
|
|
24
24
|
health::{ResolverPool, ResolverStats},
|
|
25
|
-
limiter::{RateLimiter, UNLIMITED_QPS},
|
|
25
|
+
limiter::{AttemptPacer, RateLimiter, UNLIMITED_QPS},
|
|
26
26
|
resolver::DnsResolver,
|
|
27
27
|
utils::{check_ulimits, format_ptr_query, get_system_resolvers, parse_resolver},
|
|
28
28
|
worker::{QuerySpec, ResolverWorker, WorkItem},
|
|
@@ -200,6 +200,7 @@ impl BlastDNSClient {
|
|
|
200
200
|
async fn ensure_workers(&self) {
|
|
201
201
|
let pool = self.pool.clone();
|
|
202
202
|
let limiter = self.limiter.clone();
|
|
203
|
+
let pacer = Arc::new(AttemptPacer::new());
|
|
203
204
|
let work_rx = self.work_rx.clone();
|
|
204
205
|
let concurrency = self.config.max_concurrency.max(1);
|
|
205
206
|
let probe = self.config.resolver_probe;
|
|
@@ -216,6 +217,7 @@ impl BlastDNSClient {
|
|
|
216
217
|
AdaptiveController::new(
|
|
217
218
|
pool.resolvers().len(),
|
|
218
219
|
limiter.clone(),
|
|
220
|
+
pacer.clone(),
|
|
219
221
|
ceiling,
|
|
220
222
|
outcomes,
|
|
221
223
|
)
|
|
@@ -228,6 +230,7 @@ impl BlastDNSClient {
|
|
|
228
230
|
ResolverWorker::spawn(
|
|
229
231
|
pool.clone(),
|
|
230
232
|
limiter.clone(),
|
|
233
|
+
pacer.clone(),
|
|
231
234
|
work_rx.clone(),
|
|
232
235
|
worker_idx,
|
|
233
236
|
);
|
|
@@ -588,7 +591,13 @@ mod tests {
|
|
|
588
591
|
|
|
589
592
|
let pool = Arc::new(ResolverPool::new(&[resolver], &config));
|
|
590
593
|
let (tx, rx) = mpmc::bounded_async::<WorkItem>(1);
|
|
591
|
-
ResolverWorker::spawn(
|
|
594
|
+
ResolverWorker::spawn(
|
|
595
|
+
pool,
|
|
596
|
+
Arc::new(RateLimiter::new(UNLIMITED_QPS)),
|
|
597
|
+
Arc::new(AttemptPacer::new()),
|
|
598
|
+
rx,
|
|
599
|
+
0,
|
|
600
|
+
);
|
|
592
601
|
|
|
593
602
|
let query = QuerySpec {
|
|
594
603
|
host: "example.com.".into(),
|
|
@@ -632,7 +641,13 @@ mod tests {
|
|
|
632
641
|
|
|
633
642
|
let pool = Arc::new(ResolverPool::new(&[resolver], &config));
|
|
634
643
|
let (tx, rx) = mpmc::bounded_async::<WorkItem>(1);
|
|
635
|
-
ResolverWorker::spawn(
|
|
644
|
+
ResolverWorker::spawn(
|
|
645
|
+
pool,
|
|
646
|
+
Arc::new(RateLimiter::new(UNLIMITED_QPS)),
|
|
647
|
+
Arc::new(AttemptPacer::new()),
|
|
648
|
+
rx,
|
|
649
|
+
0,
|
|
650
|
+
);
|
|
636
651
|
|
|
637
652
|
let query = QuerySpec {
|
|
638
653
|
host: "example.com.".into(),
|