helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

revert region cache changes, add prewarm #1399

Closed evanmcc closed 2 years ago

evanmcc commented 2 years ago

the region cache getting invalidated on var transactions + the low poc rate are interacting in bad ways to make post-var rewards pretty disastrous.

in #1385 we tried a change to make this happen automatically, but it does not seem to have been effective, and is causing performance problems in normal operation.

This PR reverts #1385 and adds some region cache prewarming code that starts in the background whenever the node starts or a var transaction is absorbed on the active ledger. While the prewarm is pretty expensive, it's cheaper than massive chain stalls caused by multi-minute rewards blocks.