You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node: bytes_in region accounting is never fed by the pull orchestrator — regionStats and the region log report 0 inbound while paid pulls flow #858
Severity: MEDIUM — from the 2026-06-10 full-repository review (#831/#834 surface).
Location
crates/node/src/region_accounting.rs:104-114 — record_pulled has zero production callers; its doc still says "the future pull orchestrator calls this"
crates/node/src/runtime/mod.rs:1264-1298 — NodeOriginDeps carries no accountant
crates/node/src/node_origin.rs — the pull path records metrics + reputation, never region bytes
Impact
With cache.node_to_node_pull_through_enabled, the node pays for inbound bytes from upstream peers whose regions are resolvable, but bytes_in stays 0 in admin_v1_regionStats and the periodic region_bandwidth log line — exactly the surface an operator uses to reconcile pull spend by region (capacity planning / regulatory reporting, #750's stated purpose).
Not a duplicate
#750 (closed) shipped the accountant with this seam deliberately left for the pull orchestrator; #831/#834 landed the orchestrator without feeding it.
Fix direction
Pass the RegionAccountant into NodeOriginDeps and call record_pulled(peer, bytes) on a delivered pull.
The RegionAccountant.record_pulled() method shipped in #750 but was never wired into the node-to-node pull path; when #831/#834 landed the pull orchestration, NodeOriginDeps was not updated to carry the accountant. As a result, bytes_in is permanently 0 in admin_v1_regionStats and the region_bandwidth log line whenever cache.node_to_node_pull_through_enabled is active — operators cannot reconcile pull spend by region despite paying for those bytes.
📊 Assessment
Dimension
Value
Reasoning
Type
Bug
Silent data loss in an operator-facing metrics surface; no design ambiguity
Labels
bug, medium, rust (already applied)
Correct — no changes needed
Coding agent
Suitable
Exact file/line locations given, fix direction is explicit, change is self-contained in 3 files
Add region_accountant: Arc<RegionAccountant> (or similar handle) to NodeOriginDeps in crates/node/src/runtime/mod.rs:1264-1298
Pass the existing RegionAccountant instance from the runtime wiring into NodeOriginDeps at construction
In crates/node/src/node_origin.rs, after a successful pull delivery, call region_accountant.record_pulled(peer_id, bytes_received)
Remove or update the stale doc comment on record_pulled in region_accounting.rs:104-114 that says "the future pull orchestrator calls this"
Add a unit/integration test asserting that a node-to-node pull increments bytes_in in regionStats for the correct region
Verification:admin_v1_regionStats should show non-zero bytes_in for the upstream peer's region after a cache-miss pull when node_to_node_pull_through_enabled = true. The region_bandwidth periodic log line should also reflect it.
Scope note: The bug is limited to bytes_in tracking; bytes_out (served to downstream clients) is a separate path and is not mentioned as broken here.
Activity
github-actions commentedon Jun 10, 2026
🎯 Triage report
The
RegionAccountant.record_pulled()method shipped in #750 but was never wired into the node-to-node pull path; when #831/#834 landed the pull orchestration,NodeOriginDepswas not updated to carry the accountant. As a result,bytes_inis permanently 0 inadmin_v1_regionStatsand theregion_bandwidthlog line whenevercache.node_to_node_pull_through_enabledis active — operators cannot reconcile pull spend by region despite paying for those bytes.📊 Assessment
bug,medium,rust(already applied)🔗 Similar issues
RegionAccountantwith the seam deliberately left for the pull orchestrator; this issue is the consequence of reputation: outbound report capture + selection-consumes-reputation (gated on node-to-node pull-through orchestration) #831/feat(node): node-to-node cache-miss pull-through + outbound reputation (#831) #834 not closing that seamRegionAccountantintoNodeOriginDepsor callrecord_pulled💡 Notes and suggestions
Fix checklist:
region_accountant: Arc<RegionAccountant>(or similar handle) toNodeOriginDepsincrates/node/src/runtime/mod.rs:1264-1298RegionAccountantinstance from the runtime wiring intoNodeOriginDepsat constructioncrates/node/src/node_origin.rs, after a successful pull delivery, callregion_accountant.record_pulled(peer_id, bytes_received)record_pulledinregion_accounting.rs:104-114that says "the future pull orchestrator calls this"bytes_ininregionStatsfor the correct regionVerification:
admin_v1_regionStatsshould show non-zerobytes_infor the upstream peer's region after a cache-miss pull whennode_to_node_pull_through_enabled = true. Theregion_bandwidthperiodic log line should also reflect it.Scope note: The bug is limited to
bytes_intracking;bytes_out(served to downstream clients) is a separate path and is not mentioned as broken here.Add this agentic workflows to your repo
To install this agentic workflow, run
test(node): assert Err-arm pulls record no bytes_in; clarify accounti…
docs(node): drop issue-number refs (#858, #831) from PR comments
docs(node): restore issue-number refs (#852, #858, #831) in comments
fix(node): feed RegionAccountant on delivered node→node pulls (#858) (#…