PDP watchers registered with ChainSched.AddHandler currently run inline on the ChainNotify consumer path. Several of these handlers perform DB polling, DB transactions, and ETH contract reads. If one stalls, ChainNotify stops draining, which can back up the Lotus RPC output buffer and delay unrelated chain-driven work.
Move PDP handlers to an async, coalesced trigger model:
- ChainSched callback only records the latest head and sends a non-blocking signal.
- A single thread processes the signal.
- Process all watchers from this single thread synchronously to avoid incorrect tipset apply.
- Leave PoRep/window handlers on the existing synchronous path.
This should prevent slow PDP cleanup/delete/settlement/proving scheduling paths from blocking ChainNotify while preserving level-triggered PDP behavior.
PDP watchers registered with ChainSched.AddHandler currently run inline on the ChainNotify consumer path. Several of these handlers perform DB polling, DB transactions, and ETH contract reads. If one stalls, ChainNotify stops draining, which can back up the Lotus RPC output buffer and delay unrelated chain-driven work.
Move PDP handlers to an async, coalesced trigger model:
This should prevent slow PDP cleanup/delete/settlement/proving scheduling paths from blocking ChainNotify while preserving level-triggered PDP behavior.