Commit a29ecaf
integrator
dash(stratum): explicitly invalidate template cache on the coin-P2P tip event — close stale-payee window under future io-decouple
Reward-safety hardening for the --coin-p2p-connect (hotel) config. Today the
stale-payee window closes CORRECTLY on a coin-P2P tip change, but only
IMPLICITLY: the coin-P2P arm's on_tip_changed handler does bump_work_generation()
+ notify_all(), and the fresh-payee GBT re-source happens only because the
coin-P2P arm has no refresh_executor_ (so cached_work() takes the legacy
inline-blocking re-source path instead of serve-stale-while-refreshing).
If #781's io-decouple is ever extended to the coin-P2P arm, refresh_executor_
becomes set: cached_work() would then serve the STALE cached template (frozen
masternode payee) while refreshing async -> a stale-payee job goes out -> the
window REOPENS -> lost blocks on a rotated payee.
Fix: make it explicit + robust — the coin-P2P on_tip_changed handler now calls
ws->invalidate_template_cache() alongside bump_work_generation() + notify_all()
(mirrors the #770/#772 fire_refresh trio: invalidate + bump + notify). The
invalidate DROPS the cache, so cached_work() re-sources with the fresh-tip payee
regardless of refresh_executor_ state; a set-gap (honest null) is served until the
fresh template lands — never a stale-payee job.
KATs (folded into the already-allowlisted test_dash_stratum_work_source; no
build.yml change): with a DEFERRED refresh_executor_ (models the rpc_pool
background thread) and the fallback rotated to a NEW tip/payee after the cache is
primed —
- InvalidateClosesStalePayeeWindowUnderRefreshExecutor: after invalidate+bump the
served job is NEVER the stale tip-A template (set-gap, then fresh tip-B).
- BumpAloneServesStaleUnderRefreshExecutor: the contrast — bump-only serves the
STALE tip-A payee, proving invalidate is what closes the window.
Consensus-neutral: notify/refresh timing only — no share/payout/target/payee-value
change. stratum_work_source 40 -> 42 green; c2pool-dash builds+links.1 parent d5d3766 commit a29ecaf
2 files changed
Lines changed: 104 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1575 | 1575 | | |
1576 | 1576 | | |
1577 | 1577 | | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
1581 | | - | |
1582 | | - | |
1583 | | - | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1584 | 1593 | | |
1585 | 1594 | | |
1586 | 1595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1414 | 1503 | | |
0 commit comments