Bug was (likely) as follows:
Reader thread | Writer thread (state sync)
invalidate tickets
get ticket
miss cache
read database
insert to cache insert to cache (racing)
ticket is valid
panic
write to database
The writer thread must insert to db first so that the db read
cannot find an old value while holding a valid ticket
## Description
Describe the changes or additions included in this PR.
## Test plan
How did you test the new or updated feature?
---
## Release notes
Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.
For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.
- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] gRPC:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
Co-authored-by: Eugene Boguslavsky <eugene@mystenlabs.com>