fix(sigcache): update comment for new entry size

The 2026-07-04 sigcache fix (239cf61, originally reverted, re-landed
here) changed the cache entry from a 64-bit XOR-mix to a uint256
SHA256(sighash || sig || pubkey). Default capacity is 200,000
entries, so peak memory grew from ~1.6 MB to ~6.4 MB. The stale
comment claimed 8 bytes per entry; correct that.

No code change — comment only. Confirmed via Claude's 2026-07-07
review of the reverted commits that re-landing 239cf61 is safe
(performance fix, no consensus change, SHA256 collision risk is
cryptographically infeasible).
This commit is contained in:
Sami Ahmed
2026-07-07 22:33:26 -07:00
parent 37142195b9
commit fa683c2655
+3 -2
View File
@@ -1260,8 +1260,9 @@ public:
void Set(uint256 hash, const std::vector<unsigned char>& vchSig, const std::vector<unsigned char>& pubKey)
{
// Increased default to 200,000 entries (~1.6MB at 8 bytes each).
// The old 50,000 limit was too small and caused frequent evictions.
// Default 200,000 entries (~6.4MB at 32 bytes each — entries are
// uint256 SHA256(sighash || sig || pubkey)). The old 50,000 limit
// was too small and caused frequent evictions.
int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 200000);
if (nMaxCacheSize <= 0) return;