-
Notifications
You must be signed in to change notification settings - Fork 115
Introduced Node View actors #324
base: main
Are you sure you want to change the base?
Conversation
* (e.g. if it is a first launch of a node) None is to be returned | ||
*/ | ||
def restoreState(): Option[NodeView] | ||
protected def restoreHistory(): Option[History] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this method be moved in StateHistoryActor
now, as there are no state and history variables now in NVH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you are right and these should be moved to the correspondent actors
*/ | ||
protected def genesisState: NodeView | ||
protected def restoreState(): Option[State] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for restoreHistory
/** Restore a local memory pool during a node startup. If no any stored view found | ||
* (e.g. if it is a first launch of a node) None is to be returned | ||
*/ | ||
protected def restoreMempool(): Option[MPool] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for restoreHistory
protected def memoryPool(): MP = nodeView._4 | ||
/** Hard-coded initial state all the honest nodes in a network are making progress from | ||
*/ | ||
protected def genesisState(): State |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How these direct readers are expected to be used from NVH when state and history aren't available directly from NVH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was expected to be used for component actors initialization, as in Hybrid example. But you're probably right, this should be moved to actors itself
protected def vault(): VL = nodeView._3 | ||
/** Hard-coded initial history all the honest nodes in a network are making progress from | ||
*/ | ||
protected def genesisHistory(): History |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for genesisState
context.system.eventStream.publish(SuccessfulTransaction[TX](tx)) | ||
/** Hard-coded initial history all the honest nodes in a network are making progress from | ||
*/ | ||
protected def genesisMempool(): MPool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for genesisState
*/ | ||
protected val memoryPoolActor: ActorRef = createMemoryPoolActor() | ||
|
||
protected var vault: Vault = restoreVault().getOrElse(genesisVault()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't vault
implemented as an actor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this definitely should be implemented as an actor, I just did not manage to do it in time. Please fix this
Fixes #325