Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Introduced Node View actors #324

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Introduced Node View actors #324

wants to merge 3 commits into from

Conversation

mike-aksarin
Copy link
Contributor

@mike-aksarin mike-aksarin commented Dec 14, 2018

Fixes #325

* (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]
Copy link
Contributor

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?

Copy link
Contributor Author

@mike-aksarin mike-aksarin Dec 21, 2018

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]
Copy link
Contributor

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]
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

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())
Copy link
Contributor

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?

Copy link
Contributor Author

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

@coveralls
Copy link

coveralls commented Dec 20, 2018

Coverage Status

Coverage decreased (-0.4%) to 46.102% when pulling 3a2f61a on node_view_actors into 5320730 on master.

Base automatically changed from master to main February 3, 2021 23:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants