Commit graph

10 commits

Author SHA1 Message Date
Calin Culianu
9b351f29ae
More efficiencies added to mempool synch, plus ENABLED NOTIFICATIONS
Cleaned up the code a bit.  Still a WIP and needs performance tuning.
2019-12-31 13:14:27 +02:00
Calin Culianu
808b14369d
Comments nits 2019-12-31 00:43:15 +02:00
Calin Culianu
86f0f79094
Nit: Removed some dead code in SubsMgr
Got rid of that getFullHistory_nolock_noupdate since it may confuse me
later. Can add it back if needed in the future.
2019-12-30 22:37:47 +02:00
Calin Culianu
cf1c24d8e1
Added a mechanism to return the cached status has for .subscribe
If the SubsMgr knows the status has because it already announced it to
clients (other clients were subscribed), then this is returned.
Otherwise nothing is returned and client must, as before, grab the full
history to compute the status.
2019-12-30 22:29:29 +02:00
Calin Culianu
7929fe46d4
Made the Subscription::lastStatusNotified an optional value
This is more correct -- so as to differentiate between that and empty
(no status).
2019-12-30 21:51:42 +02:00
Calin Culianu
8ce34ca921
Nit fixups to some templates in Util.h: toList and toVec
Made them easier to use, leveraging C++17 type deduction.
2019-12-30 17:37:59 +02:00
Calin Culianu
4c8647c2ae
Added subs totals per-client, as well as per-sh + stats port
- Totals kept track of on sub per-client, as well as app-wide.
- Also added the /stats enpoint debug/stats info for the SubsMgr
2019-12-30 14:58:16 +02:00
Calin Culianu
532f11e95d
Fixed crash bug in SubsMgr::removeZombies + redid ownership of SubsMgr
- The crash bug was due to misuse of
robin_hood::unordered_flat_map::erase (it's still kind of bizarre that
it would crash the way it did, but I suppose the next iterator was
invalidated somehow).  We instead grab the next returned by .erase() and
now it works ok.

- We redid the ownership model of SubsMgr.  Rather than having
Controller own it and pass it all the way down to the Server instances,
we instead have Storage create & own it.  This is needed because in the
future Storage may need to invalidate cached sub statuses as blocks are
undone in undoLatestBlock, and/or it may need to atomically add
notifications as blocks are added.  So it makes sense for Storage to own
the SubsMgr (as it also owns the Mempool, which has similar ephemeral
qualities).
2019-12-30 10:33:35 +02:00
Calin Culianu
79e810dc0d
Fixed crash bug
Not sure why it was crashing in debug mode in ~CtlTask but I think it
was due to a compiler bug using __FUNCTION__ + Debug(printf_format).  We
switched it up and it no longer crashes.
2019-12-30 01:58:54 +02:00
Calin Culianu
d876eecd0f
WIP 2019-12-29 22:57:04 +02:00