/
RNode feature gaps

RNode feature gaps

WIP

Persistence optimization

Cold Store

https://github.com/rchain/rchain/blob/dev/rspace/src/main/scala/coop/rchain/rspace/history/ColdStore.scala

RSpace in its current form does not handle singular values under a given channel. It deals with lists.

rho: x!("42")
cold store: hash(List("42")) -> List("42")
rho: x!("43")
cold store: hash(List("42", "43")) -> List("42", "43")
rho: x!("44")
cold store: hash(List("42", "43", "44")) -> List("42", "43", "44")

This has two consequences that need to be considered:

  1. lookup
  2. size on disk
  3. LMDB limit on data per hash

ad 1.

When RSpace needs to deal with channel "x" it has to fetch the whole list and deserialize its contents.

ad 2.

There is no data sharing: in the above example, "42" will be stored 3 times.

ad 3.

There is a limit to how much data can fit under one name in LMDB. The current implementation assumes that it will never be reached.


Random part

RSpace.createWithReplay[
      F,
      Par,
      BindPattern,
      ListParWithRandom,
      TaggedContinuation
    ]


case class ListParWithRandom(
    pars: _root_.scala.collection.Seq[coop.rchain.models.Par] = _root_.scala.collection.Seq.empty,
    randomState: coop.rchain.crypto.hash.Blake2b512Random = coop.rchain.models.ListParWithRandom._typemapper_randomState.toCustom(_root_.com.google.protobuf.ByteString.EMPTY)
    )
TaggedContinuation contains a

case class ParBody(value: coop.rchain.models.ParWithRandom)


RSpace is unaware of what data it contains.

trait ISpace[F[_], C, P, A, K]

class RSpace[F[_], C, P, A, K](
    historyRepository: HistoryRepository[F, C, P, A, K],
    storeAtom: AtomicAny[HotStore[F, C, P, A, K]],
    branch: Branch
)(
    implicit
    serializeC: Serialize[C],
    serializeP: Serialize[P],
    serializeA: Serialize[A],
    serializeK: Serialize[K],

The nature of how rholang discovers change (a notion of time, evolution, progress etc.) is by an element that is able to divide and merge. In the current im