-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Milestone
Description
Context
Currently, constraints are stored in memory. If the sidecar shuts down / restarts, they will be lost. We should write constraints to disk with the following atomicity guarantee:
ONLY sign a commitment if we were able to write the constraint to disk, otherwise we risk "losing" the commitment
When starting up, we should read these constraints into our local block template.
Note that the persistent cache functions as a backup: it should only be read at startup time, and be written to whenever a new commitment is made. The block template / simulation should still happen in memory. This means we need atomicity between making a commitment & constraint, storing it on disk, and storing it in memory, to make sure we always have consistency.
Stack
- Use an embedded DB with JSON serialization (or some binary encoding scheme, but let's keep it boring)
- Embedded DB options:
redb: pure rust, active maintenance, but self-proclaimed beta (although used in Lighthouse)rocksdb: probably most well known but wraps a C library and thus has some annoying dependencies
0ex-d
Metadata
Metadata
Assignees
Labels
No labels