Blashttp request_batch_stream#3080
Merged
liquidsec merged 2 commits intoblasthttp-integration-cleanfrom May 5, 2026
Merged
Conversation
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary✅ No significant performance changes detected (all changes <10%) 🐍 Python Version 3.11.15 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## blasthttp-integration-clean #3080 +/- ##
===========================================================
- Coverage 91% 91% -0%
===========================================================
Files 440 440
Lines 38098 38110 +12
===========================================================
+ Hits 34361 34370 +9
- Misses 3737 3740 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
liquidsec
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate BBOT's batch HTTP path from
request_batchto the newrequest_batch_streamasync-iterator API (blasthttp#17). Results now arrive in completion order — a slow request no longer blocks faster peers behind it, and Python processing overlaps with in-flight HTTP I/O.Changes
Core helper (bbot/core/helpers/web/web.py)
WebHelper.request_batch(returns list) withWebHelper.request_batch_stream(async generator). Same entry shapes (url/(url, kwargs)/(url, kwargs, tracker)); trackers are now correlated by a per-URL deque since completion order ≠ input order.iter_batch_resultsadapter — the native blasthttp 0.4.0 iterator yields lists ofBatchResult(chunked 1000-or-200ms drains across the Python↔Rust boundary); the upstream Python wrapper from the PR will yield individual items. The adapter handles both shapes so callers can write a singleasync for.Module call sites migrated to
helpers.request_batch_streampgp,git,telerik,iis_shortnames(×2),templates/bucket,ntlmModule call sites migrated to
client.request_batch_streamviaiter_batch_resultshttp— true streaming. URL/URL_UNVERIFIED results emit immediately on arrival. Only OPEN_TCP_PORT paired probes (both http+https for the samehost:port) are buffered, and only the https half, until the matching http resolves the suppression decision. Single-scheme OPEN_TCP_PORT events (rare) and unmatched paired https at end-of-stream pass through normally. Per-result processing extracted into_process_result.web_brute— fuzz dispatch streams: yara WAF filter, redirect filter, and hit collection run inline as results arrive. Thecanary_found and hitsdecision still happens after stream end (it has to), but the work is interleaved with HTTP I/O instead of running serially after a full drain. Canary baseline and mid-scan validation also stream.Test infra
mock_blasthttp—handle_batch→ async-generatorhandle_batch_stream; passthrough path normalizes Rust-side lists to individual items so the mock's contract is "one BatchResult per yield".conftest— patchesrequest_batch_streaminstead ofrequest_batch.test_web— usesasync for; tracker assertion is now set-based since order isn't deterministic.The underlying
blasthttp.BlastHTTP.request_batchis still used bytest_web_rate_limit.pyto exercise the library'smin(global, per_call)rate-limit semantics — that's testing blasthttp itself, not BBOT, so it's left alone.Test plan
pytest bbot/test/test_step_1/test_web.py bbot/test/test_step_1/test_web_rate_limit.py— 13 passedtest_module_{pgp,git,telerik,iis_shortnames,ntlm,http,web_brute,web_brute_shortnames,bucket_*}— 38 passedruff checkandruff format --check— cleantest_step_1failures (test_cli,test_dns::test_wildcards,test_modules_basic::test_module_loading, etc.) are pre-existing on this branch by re-running them with my changes stashed