{
 "number": 36346,
 "input_hash": "931e620a98d0c728",
 "model": "ledger",
 "prompt_hash": null,
 "created": "2026-09-28T01:15:22+00:00",
 "result": {
  "summary": "Sets a flag on ChainstateManager for the duration of ActivateSnapshot to reject new transactions and packages in AcceptToMemoryPool and ProcessNewPackage. Also rejects concurrent loadtxoutset calls if a snapshot is already being loaded.",
  "problem": "ActivateSnapshot requires an empty mempool, but releases cs_main during PopulateAndValidateSnapshot, which can take several minutes. Any transaction entering the mempool during that window causes AddChainstate to hit an assertion failure, terminating the process after metadata is written to disk and forcing a full -reindex to recover.",
  "card": "Validation rejects incoming mempool transactions and packages while an assumeutxo snapshot is being loaded. ActivateSnapshot verifies an empty mempool before releasing cs_main during snapshot population; transactions entering the mempool during that multi-minute window trigger an assertion failure in AddChainstate that crashes the node and requires a -reindex. This sets an m_snapshot_loading flag on ChainstateManager during ActivateSnapshot to reject transactions with a snapshot-loading policy error and blocks concurrent snapshot loads.",
  "evidence": [
   "Commit and description cite the exact assertion failure in AddChainstate: `Assertion failed: (!prev_chainstate.m_mempool || prev_chainstate.m_mempool->size() == 0), function AddChainstate, file validation.cpp, line 6201`.",
   "Functional test in feature_assumeutxo.py reproduces the race using a FIFO and confirms the node aborts on master when a transaction is submitted during the load."
  ],
  "scope_notes": "",
  "changed_since_previous": "Instead of letting transactions into the mempool and then aborting snapshot activation upon re-checking the mempool, the PR now prevents transactions from being accepted into the mempool while snapshot loading is in progress via an m_snapshot_loading flag.",
  "thread": {
   "last_event_at": "2026-09-27T07:55:46Z",
   "events": 2,
   "head_sha": "ca21d8f5fbc9961f2a9d0622c0cf4e23f2a82b82",
   "schema_floor": 2,
   "schema": 2
  },
  "waiting_on": [
   {
    "at": "2026-09-27",
    "id": "c:5853990694",
    "on": "reviewer",
    "url": "https://github.com/bitcoin/bitcoin/pull/36346#issuecomment-5853990694",
    "what": "fjahr to review the updated approach"
   }
  ],
  "risk": {
   "level": "medium",
   "touches": [
    "validation",
    "mempool_policy"
   ],
   "why": "Flaws in state tracking could leave the snapshot loading flag stuck on, permanently rejecting valid mempool submissions."
  },
  "discussion": {
   "author_status": "last statement processed 2026-09-27",
   "open_concerns": [],
   "resolved_concerns": [
    "fjahr: Prevent transactions from entering the mempool during snapshot validation rather than failing snapshot activation (fixed by 0xShadowX 2026-09-27)"
   ]
  },
  "reviewability": {
   "state": "Ready",
   "label": "Ready",
   "reason": "Nothing known that would invalidate a review now."
  },
  "agreement": {
   "state": "Crickets",
   "summary": "Crickets: no substantive comment either way",
   "reason": "The author implemented fjahr's suggestion to block transactions during snapshot validation and updated the description and tests.",
   "evidence": [],
   "objections": [
    {
     "reviewer": "fjahr",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "approach",
     "harm": "",
     "request": "Prevent transactions from entering the mempool during snapshot validation rather than failing snapshot activation",
     "question": "",
     "text": "Prevent transactions from entering the mempool during snapshot validation rather than failing snapshot activation",
     "clears_with": "answer",
     "blocking": false,
     "status": "fixed",
     "status_note": "author implemented the suggested approach in an update",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": true,
     "replies": [
      "c:5853990694"
     ],
     "evidence": "2026-09-26: 'it seems to me the correct fix would be to prevent the user from putting a tx into the mempool when we don't want one to get there instead of letting them do it and then fail'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36346#issuecomment-5850316714",
     "id": "c:5850316714",
     "at": "2026-09-26",
     "status_at": "2026-09-27",
     "status_by": "0xShadowX",
     "resolution_evidence": "2026-09-27: 0xShadowX: 'Makes sense, changed it to that.'",
     "pin": null,
     "from_schema": 2
    }
   ],
   "support": [],
   "participants": [
    {
     "login": "fjahr",
     "stance": "neutral",
     "note": "suggested preventing transactions from entering the mempool rather than failing snapshot activation",
     "association": "MEMBER",
     "comments": 1,
     "first": "2026-09-26",
     "last": "2026-09-26"
    }
   ],
   "derivation": "no substantive comment either way",
   "model_state": null,
   "corrections": [],
   "notes": "The author implemented fjahr's suggestion to block transactions during snapshot validation and updated the description and tests."
  },
  "dependencies": {
   "depends_on": [],
   "enables": []
  },
  "categories": [
   {
    "name": "mempool",
    "member": false,
    "evidence": "Lacks mempool label; changes are confined to validation.cpp and validation.h, gating validation's AcceptToMemoryPool rather than modifying mempool data structures or policy.",
    "band": "Unranked",
    "reason_tag": "bug fix",
    "score": 0.0,
    "factors": {
     "bug_severity": 2,
     "leverage": 0,
     "performance": 0,
     "security_stability": 2,
     "user_value": 1
    },
    "rationale": "Does not alter core mempool policy, relay rules, or mempool internals."
   },
   {
    "name": "validation",
    "member": true,
    "evidence": "Carries the Validation label, edits validation.cpp/h, and modifies ChainstateManager assumeutxo activation logic.",
    "band": "P1",
    "reason_tag": "bug fix",
    "score": 0.85,
    "factors": {
     "bug_severity": 2,
     "leverage": 0,
     "performance": 0,
     "security_stability": 2,
     "user_value": 1
    },
    "rationale": "Fixes a crash safety bug where transactions entering the mempool during ActivateSnapshot trigger an assertion failure in AddChainstate, terminating the node after metadata is written and forcing a full -reindex to recover."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": []
 },
 "cost_usd": 0.0,
 "source": {
  "record": "2026-09-28T01:15:22+00:00",
  "code": "2026-09-28T01:22:36+00:00",
  "judgments": 2
 }
}