This paves the way for better object lifetime management.
Concretely, it makes it possible to:
- have different stores backing chain and state data.
- having the same datastore library, but using different parameters.
- attach different caching layers/policies to each class of data, e.g.
sizing caches differently.
- specifying different retention policies for chain and state data.
This separation is important because:
- access patterns/frequency of chain and state data are different.
- state is derivable from chain, so one could never expunge the chain
store, and only retain state objects reachable from the last finality
in the state store.
Go 1.16 elides dependencies from go.sum when you don't use a package
which has these dependencies.
This means dependencies for the `rice` command where not in our
`go.sum`.
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Most changes are just tagging deps. However,
* Updates go-ipld-hamt to fix a bug in the new V3 HAMT.
* Updates bitfield to save ~10% for some operations.
This pulls in the improvements introduced in:
- https://github.com/raulk/go-watchdog/releases/tag/v1.0.0
- https://github.com/raulk/go-watchdog/releases/tag/v1.0.1
Lotus tries to initialize the watchdog in the following order of precedence:
1. If a max heap limit has been provided, initialize a heap-driven watchdog.
2. Else, try to initialize a cgroup-driven watchdog.
3. Else, try to initialize a system-driven watchdog.
4. Else, log a warning that the system is flying solo, and return.
This PR also enabled automatic heap profile capture when memory usage
surpasses 90% of the limit. Profiles are written to <LOTUS_HOME>/heapprof.
A single heap profile is captured per episode, with a max of 10 episodes
captured during the lifetime of the process. Episode = instance of usage
climbing above the 90% threshold.