You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Store has pretty convoluted initialization process. We detect that store is initialized or not basing presence of Head and allow store to be used when store wasn't Inited.
Then during Start, the store is gonna detect if its initialized or not and execute the function accordingly, storing the initial header.
2. Remove notion of initialization entirely:
Initialization simply adds the first header to the Store, so do we really need a separate method/functionality for it, when it can be a simple Append/Put operation on the Store? Furthermore, the initial header is conceptually the same as Tail and considering future pruning this header is gonna move, so the Store doesnt really need to treat this initial header any special.
However, until we have pruning, this approach would require moving the initialization to the Syncer, so it becomes responsible for detecting lack of and fetching the first header. Although, there is nothing fundamentally wrong with this.
3. Apply strict initialization rules
Start throws error without prior Init
Store methods throw error without prior Start
The text was updated successfully, but these errors were encountered:
Currently Store has pretty convoluted initialization process. We detect that store is initialized or not basing presence of
Head
and allow store to be used when store wasn'tInit
ed.Options
1. Pass init func in Store ctor:
Then during
Start
, the store is gonna detect if its initialized or not and execute the function accordingly, storing the initial header.2. Remove notion of initialization entirely:
Initialization simply adds the first header to the
Store
, so do we really need a separate method/functionality for it, when it can be a simpleAppend/Put
operation on the Store? Furthermore, the initial header is conceptually the same asTail
and considering future pruning this header is gonna move, so the Store doesnt really need to treat this initial header any special.However, until we have pruning, this approach would require moving the initialization to the Syncer, so it becomes responsible for detecting lack of and fetching the first header. Although, there is nothing fundamentally wrong with this.
3. Apply strict initialization rules
Start
throws error without priorInit
Start
The text was updated successfully, but these errors were encountered: