Skip to content

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

Closed

Description

@thiras

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.

Activity

  1. added
    kind:bug
    prio:medium
    rust
    on Jun 10, 2026
  2. github-actions commented on Jun 10, 2026

    @github-actions

    🎯 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, 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

    🔗 Similar issues

    💡 Notes and suggestions

    Fix checklist:

    • 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.

    Generated by Agentic Triage for issue #858 · sonnet46 529.5K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. self-assigned this
    on Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:bugprio:mediumrust

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions