0x-mesh icon indicating copy to clipboard operation
0x-mesh copied to clipboard

MiniHeaders maintained separately in-memory and in DB

Open fabioberger opened this issue 5 years ago • 0 comments

We have a piece of technical debt that was introduced when we refactored the permanent storage of blockchain headers such that they are only stored once the block was processed by OrderWatcher. We now have two different representations of a stack for storing MiniHeaders. simplestack is in-memory and uses a clearly defined interface that can be independently tested. But we have another implicit representation in the database that is not clearly defined with an interface, has slightly different rules (for example it can technically hold more than retentionLimit MiniHeaders for a small period of time before they are removed), is not easy independently test, and is not guaranteed to be in sync with the in-memory version. This second representation is stored to the DB within OrderWatcher. This is arguably poor design and we should try and rectify it in the future.

fabioberger avatar Feb 21 '20 13:02 fabioberger