hypercube-lab / hypercube

HyperCube is a revolutionary, high-performance decentralized computing platform. HyperCube has powerful computing capabilities to provide high-performance computing power and large-scale data storage support for VR, AR, Metaverse, Artificial Intelligence, Big Data, and Financial Applications.🛰
GNU General Public License v3.0
974 stars 222 forks source link

Add log subscriptions to historian for thick clients #1

Open hypercube-lab opened 2 years ago

hypercube-lab commented 2 years ago

Consider if clients and verifiers need access to the whole log. At the moment, the accountant gets fresh log entries by listening to a sync channel that is controlled by the historian. There is no serialization of such entries, and they do not travel throughout the network.

This ticket's implementation may be done by adding historian stub and a matching historian skel that listens on the internal channel to the database. Another possibility is that we will need a generic "switchboard operator" that simply translates network protocols to our deserialized, well-typed channels.

alexandria999eth commented 2 years ago

https://github.com/rust-lang/rfcs/blob/master/text/2033-experimental-coroutines.md

alexandria999eth commented 2 years ago

To achieve the same performance with futures instead of blocking calls, we can port our clients to Tokio so that our synchronous API can be used with futures. However, futures are still awkward. What we really want is to use coroutines to interleave event handling within our synchronous API. Regrettably, that's really early in Rust 

alexandria999eth commented 2 years ago

Alternatively, the API may be changed to make it more like a one-way street. To hear updates, clients will only be asked to be available. A continuous cycle for the ledger might be possible, and that would allow new clients to be cloned, while existing clients will be able to recover from a restart. We could have the client-side code block entirely, so that the synchronous API that we use for the clients works as it should.

hypercube-lab commented 2 years ago

@all-contributors please add @alexandria999eth for infrastructure, tests and code

allcontributors[bot] commented 2 years ago

@hypercube-lab

I've put up a pull request to add @alexandria999eth! :tada: