{
 "number": 27052,
 "input_hash": "5ef8bae2e28f7683",
 "model": "openrouter/google/gemini-3.8-flash",
 "batch": false,
 "created": "2026-09-17T15:48:04+00:00",
 "provider": "Google",
 "stop_reason": "end_turn",
 "usage": {
  "input_tokens": 27298,
  "cache_creation_input_tokens": 0,
  "cache_read_input_tokens": 0,
  "output_tokens": 4593
 },
 "cost_usd": 0.03769725,
 "error": null,
 "result": {
  "display": {
   "goal": [
    "Expose when each peer was first to announce a block via getpeerinfo",
    "Provide functional test coverage for stale-tip peer eviction timestamp tracking"
   ],
   "reviewability": [
    "Ready for merge; CI is passing and recent revisions have multiple ACKs."
   ],
   "agreement": [
    "Strong support with tested ACKs verifying the RPC output and test behavior (naiyoma, rkrux)",
    "Concept approval for improving peer observability and regression testing (satsie, kristapsk)"
   ],
   "categories": [
    {
     "name": "p2p",
     "why": [
      "P3 because it provides functional test coverage for header announcement tracking that drives stale-tip peer eviction.",
      "Modernizes internal announcement timestamps in net_processing to use NodeClock time points."
     ]
    },
    {
     "name": "rpc",
     "why": [
      "P3 because it adds peer quality and announcement timing observability to getpeerinfo.",
      "Exposes an existing internal timestamp without breaking backwards compatibility."
     ]
    }
   ]
  },
  "summary": "This PR adds a `last_block_announcement` field to the `getpeerinfo` RPC output, reporting the UNIX timestamp when a peer was the first to announce a new block extending the tip. It updates the internal representation in net_processing to use `NodeClock::time_point` instead of `int64_t`, refactors the peer eviction loop slightly, and adds a functional test (`p2p_block_times.py`) ensuring this timestamp is correctly set and maintained.",
  "problem": "Stale-tip outbound peer eviction relies on tracking which peer least recently announced a new block, but this tracking had no dedicated functional test coverage, making regression verification difficult (e.g. after #26172). Additionally, node operators had no visibility into which peers provide prompt block announcements.",
  "discussion": {
   "open_concerns": [],
   "resolved_concerns": [
    "Switching timestamp representation from int64_t to NodeClock::time_point / NodeSeconds and avoiding duration count calls (maflcko, theuni)",
    "Avoiding sentinel values in worst_peer eviction iteration (naiyoma, dergoegge, theuni)",
    "Addressing functional test timeouts and verifying chainwork edge cases using mutation testing (naiyoma, danielabrozzoni)"
   ],
   "author_status": "active"
  },
  "reviewability": {
   "state": "Ready",
   "label": "Ready",
   "reason": "All review feedback, test edge cases, and type cleanups have been resolved and the PR is passing CI."
  },
  "agreement": {
   "state": "Strong",
   "summary": "Tested ACKs from naiyoma and rkrux, with earlier concept approval and all reviewer concerns resolved.",
   "reason": "Multiple contributors tested and reviewed the functional test, RPC changes, and chrono cleanups with no outstanding objections.",
   "evidence": [
    "Tested ACK from naiyoma confirming functional test catches header announcement bugs and survives mutations.",
    "Tested ACK from rkrux confirming RPC output and running test suites.",
    "Concept ACKs from satsie and kristapsk in favor of test coverage and peer observability."
   ]
  },
  "dependencies": {
   "depends_on": [],
   "enables": []
  },
  "categories": [
   {
    "name": "docs",
    "member": false,
    "evidence": "Only adds a release note for the new RPC field; documentation changes that merely accompany code belong to their area.",
    "band": "Unranked",
    "reason_tag": "",
    "score": 0.0,
    "factors": {
     "security_stability": 0,
     "bug_severity": 0,
     "performance": 0,
     "user_value": 0,
     "leverage": 0
    },
    "rationale": "Not a primary docs change."
   },
   {
    "name": "p2p",
    "member": true,
    "evidence": "Touches net_processing eviction logic and adds a functional test for P2P block announcement message processing.",
    "band": "P3",
    "reason_tag": "test coverage",
    "score": 0.35,
    "factors": {
     "security_stability": 1,
     "bug_severity": 0,
     "performance": 0,
     "user_value": 1,
     "leverage": 1
    },
    "rationale": "P3 because it adds regression test coverage for peer block announcement timestamp tracking which drives stale-tip peer eviction, and modernizes internal net_processing time representation."
   },
   {
    "name": "rpc",
    "member": true,
    "evidence": "Adds the last_block_announcement field to getpeerinfo RPC output and updates rpc_net.py.",
    "band": "P3",
    "reason_tag": "new feature",
    "score": 0.3,
    "factors": {
     "security_stability": 0,
     "bug_severity": 0,
     "performance": 0,
     "user_value": 1,
     "leverage": 1
    },
    "rationale": "P3 because it exposes a previously internal timestamp in getpeerinfo, providing visibility into peer responsiveness for operators and tests without breaking backwards compatibility."
   },
   {
    "name": "tests",
    "member": false,
    "evidence": "The added test (p2p_block_times.py) pins specific P2P relay and announcement behavior; tests of a particular area belong to that area rather than test infrastructure.",
    "band": "Unranked",
    "reason_tag": "",
    "score": 0.0,
    "factors": {
     "security_stability": 0,
     "bug_severity": 0,
     "performance": 0,
     "user_value": 0,
     "leverage": 0
    },
    "rationale": "Per the category definition, functional tests that test one domain belong to that domain rather than tests."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": [],
  "card": "This PR adds a `last_block_announcement` timestamp field to `getpeerinfo` and adds a dedicated functional test (`p2p_block_times.py`) verifying that the node properly records when a peer was first to announce a block extending the active chain. This timestamp drives stale-tip peer eviction and was previously uncovered by functional tests following a bug fix in #26172. The change also modernizes internal announcement timestamps to use `NodeClock::time_point`. The PR has multiple tested ACKs, green CI, and is ready for merge."
 },
 "raw_text": null
}