-
Notifications
You must be signed in to change notification settings - Fork 633
[CSL-24] Move local MPC data from Acidic storage #410
Comments
@georgeee Local data is not to be stored in ACID |
@Gromak Yes, we must move local data into memory state. It doesn't make much sense to do refactoring which moves local data from version as a separate task. It will be more efficient to move local data into memory state at once. That's why I have updated this issue. |
@Gromak And now 12h estimation is reasonable :) |
@neongreen Looks okay to me. Where |
@Gromak @neongreen good question. It should be stored on very high level, higher than |
@Gromak Btw, we also need to add something like |
@Gromak
This part is not implemented, I have created issue about it: CSL-155. |
@Gromak In general we have finished this issue, but there are some improvements to be done: CSL-154, CSL-155 and CSL-153. |
--I propose to use structure similar to the one used by
TxStorage
: i. e. store local data only for the current version and global data for all versions. When rollback happens, we filter local data to make sure that it's valid.--I doesn't make much sense to store local MPC data on disk. Size of it will be limited, because size of block will be limited (for example, I think block must fit into RAM). It means that we should move local MPC data from
GtStorage
. It also means that we need to movegetLocalSscData
fromSscStorageClass
. As well assscProcessMessage
. Good question is where to move it :)I propose to create
SscLocalDataClass
type class, as well asSscLocalData
type family inSsc
.SscLocalDataClass
will contain:•
sscNewLocalData :: MonadIO m => m (LocalData ssc)
•
sscDestroyLocalData :: MonadIO m => LocalData ssc -> m ()
•
sscProcessMessage :: MonadIO m => SscPayload ssc -> SscMessage ssc -> LocalData ssc -> m () -- first argument is global payload which is taken from main persistent storage
•
sscGetLocalPayload :: MonadIO m => SlotId -> LocalData ssc -> m (SscPayload ssc) -- maybe should take global payload too
Note: it's pseudocode.
It can be implemented as
IORef
, for example.I want @neongreen to comment this solution, maybe it won't work for some reason.
Regarding atomicity: I don't see any fatal problems. We must be careful though, because, for example, when we pass global payload to
sscProcessMessage
it may happen that global payload changes. But actually we just need to check local payload before adding it to block, that's all.The text was updated successfully, but these errors were encountered: