fix(legacy): fetch blocks from the asset service with the trusted HTTP client (stacked on #1675) - #1677
Conversation
The TTL cleaner reads the height on its own goroutine while services write it from a blockchain subscription; the svp2p parity harness reports the race on CI.
The legacy_* keys the service reads (with legacy_config_* fallbacks for keys the legacy service reads reflectively), the SubscriberSVP2P source name and its RPC gate, the trusted-fetch helper for operator-configured URLs, and the in-memory Kafka additions the service tests use.
Port of SVNode net.cpp/net_processing.cpp semantics: transport (association streams, extended >4 GiB frames), protocol (handshake, addrman, headers-first sync, multi-peer block download, serving, BIP152 compact block receive), bridge to the Teranode pipeline, scripted-peer test harness and a legacy/svp2p parity harness. Ported rules cite the C++ source line.
Off by default: starts only with -svp2p=1 or startSvp2p=true, and the daemon refuses to run it together with the legacy service (shared ports and settings).
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
🤖 Claude Code Review Status: Complete This PR is stacked on #1675; only the final commit ( Current Review:
The change swaps
|
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-09-01 10:54 UTC |
The root .gitignore excludes *.bin, so the four real-block fixtures the bridge tests read never reached the branch; CI fails with 'no such file or directory' while local runs pass on the untracked copies.
…P client asset_httpAddress is operator-configured, and its default is localhost; the peer-facing SSRF dial policy on the shared HTTP client made a single-process node unable to serve a block. Uses the trusted client introduced for svp2p.
f41c103 to
411b1db
Compare
|



Summary
Stacked on #1675 — only the last commit (
f41c103da) is new; the rest is the svp2p service branch.asset_httpAddressis an operator-configured URL whose default ishttp://localhost. The legacy service reads blocks from it through the shared peer-facing HTTP client, whose SSRF dial policy blocks loopback — so a single-process node cannot serve a block over legacy P2P. This switches that one call toutil.DoTrustedHTTPRequestBodyReader(introduced in #1675), which keeps the scheme validation and redirect bound but skips the peer-address policy. Do not route peer-derived URLs through it.One line changed in
services/legacy/peer_server.go.